mIRC Homepage
Posted By: Borden $nick == %variable? - 19/03/15 12:20 PM
Hello,
currently trying to do something like this:

Code:
On *:text:!command:#:{
  if (($nick isop $chan) { msg $chan $nick did the thing! 
    set %commanduser $nick
  }
}

and
Code:
On *:text:!command2:#:{
  if ($nick == %commanduser) { msg $chan %commanduser did the second thing! 
    unset %commanduser
  }
}

I think what it's supposed to do is fairly easy, but I'll explain it anyways. Basically I want to give every moderator the power to do a certain command, however only the specific person who started it should have the power to do the follow-up command too.

Pretty sure the syntax "if ($nick == %commandstarter)" is wrong.
Is there even a way of doing this or should I rely on .txt files?
Posted By: westor Re: $nick == %variable? - 19/03/15 12:33 PM
The most easy way is using opers.txt and $read if the nick is into the .txt , also there are more other ways that you can do this like storing all operator nicknames into one global variable and use the if ($istok(%VARIABLE,$nick,32)) { do stuff } and the nicknames there must be stored like %variable Nick1 Nick2 .
Posted By: Newbie Re: $nick == %variable? - 19/03/15 12:37 PM
That's the way I use a similar script. Set the nick as a variable and then allow them only to use the next command.
Posted By: Borden Re: $nick == %variable? - 19/03/15 01:10 PM
Originally Posted By: westor
($istok(%VARIABLE,$nick,32)) { do stuff }


This is exactly what I was looking for, thank you!
© mIRC Discussion Forums