mIRC Homepage
Posted By: noize distinguishing different networks - 17/11/04 06:06 AM
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?
Posted By: Mentality Re: distinguishing different networks - 17/11/04 06:39 AM
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,
Posted By: Sigh Re: distinguishing different networks - 17/11/04 06:41 AM
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) 
}
Posted By: noize Re: distinguishing different networks - 17/11/04 01:31 PM
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.
© mIRC Discussion Forums