mIRC Home    About    Download    Register    News    Help

Print Thread
#251069 08/02/15 01:01 AM
Joined: Feb 2015
Posts: 243
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
ok.. so a friend had explained twice how to use /scon ... right now i want to use it on the last server
the last connection number can be given by $scon(0) , right????
so! when i do /scon $scon(0) i get this message
set connection id to: (random number connection)
ANyone can explain to me cause i've been trying to make it work for like... an hour and it's a little tiny stupid detail i want to fix and upload next version of my bot!! and i cant get it to work pfftt
sorry for my attitude .. sometimes i get furious when something isnt working out :@
Edit: i wrote wrong reply text, corrected it now..

OrFeAsGr #251071 08/02/15 02:43 AM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Each connection has an ID (cid), it can be any number, it doesn't matter, The first connection could have the ID 72, you would do "/scid 72 echo -s test" and it would echo to the first status window, /scid works with connection ID.

$scid(N) allow you to retrieve the connection ID of the connection ID given by N, it's not really useful in itself $scid($cid) is always $cid. it's just here for convenience, it's typically only used to evaluate an identifier on a given connection like $scid(<cid>).me returns the value of $me on that connection ($me and $scid($cid).me are equal, for example)

/scon works with connection number, /scon 2 means the second status window, always.

$scon(N) return the Nth connection's ID

$scon(0) = $scid(0) = total number of 'connection'

If you want to execute something on the last server, /scon $scon(0) or /scon $scid(0) or /scid $scon($scon(0)) or /scid $scon($scid(0)) will work

If you use /scid or /scon without a command, it just sets the active connection for the rest of the script, if you execute "//scon 2 | echo -s test" on the first connection, it will set the active connection as the second connection and therefore echo on that second status window, the active connection is reset after a script finish or by /scon -r.
If you use /scid or /scon with a command, the active connection is reset to the current connection after it executed, if you execute on the first connection: "//scon 2 echo -s test | echo -s test", it would first echo on the second connection and then on the first connection.
Watch out, /scid and /scon when used directly with a command can be dangerous:
http://en.wikichip.org/wiki/mirc/msl_injection


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #251072 08/02/15 03:48 AM
Joined: Feb 2015
Posts: 243
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Thanks for the good help and advices @Wims smile


Link Copied to Clipboard