mIRC Home    About    Download    Register    News    Help

Print Thread
distinguishing different networks #103169 17/11/04 06:06 AM
Joined: Nov 2004
Posts: 10
N
noize Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Nov 2004
Posts: 10
When loading a script, is it limited to use on the network status window in which it was loaded? If not, how do you specify which network the script will run on if someone is connected to multiple networks on same client?


- noize
Re: distinguishing different networks #103170 17/11/04 06:39 AM
Joined: Jun 2003
Posts: 5,024
M
Mentality Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
I don't know what event(s) you're referring to, but the general frame is:

on *:event-name:{
if ($network == NetworkName) {
continue to do this stuff
}
}


e.g.

on *:connect:{
if ($network == DALnet) {
msg nickserv identify password
}
}


So this on connect event would work if you connect to DALnet, but not to another network.

Also see /help if then else.

Regards,


Mentality/Chris
Re: distinguishing different networks #103171 17/11/04 06:41 AM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
You can use a loaded script across all server connections, and to limit use of a script you simply need an if statement to check the value of $network or $cid and decide whether the script should continue with commands based on the returned values. It's also possible to use a custom alias to check the number of the connection assosciated with a triggered event, since $cid isn't really sequential:

Code:
alias con {
  var %x 
  scid -a $(%x = %x $cid,) 
  return $findtok(%x,$cid,32) 
}

Re: distinguishing different networks #103172 17/11/04 01:31 PM
Joined: Nov 2004
Posts: 10
N
noize Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Nov 2004
Posts: 10
Thanks Metality & Sigh for the help. Sorry I have to ask for help on things that are so miniscule. The help file will only take you so far with understanding. Someone could make a good profit off an in depth "IRC Scripting for Dummies" e-book. Once again, thanks a lot.


- noize