mIRC Home    About    Download    Register    News    Help

Print Thread
#237847 08/06/12 09:05 AM
Joined: May 2012
Posts: 5
E
eggyesd Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
Joined: May 2012
Posts: 5
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?

eggyesd #237848 08/06/12 09:58 AM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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).

Last edited by Wims; 08/06/12 09:59 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
eggyesd #237855 08/06/12 09:25 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Chances are your chat server may support multiple targets:
Code:
/cow /join #cow,#cow2,#cow3

eggyesd #237864 09/06/12 02:55 AM
Joined: May 2012
Posts: 5
E
eggyesd Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
E
Joined: May 2012
Posts: 5
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?

Last edited by eggyesd; 09/06/12 06:19 AM.
eggyesd #237866 09/06/12 06:46 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
eggyesd #237868 09/06/12 10:22 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.


Link Copied to Clipboard