mIRC Home    About    Download    Register    News    Help

Print Thread
$nick == %variable? #252080 19/03/15 12:20 PM
Joined: Mar 2015
Posts: 6
B
Borden Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2015
Posts: 6
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?

Last edited by Borden; 19/03/15 12:21 PM.
Re: $nick == %variable? [Re: Borden] #252081 19/03/15 12:33 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 .

Re: $nick == %variable? [Re: Borden] #252082 19/03/15 12:37 PM
Joined: Nov 2014
Posts: 79
N
Newbie Offline
Babel fish
Offline
Babel fish
N
Joined: Nov 2014
Posts: 79
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.

Re: $nick == %variable? [Re: westor] #252084 19/03/15 01:10 PM
Joined: Mar 2015
Posts: 6
B
Borden Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2015
Posts: 6
Originally Posted By: westor
($istok(%VARIABLE,$nick,32)) { do stuff }


This is exactly what I was looking for, thank you!