mIRC Homepage
Posted By: Innocent multiple commands with ON - 09/04/04 04:19 PM
Yo,
i want thinks like this:

on 1:JOIN:#Rivella,#dod.wars:/mode #rivella +v $nick ;/mode #dod.wars +v $nick ; /msg $nick hihi

its an example, but is it possible to use 2 commands with a ; or something?
Posted By: starbucks_mafia Re: multiple commands with ON - 09/04/04 04:27 PM
Use braces '{ }':

on 1:JOIN:#Rivella,#dod.wars:{
mode #rivella +v $nick
mode #dod.wars +v $nick
msg $nick hihi
}
Posted By: FiberOPtics Re: multiple commands with ON - 09/04/04 04:42 PM
As starbucks said, u can use the braces { }.
Then you can, as he stated, just put ur commands each time on a new line.

You can however in this case, also use pipes, which some users might find 'uglier' but i think they are handy for when ur dealing with short commands.

So you could do:
Code:
on 1:JOIN:#Rivella,#dod.wars:{ mode #rivella +v $nick | mode #dod.wars +v $nick | msg $nick hihi } 
  

OR
Code:
 
on 1:JOIN:#Rivella,#dod.wars:{
mode #rivella +v $nick | mode #dod.wars +v $nick | msg $nick hihi 
} 
 

OR as starbucks showed
Code:
on 1:JOIN:#Rivella,#dod.wars:{
mode #rivella +v $nick
mode #dod.wars +v $nick
msg $nick hihi
} 
  

What scripting style u use, that is entirely up to you..feel free to chose whatever suits u smile

On a side note, you don't have to specify the target channel in this event, as it is saved in the '#' or '$chan' parameter, so you could do:
Code:
  
on @!*:JOIN:#Rivella,#dod.wars:{ mode # +v $nick | msg $nick hihi }


Note that the @ means that the script will only trigger if you are oped in the channel where the join occurs, and the ! means that the script will not trigger, when you are the person that joins.

Greetz
Posted By: gemeau50 Re: multiple commands with ON - 09/04/04 09:13 PM
Quote:
on @!*:JOIN:#Rivella,#dod.wars:{ mode # +v $nick | msg $nick hihi }


I don't believe that " ! " is required in this instance since you are not an operator when you join a channel.

gemeau50
Posted By: FiberOPtics Re: multiple commands with ON - 09/04/04 10:14 PM
Hi,

That is correct, and I was aware of that when making it, I just added it out of precaution + showing him that ! can be used instead of if ($nick != $me), even though in this case it can be seen as redundant.

Grtz
Posted By: Innocent Re: multiple commands with ON - 10/04/04 04:25 PM
Thanks, it works!
© mIRC Discussion Forums