mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 37
D
druiddk Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 37

Hmm... can't find anything in documentation on this subject... Is it possible to have an on 1:TEXT for multiple servers?

Like /server some.server.efnet.org
/server -m other.server.ircnet.net

:-)

Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
Code:
on 1:TEXT:*:*:{
  if ($server == [color:green]some.server.efnet.org[/color]) { commands}
  elseif ($server == [color:green]other.server.ircnet.net[/color]) { commands }
}

You can also use $network.

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Each on TEXT event will fire within the context of the server on which the event fired. The same event will fire on all servers if they occur there. You can think of each connection ($scon or $scid) as being its own mIRC instance. The new multi-server scripting identifiers and commands allow you to breach the connection boundaries.

You can limit which servers or networks the event actually works on if you so choose to, using one of the following ideas (as well as others):

if ($network == EFnet)
if ($server == irc.somewhere.net)
if ($cid == 2)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Feb 2003
Posts: 37
D
druiddk Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Feb 2003
Posts: 37
Okay cool!

so:

Code:
on 1:TEXT:hello:#say_hello:{
if ($cid == 2) { .msg $nick why hello there! }
} 


I take it will then msg $nick on the server it was triggered on...
But what if i want to msg a nick on the OTHER server

like .msg hellofetish $nick said hello on $network

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Then you can use the /scon or /scid command to cross the connection boundry.

/scid 1 msg hellofetish $nick said hello on $network

Also, keep in mind that $cid is a changeable value. If you open 3 connections, they will be numbered 1, 2 and 3, respectively. (And $scid(N) will match $scon(N).)

$scid(1) == $scon(1)
$scid(2) == $scon(2)
$scid(3) == $scon(3)

If you then close the first two connections and open two different server connections (with /server -m), now you have 3 connections open again, but the $cid's will be 3, 4 and 5, which does not match the $scon(N) anymore. $scon's follow the total number of connections you have open.

$scid(3) == $scon(1)
$scid(4) == $scon(2)
$scid(5) == $scon(3)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard