From WikiChip
Editing mirc/identifiers/$sockerr

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{mirc title|$sockerr identifier}}'''$sockerr''' returns the sock error number if an error occurred.
+
{{mirc title|$cnick Identifier}}'''$cnick''' returns the 'Nick or address' field from the Edit dialog of the Nth entry in the Nick Colors dialog, or if a nick/address is specified, returns the Nth position of the item in list that matches the nick. If the nick/address does not match any items, returns zero.
  
$sockerr is not a local identifier only set inside event, it is set after any /sock* command as well, meaning that $sockerr can change in value inside the same on sockread event.
 
  
== Synopsis ==
+
== Parameters ==
<pre>$sockerr</pre>
 
  
== Parameters ==
+
* '''<N/nick>''' - a number representing the Nth item in the Nick Color dialog or a nickname/address used as a match against the field 'Nick or address' in Nick Color Edit dialog
None
+
* '''M''' - if you use the .color property and no item is found via a nick/address match, the 'Normal Text' color is returned, if M is 1, the 'Listbox text' is color is returned
  
 
== Properties ==
 
== Properties ==
None
+
* '''.color/.colour''' - return the color for that entry. if no item is found via a nick/address match, the 'Normal Text' color is returned, if the M parameter is 1, the 'Listbox text' is color is returned
 
+
* '''.modes''' - return the 'Channel modes' field
== Error codes ==
+
* '''.levels''' - return the 'User levels' field
 
+
* '''.method''' - return the 'Method' field
Remember that using a /sock* command will change the $sockerr value, so these error codes must be checked prior any /sock* command
+
* '''.anymode''' - return the state of the 'Any mode' checkbox
 
+
* '''.nomode''' - return the state of the 'No mode' checkbox
=== on SOCKOPEN ===
+
* '''.ignore''' - return the state of the 'Ignore' checkbox
* 0: success
+
* '''.op''' - return the state of the 'Op' checkbox
* 3: failure establishing socket connection (W)
+
* '''.voice''' - return the state of the 'Voice' checkbox
* 4: error resolving given hostname
+
* '''.protect''' - return the state of the 'Protect' checkbox
 
+
* '''.notify''' - return the state of the 'notify' checkbox
=== on SOCKLISTEN ===
+
* '''.idle''' - return the 'Idle time' field
* 0: new socket successfully accepted
+
* '''.auto''' - return the state of the 'Auto color' option (where you can use '*' as a color to enable the option)
* 1: error occurred on listening socket (W)
 
* 2: error accepting new socket (W)
 
* 4: not enough memory for new socket
 
 
 
=== on SOCKREAD ===
 
* 0: data received
 
* 3: error on connected socket occurred (W)
 
 
 
=== on SOCKWRITE ===
 
* 0: all data successfully written
 
* 3: error trying to send data (W)
 
 
 
=== on SOCKCLOSE ===
 
* 0: EOF from other end received
 
* 3: an error occurred while receiving data, or a SSL error occurred (W)
 
* 5: a certain(?) SSL error occurred during sockopen
 
 
 
'''Note 1:''' (W) = For these errors, $sock().wserr contains a specific WinSock error number and $sock().wsmsg the Winsock error text
 
 
 
'''Note 2:''' These codes were taken from http://www.xise.nl/mirc/wiki/doku.php/doku.php?id=sockerr
 
  
 
== Example ==
 
== Example ==
<source lang="mIRC">on *:sockread:name:{
+
<source lang="mIRC">//echo -a $cnick(1).color</source>
  if ($sockerr) return
 
  …
 
}</source>
 
  
 
== Compatibility ==
 
== Compatibility ==
{{mIRC compatibility|5.3}}
+
{{mIRC compatibility|5.9}}
  
 
== See Also ==
 
== See Also ==
* {{mIRC|$sock}}
+
{{mIRC|/cnick}}
* {{mIRC|$sockname}}
+
 
* {{mIRC|$sockbr}}
+
 
{{mIRC identifier list}}
+
[[Category:mIRC identifiers|cnick]]
[[Category:mIRC identifiers|sockerr]]
 

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)