From WikiChip
Difference between revisions of "mirc/commands/scid"
< mirc‎ | commands

m (Bot: Adding a template)
(Switches)
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{mirc title|/scid Command}}
 
The '''/scid command''' can change the connection associated with the current script. When a command is not specified, mIRC changes the connection of the current script to the connection associated with the given Connecion ID. The rest of the code will continue to execute on that connection. When a command is specified, mIRC will execute the command on the connection specified by the Connection ID or the connections based on the switches provided. Any active connection changes are restored upon returning to the calling routine. A command can be executed on all or some of the connections depending on their types using the -a or -at<Type> switches.
 
The '''/scid command''' can change the connection associated with the current script. When a command is not specified, mIRC changes the connection of the current script to the connection associated with the given Connecion ID. The rest of the code will continue to execute on that connection. When a command is specified, mIRC will execute the command on the connection specified by the Connection ID or the connections based on the switches provided. Any active connection changes are restored upon returning to the calling routine. A command can be executed on all or some of the connections depending on their types using the -a or -at<Type> switches.
  
Line 12: Line 13:
  
 
== Synopsis ==
 
== Synopsis ==
  /scid <-r|Nth>
+
  /scid -rats<type> [Connection ID] [command]
/scid <Connection ID> [command]
 
/scid -r [command]
 
/scid -a [command]
 
/scid -at<type> [command]
 
/scid -s [Nth]
 
  
 
== Switches ==
 
== Switches ==
* '''-r''' - Resets the connection id back to what it original was (before any /scon/scid calls)
+
* '''-r''' - Resets the connection back to what it original was.
* '''-s''' - Prints the current connection ID. (Or changes to the Nth connection and prints its ID.)
+
* '''-s''' - Prints the current connection ID or the new connection ID.
 
* '''-a''' - Perform on all connections.
 
* '''-a''' - Perform on all connections.
* '''-at<type>''' - Perform on all the connections of a specific type.
+
* '''-t<type>''' - Perform on all the connections of a specific type, can only be used with -a.
  
 
== Parameters ==
 
== Parameters ==
  
* '''<Nth>''' - The Nth connection.
+
* '''<ID>''' - The connection ID.
* '''<type>''' - The connection type, only used with -at switchs.
+
* '''<type>''' - The connection type, used with the -t switch.
  
 
== Example ==
 
== Example ==
  
A simple example of using /scif to send a command to all connected connections.
+
A simple example of using /scid to send a command to all connected connections.
  
 
<syntaxhighlight lang="mIRC">/*
 
<syntaxhighlight lang="mIRC">/*
Line 46: Line 42:
 
   }
 
   }
 
   ; all active connections
 
   ; all active connections
   scid -at1 amsg $1-
+
  ; if you don't use $unsafe, $1- is evaluated twice, watch out!
 +
   scid -at1 amsg $unsafe($1-)
 
}</syntaxhighlight>
 
}</syntaxhighlight>
  
Line 64: Line 61:
  
 
     ; print channels
 
     ; print channels
     scon -r echo -s Network: $network Channels: %chans
+
    ; again, safer to use $unsafe
 +
     scon -r echo -s $unsafe(Network: $network Channels: %chans)
  
 
     ; next connection
 
     ; next connection
Line 72: Line 70:
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v6.0
+
{{mIRC compatibility|6.0}}
  
Added On: 03/02/2002
 
 
 
 
<small>Note: Individual switches were not taken into consideration.</small>
 
  
 
== See also ==
 
== See also ==
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of identifiers - mIRC|List of identifiers]]
 
* [[List of identifiers - mIRC|List of identifiers]]
* [[$status identifier - mIRC|$status]]
+
* {{mIRC|$status}}
* [[$network identifier - mIRC|$network]]
+
* {{mIRC|$network}}
* [[$scon identifier - mIRC|$scon]]
+
* {{mIRC|$scon}}
* [[$scid identifier - mIRC|$scid]]
+
* {{mIRC|$scid}}
* [[/scid command - mIRC|/scid]]
+
* {{mIRC|/scon}}
 
{{mIRC command list}}
 
{{mIRC command list}}
  
[[Category:MIRC commands]]
+
[[Category:mIRC commands|scid command - mIRC]]

Latest revision as of 08:32, 28 March 2020

The /scid command can change the connection associated with the current script. When a command is not specified, mIRC changes the connection of the current script to the connection associated with the given Connecion ID. The rest of the code will continue to execute on that connection. When a command is specified, mIRC will execute the command on the connection specified by the Connection ID or the connections based on the switches provided. Any active connection changes are restored upon returning to the calling routine. A command can be executed on all or some of the connections depending on their types using the -a or -at<Type> switches.

Connection Type[edit]

  • 1 = Connected
  • 2 = Disconnected or Connecting
  • 3 = 1+2 = Connected, Disconnected, or Connecting (Same as -a)
  • 4 = Connecting
  • 5 = 1+4 = Connected or Connecting
  • 6 = 2+4 = 2 = Disconnected or Connecting
  • 7 = 3+4 = Disconnected or Connected or Connecting
  • 8 = Disconnected

Synopsis[edit]

/scid -rats<type> [Connection ID] [command]

Switches[edit]

  • -r - Resets the connection back to what it original was.
  • -s - Prints the current connection ID or the new connection ID.
  • -a - Perform on all connections.
  • -t<type> - Perform on all the connections of a specific type, can only be used with -a.

Parameters[edit]

  • <ID> - The connection ID.
  • <type> - The connection type, used with the -t switch.

Example[edit]

A simple example of using /scid to send a command to all connected connections.

/*
** Global amsg - performs an amsg on all the
** the actives connections you are on.
**
** /gamsg <message>
*/
alias gamsg {
  if (!$1) {
    echo -gtcse info * /gamsg: insufficient parameters
    halt
  }
  ; all active connections
  ; if you don't use $unsafe, $1- is evaluated twice, watch out!
  scid -at1 amsg $unsafe($1-)
}

Print all the channels you are on from every connection you have:

alias listChans {
  var %x = 1
  while ($scid(%x)) {
    ; switch connection
    scid %x
 
    ; iterate over the channels
    var %c = 1, %chans
    while ($chan(%c)) {
      var %chans = $addtok(%chans, $chr(32) $v1, 44)
      inc %c
    }
 
    ; print channels
    ; again, safer to use $unsafe
    scon -r echo -s $unsafe(Network: $network Channels: %chans)
 
    ; next connection
    inc %x
  }
}

Compatibility[edit]

Added: mIRC v6.0
Added on: 03 Feb 2002
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also[edit]

v · d · e mIRC commands list

A /abook, /action, /add, /ajinvite, /alias, /aline, /ame, /amsg, /anick, /aop, /auser, /auto, /autojoin, /avoice, /away

B /background, /ban, /bcopy, /beep, /bindip, /bread, /break, /breplace, /bset, /btrunc, /bunset, /bwrite

C /channel, /clear, /clearall, /clearial, /cline, /clipboard, /close, /closechats, /closedccs, /closefserves, /closemsg, /cnick, /color, /colour, /comclose, /comlist, /commands, /comopen, /comreg, /continue, /copy, /creq, /ctcp, /ctcpreply, /ctcps

D /dcc, /dccserver, /dde, /ddeserver, /debug, /dec, /describe, /dialog, /did, /didtok, /disable, /disconnect, /dlevel, /dline, /dll, Template:mIRC/donotdisturb, /dns, /dqwindow, /drawcopy, /drawdot, /drawfill, /drawline, /drawpic, /drawrect, /drawreplace, /drawrot, /drawsave, /drawscroll, /drawsize /drawtext

E /ebeeps, /echo, /editbox, /else, /elseif, /emailaddr, /enable, /events, /exit

F /fclose, /filter, /findtext, /finger, /firewall, /flash, /flist, /flood, /flush, /flushini, /fnord, /font, /fopen, /fseek, /fsend, /fserve, /fullname, /fupdate, /fwrite

G /ghide, /gload, /gmove, /gopts, /goto, /gplay, /gpoint, /gqreq, /groups, /gshow, /gsize, /gstop, /gtalk, /gunload, /guser

H /hadd, /halt, /haltdef, /hdec, /hdel, /help, /hfree, /hinc, /hload, /hmake, /hotlink, /hop, /hsave

I /ial, /ialclear, /ialmark, /identd, /if, /ignore, /iline, /inc, /iuser

J /join

L /leave, /linesep, /links, /list, /load, /loadbuf, /localinfo, /log, /logview

M /maxdepth, /mdi, /me, /menubar, /mkdir, /mnick, /mode, /msg

N /noop, /notice, /notify

O /onotice, /omsg

P /pareline, /part, /partall, /pdcc, /perform, /play, /playctrl, /pop, /protect, /proxy, /pvoice

Q /qme, /qmsg, /query, /queryrn, /quit, /quote

R /raw, /registration, /reload, /remini, /remote, /remove, /rename, /renwin, /reseterror, /resetidle, /return, /returnex, /rlevel, /rline, /rmdir, /run, /ruser

S /save, /savebuf, /saveini, /say, /scid, /scon, /server, /set, /setlayer, /showmirc, /signal, /sline, /sockaccept, /sockclose, /socklist, /socklisten, /sockmark, /sockopen, /sockpause, /sockread, /sockrename, /sockudp, /sockwrite, /sound, /speak, /splay, /sreq, /strip, /switchbar

T /timer, /timestamp, /tip, /tips, /titlebar, /tnick, /tokenize, /toolbar, /topic /tray, /treebar

U /ulist, /unload, /unset, /unsetall, /updatenl, /url, /username, /uwho

V /var, /vcadd, /vcmd, /vcrem, /vol

W

X /xyzzy