on ^*:OPEN:*:?: {
if (%setting.autoreply) { msg $nick Text text text }
}
menu menubar {
-
$iif(%setting.autoreply, $style(1)) Query AutoReply {
set %setting.autoresply $iif(%setting.autoreply, 0, 1)
}
}
all i did was use a varable as a flag to signal if that setting is on or off .. you could select any varable name for this as long as you are consistant thoughout the script. the menu menubar { tells mIRC to place that popup menu in the mIRC menubar (at the top between 'tools' and 'window' .. usualy called command but may be called something different depending on your script
you can change where the popup goes by changing the word 'menubar' to 'query' or 'channel' or 'status' or whatever ..
the alias uses mIRC's $style() feature to place a checkmark if the varable is on (set to 1) .. and do nothing if the varable is off (set to 0 or null) .. type /help $style to see more options for that.
$iif() is an identifer that alows you to use an if conditional statment as an identifer to return a value based on the condition given .. for example
$iif(1 == 1, yes, no) will return yes, because the condition is true,
$iif(1 == 2, yes, no) will return 'no', because the condition is false.
anouther way you could have gone about acomplishing this is by useing mIRC's #group feature .. where you can do
#group on/off
code
#group end
and you can /enable or /disable the group of code .. however i discourage useing #groups .. it makes very slopy code and causes alot of problems down the road if you get ingo very large scripting projects or being mixing scripting projects.
if you require more explination on my example feel free to ask, you can study how i did this and aply it to other areas in your script that you want to be able to turn on/off by a menu.
Cobra^