Submenu behaviour - 02/06/08 06:12 AM
I recently run into this (just an example code):
The submenu return double-evaluates, thus if you have halfops in a channel (pnick starting with a % char), treating %nick like a variable (likely resulting in an empty return), and &nick (protected ops) are hotkeyed due to the & char...
Interesting: change the return command to e.g.: ...and you'll see mIRCs "internal syntax morphing" of
"%bla = value" to "set %bla value"
I'd like to know how to *correctly* reduce evaluation depth in $submenus (for the moment, I'm just preventing it by adding a char: $+($chr(160),$nick($2,$1).pnick) - this is working only for %pnick but not &pnick), and in addition, I'd appreciate an explanation for why this double evaluation in submenus is necessarry.
Thanks!
Code:
menu channel { test .$submenu($test($1,$active)) } alias -l test { if (($1 isnum) && ($nick($2,$1))) { return Nr. $1 = $nick($2,$v1).pnick : noop } }
The submenu return double-evaluates, thus if you have halfops in a channel (pnick starting with a % char), treating %nick like a variable (likely resulting in an empty return), and &nick (protected ops) are hotkeyed due to the & char...
Interesting: change the return command to e.g.:
Code:
if (($1 isnum) && ($nick($2,$1))) { $nick($2,$v1).pnick = Nr. $1 : noop }
"%bla = value" to "set %bla value"
I'd like to know how to *correctly* reduce evaluation depth in $submenus (for the moment, I'm just preventing it by adding a char: $+($chr(160),$nick($2,$1).pnick) - this is working only for %pnick but not &pnick), and in addition, I'd appreciate an explanation for why this double evaluation in submenus is necessarry.
Thanks!