mIRC Home    About    Download    Register    News    Help

Print Thread
#234531 01/11/11 01:05 AM
Joined: Jul 2006
Posts: 4,144
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Consider this:
Code:
menu nicklist {
  $qt($0) - $qt($1-) : echo -a $0 -- $qt($1-) -- $qt($sline($active,1)) -- $qt($snicks)
}
If nothing is selected in the nicklist, right clicking an empty area of the nicklist trigger the menu but:
-the value of $0 is 1 when the menu is displayed while $1 is $null
-the value is correctly set to 0 when you execute the command.

Same problem occurs if you select more than one (let's say 2) nickname and then rightclick on one of them, the value of $0 is 1 and only $1 exists before executing the command, after, values are correct.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
An old issue - and I'm still not sure whether it can fittingly be fixed if it really turns out to be a side-effect of $submenu.
I hope Khaled will shed some light on it this time. smile

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
i wouldn't think this is related to $submenu(), since $submenu() is just evaluated in a separate environment where $0 = 1 and $1 = begin, 1, 2, 3, ..., end, similar to (but slightly less complicated than) how $findfile()'s command parameter is evaluated with $1- = filename. see:

Code:
//tokenize 32 a b c | echo -a $submenu($iif($1 <= 10, a:b)) - $0 - $1-


so 10 popups are returned to $submenu(), $1 takes on a number of different values throughout, but these don't interfere with the values of $Ns in the caller. in cases where $submenu() isn't used, there is even less reason to believe it may be the culprit ;P

it looks as though Khaled has just chosen to stop collecting selected nicks after the first one, in the popup creation stage at least. my first thought was that it's a matter of efficiency, and that perhaps with the way popups have been implemented, it would involve a loop through all selected nicks for each and every line in nicklist popups. however, it seems this isn't the case, and that the selected nick is presently collected just once at the very beginning:

Code:
menu nicklist {
  Test $1:/
  Test $iif((1) sline # 2,):/
  Test $1:/
}


so i don't see why this would be a difficult change to make


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Hmm, plausible. smile

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks the first issue with $0 returning 1 when no item is selected has been fixed for the next version. The second issue is intended - only one item is returned when building the menu - otherwise if a user selects a hundred nicknames you will end up with a menu that does not fit on the screen.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Maybe add a "halt" after 5 or 10 users? just a idea smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jul 2006
Posts: 4,144
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
I don't really get it, the number of nickname selected doesn't affect the size of the popups, not directly at least.
If this is about preventing us from using (for example) $1- because it might be a very long string, there's already a limit on the maximum number of characters allowed in the popups (~260 characters here on win7), we wouldn't be able to make a popups that doesn't fit on the screen.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
This feature has worked this way for a very long time, so there are no plans to change it as it would affect all existing scripts. I also just tested this under Windows XP and 7 and I was able to create a popup menu that covered the whole screen and beyond.


Link Copied to Clipboard