mIRC Homepage
Posted By: eggyesd Quick Question - 08/06/12 09:05 AM
Hi guys,

I was wondering if it was possible to add multiple commands to an alias?

For Instance, in my alias panel.

/cow /join #cow /join #cow2 /join #cow3

All on the same line. Obviously this is incorrect and it will only take my first variable. Anyway around it?
Posted By: Wims Re: Quick Question - 08/06/12 09:58 AM
alias with multiple line must use { }, and you must seperate command with a | (space seperated) or with a new line

Code:
/cow { join #cow | join #cow2 }
or
/cow {
join #cow
join #cow2
etc
}

Note that you can join several channel with only one /join command, it's recommended since it only sends one command to the server (type /help /join in mIRC).
Posted By: Tomao Re: Quick Question - 08/06/12 09:25 PM
Chances are your chat server may support multiple targets:
Code:
/cow /join #cow,#cow2,#cow3
Posted By: eggyesd Re: Quick Question - 09/06/12 02:55 AM
Thanks Guy!!! Lots of help and much appreciated.

Further question though is it possible to set a small DELAY on a remote command?

on CLOWN1:TEXT:*clean*:#:{
.timer 1 5 msg $chan WINDOWS <-- I would like this to have a small delay
}


on CLOWN2:TEXT:*clean*:#:{
.timer 1 5 msg $chan WINDOWS <-- I would like this to have a small delay
}


on CLOWN3:TEXT:*clean*:#:{
.timer 1 5 msg $chan WINDOWS <-- I would like this to have a small delay
}


Is this correct?
Posted By: argv0 Re: Quick Question - 09/06/12 06:46 AM
Did you try it?

Also, it looks like you have 3 events doing the exact same thing... why not just have one single user level?
Posted By: Tomao Re: Quick Question - 09/06/12 10:22 AM
Assuming you have various user levels doing the same command, you can use an if statement and $ulevel identifier to do it in three ways:

on *:TEXT:*clean*:#:{
if ($ulevel == clown1) || ($ulevel == clown2) || ($ulevel == clown3) {
...

on *:TEXT:*clean*:#:{
if ($istok(clown1 clown2 clown3,$ulevel,32)) {
...

on *:TEXT:*clean*:#:{
if ($regex($ulevel,/^clown[1-3]$/i)) {
...

Note that the regex example doesn't count unless you really have the same user level with 1, 2, 3...etc attached at the end.
© mIRC Discussion Forums