mIRC Homepage
Posted By: ErikMouse Problem with script - 18/06/10 05:03 AM
Hey there, I am having a bit of a problem here with this. I have a remove script entered into my mIRC that is "on +20,+90:JOIN:#testing:/mode #testing +v $nick". For some reason even though a +20 user joins, the +v happens, but it does not happen with the +90 user for some reason and wondering what the problem is. Thank you for any help with this.
Posted By: RusselB Re: Problem with script - 18/06/10 05:15 AM
To my knowledge, you can't have multiple levels specified in the <level> section of the event (in this case, ON JOIN), so the code is only recognizing the first +20 for the level.

You could re-write the event to use a wildcard level, then check the actual userlevel with $ulevel or you could copy your ON JOIN event and specify +20 for one event and +90 for the other.
Posted By: ErikMouse Re: Problem with script - 18/06/10 06:19 AM
I am thinking that it is this that I needed to have instead if I wanted to only have users on levels 20, 80, and 90 to be voiced in the channel.
Code:
on @*:JOIN:#testing:{
  if ($ulevel == 20) { mode #testing +v $nick }
  elseif ($ulevel == 90) { mode #testing +v $nick }
  elseif ($ulevel == 80) { mode #testing +v $nick }
  else { halt }
}
Posted By: Tomao Re: Problem with script - 18/06/10 07:58 AM
ErikMouse, of all the if and elseifs, not to mention the else is not needed, you can simply do this with $istok:
Code:
on @*:JOIN:#testing:{
  if ($istok(20 80 90,$ulevel,32)) {
    mode # +v $nick
  }
}
You only need to specify the #testing in the join event. You don't have to indicate the channel in the mode command.
© mIRC Discussion Forums