mIRC Homepage
Posted By: pouncer menu question - 17/09/07 06:53 PM
I want to add a menu to my

menu nicklist {
}

but i only want it to appear in the menu IF there exists such a dialog called 'userlist2'

is this possible guys? if the dialog doesnt exists i dont want the menu to appear at all
Posted By: SladeKraven Re: menu question - 17/09/07 07:02 PM
It is possible, but that would involve alot of looping through scripts to see if "dialog userlist2 {" is in any of your scripts. $dialog only returns information about dialogs that are currently open.
Posted By: hixxy Re: menu question - 17/09/07 07:06 PM
Code:
alias dialogexists {
  var %i = 1
  while ($script(%i)) {
    if ($read($v1,nr,/^(?:n\d+=)?dialog(?: -l)? $$1 \{$/i)) { return $true }
    inc %i
  }
  return $false
}
on *:start:{ set %userlist2.exists $dialogexists(userlist2) }

menu nicklist {
  $iif(%userlist2.exists,<your menu here>): <command here>
}
Posted By: pouncer Re: menu question - 17/09/07 07:39 PM
ah i see, thanks hixxy for the code
© mIRC Discussion Forums