mIRC Home    About    Download    Register    News    Help

Print Thread
#244257 09/02/14 06:05 AM
Joined: Apr 2013
Posts: 27
R
RuLerZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Apr 2013
Posts: 27
Hello I am attempting to allow people to enable and disable commands in a multi-room bot only in the channel its disabled. The %commands.rulerz1364 Off does get created fine using the !commandsoff command.
The command will work if I just make the if variable %commands without the .# after.
I have tried getting rid of the # sign and making it just %commands.rulerz1364 using the $right(#,-1) command but did not work.
My problem seams to lie with the "%commands. $+ #" when being checked during the !drink command.
I am sure this is something simple I have tried removing it all and typing it out again to confirm syntax.
I have also tried if ($+(% $+ commands. $+ #) = Off) {} but nothing...

Here is the code:

Code:
on *:text:!commandsoff:#:{
  if ( $nick = rulerz1364 ) {
    set %commands. $+ # Off
    msg # Commands have been turned off
  }
}
on *:text:!commandson:#:{
  if ( $nick = rulerz1364 ) {
    set %commands. $+ # On
    msg # Commands have been turned on
  }
}
on *:text:!drink:#:{
  if ( %commands. $+ # = Off ) { return }
  else { msg # Gives $nick a Drink }
}


Thanks for any support on this.

Last edited by RuLerZ; 09/02/14 06:07 AM.
Joined: Apr 2013
Posts: 27
R
RuLerZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Apr 2013
Posts: 27
I found the fix after looking over other scripts and changed the commands to look something this this:

Code:
if (%commands.setting [ $+ [ $chan ] ] == OFF) { return }


Link Copied to Clipboard