mIRC Homepage
Posted By: saragani cid, scon and scid - 12/08/03 07:12 PM
I need to create a script which checks if the user is connected to the server while being pinged.
(For example, I found a server that pings the user as soon as he tries to connect, even before the server has sent the Network name to the user).

I would like that the script will write the network name.
I used:

//scid 7 scon -at1 echo $!network

(Considering that the cid of the window that I'm working on is 7)



It does echoes the network name, but it write it in all the status windows (For example, if I have 6 status windows, then I will get the network name of the CID 7 in all of them).

I would like that the command will be executed only on CID 7 and only if its connected .

How can I do that?
Posted By: theRat Re: cid, scon and scid - 12/08/03 07:15 PM
//scid 7 if ( $!network ) echo $!network

maybe?
Posted By: saragani Re: cid, scon and scid - 12/08/03 07:17 PM
What about
//scid -t1 7 echo $!network

It should work to, I think.

Thanks. I will try your solution.
Posted By: saragani Re: cid, scon and scid - 12/08/03 07:31 PM
If I want to know that a server exists in the server list, I can use: $server(server_name)

How can I find if the Network (Group) exists in the server list?
Posted By: SladeKraven Re: cid, scon and scid - 12/08/03 07:49 PM
$Server(0) Returns the total number of servers in your server list.
$Server(N).desc Returns the description of a server in your list.
$Server(N).group Returns the group of server N.
$Server(N).port Returns the port of server N.
$Server(N).pass Returns the pass of server N (if you entered a password in the field).
From the help file..
If you specify an irc server address and it is in your servers list, it returns its associated info.
Posted By: saragani Re: cid, scon and scid - 12/08/03 08:14 PM
Still you didn't answer my question.

I already know all of what you wrote from the help file.

Is there a way to know if a Network is in the servers list:

For example: The network is Saragani
I don't know which servers belong to Saragani, so I can't use
$server(irc.saragani.net).group cause I don't know irc.saragani.net
Posted By: qwerty Re: cid, scon and scid - 13/08/03 09:15 AM
$server can't do that (this has been a feature suggestion afair; imo it definitely needs additional functionality), but you can read from the servers.ini file:
Code:
alias isgroup if $read(servers.ini,nw,*GROUP: $+ $1) { return $true } | return $false
Eg. $isgroup($network)
Posted By: saragani Re: cid, scon and scid - 13/08/03 12:34 PM
Thanks.
© mIRC Discussion Forums