mIRC Home    About    Download    Register    News    Help

Print Thread
identifyer for a server already connected #86146 09/06/04 06:54 PM
Joined: May 2004
Posts: 11
P
PHM Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2004
Posts: 11
im trying to make a sniplet for somtehing like

if ($network isconnected ) { halt }

i want it to stop trying to connect to the server if its already connected
any ideas?

Re: identifyer for a server already connected #86147 09/06/04 07:02 PM
Joined: Mar 2004
Posts: 108
X
xxxYODAxxx Offline
Vogon poet
Offline
Vogon poet
X
Joined: Mar 2004
Posts: 108
if ($network != $null)

i dont see the purpose, but i dont see any code either, hehe.. that what your looking for?

-cheers


sometimes these are as bad as quit messages :tongue:
Re: identifyer for a server already connected #86148 09/06/04 07:09 PM
Joined: May 2004
Posts: 11
P
PHM Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2004
Posts: 11
that worked thanks smile
took me a bit to understand but i got it smile

Last edited by PHM; 09/06/04 07:27 PM.
Re: identifyer for a server already connected #86149 09/06/04 07:34 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
$network is not suitable for this purpose. If you add a server in Servers list and you're offline, $network returns the name for the network you specified there. Use $server instead: it returns the server name if you're connected, otherwise $null.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: identifyer for a server already connected #86150 10/06/04 06:47 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Whats wrong with $status ?

Quote:

$status
Returns server connection status.

Note: This returns closing during the on DISCONNECT event if the status window being closed is the cause of the disconnection.




Re: identifyer for a server already connected #86151 10/06/04 09:13 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Nothing's wrong with it, I just prefer $server because you can do
if ($server)
while with $status you must do
if ($status == connected)
which is lengthier.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: identifyer for a server already connected #86152 18/06/04 07:20 PM
Joined: Mar 2004
Posts: 130
T
tsoglanos Offline
Vogon poet
Offline
Vogon poet
T
Joined: Mar 2004
Posts: 130
just use the on connect event

3 explains see below

1 of 3
;just on connect perform a command ...
;perform command on specify network

on 1:CONNECT:if ($network == GRNet) { timerconnect off }

the same can be done with a server.

on 1:CONNECT:if ($server == darkness.irc.gr) { timerconnect off }

2 of 3
now the same with multi networks ~,or servers

on 1:CONNECT:{
var %s = server1 server2 server3 server4
if ($istok(%s,$server,32)) Command
}
the same now with networks

on 1:CONNECT:{
var %n = GRNet DALnet somnet
if ($istok(%n,$network,32)) Command
}