mIRC Homepage
Posted By: vinifera scon scid - 08/02/12 12:34 AM
is there some thorough tutorial
or a explanatory script that uses scid and scon
to teach newbies to use them ?

I wanted to make myself some small project script
that would make sort of "nick per network"
for example to when mirc is connected to 2 networks
it always only reads what /mnick and /anick are set
but I wanted to have it better that mirc reads from ini file
something like if network = efnet, read efnet defined nick and anick
and if its other network, then read from ini its defined names

but I know nothing of using scid and scon
Posted By: Riamus2 Re: scon scid - 08/02/12 03:30 AM
scid and scon really aren't needed for something like that. You can either include the nick when using /server (this can be scripted if you wanted), or just use an on connect script that checks $network and changes the nick to match what is in an ini file or wherever you choose to store the information. In general, you will want to either start with the right nick (using the /server command) or change it immediately upon connect.
Posted By: vinifera Re: scon scid - 08/02/12 05:18 PM
would such thing screw everything
if I get disconected and then reconnected on 2 or more networks
at same time ? :P

did anyone ever make simmiliar script ?
Posted By: Riamus2 Re: scon scid - 08/02/12 05:55 PM
No, it would work fine. That's why you're using $network if you use the on CONNECT event and if you're setting the nick through /server, then you're already setting it to the right connection. All events work on the connection that the event is triggered on, no matter how many connections you have. For example, If you were in the same channel on two different networks, if you have an on TEXT event and it triggers, it will affect the network it is triggered on instead of other networks. And so on.


Here's an example of using on CONNECT. You can, of course add additional things like your alternate nick or have it set the nick using $readini() if you store the information in an INI file instead of in the script itself or any number of other things.
Code:
on *:connect: {
  if ($network == Undernet) { nick UndernetNick }
  elseif ($network == Efnet) { nick EfnetNick }
}


scon and scid are mostly for doing things on a network that didn't trigger the event (or all networks). If you're just doing something on the network that triggered the event, even if you want something done on many networks when they each trigger the event, then you don't need scon or scid.
Posted By: vinifera Re: scon scid - 10/02/12 10:23 AM
how about when connecting to private network or server
that doesn't have defined name for network
but just server name

is that $null then or something else ?
Posted By: Riamus2 Re: scon scid - 10/02/12 11:18 AM
Connect to it and type: //echo -a $network

That will tell you what the network name is. AFAIK, there will still be one regardless if the network is private. If it really is $null, then you can use $server instead, but for any networks with multiple servers, you'd have to either define them all in your IF statements or use wildcards if possible. Or, again, you can include the nick when using the /server command to connect.
Posted By: vinifera Re: scon scid - 11/02/12 12:58 PM
I will do your method then
as it looks most painless and easiest smile

thanks
© mIRC Discussion Forums