From WikiChip
Editing mirc/commands/inc

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|/inc Command}}
+
The '''/inc command''' increases the value of a variable by a given value. If no value is specified, mIRC will increase the variable by one. The /inc command works with both positive and negative values alike.
The '''/inc command''' increases the numeric value of a variable by a given value. If [value] is not specified, mIRC will increase the variable by one. The /inc command works with both positive and negative values alike.
 
 
 
'''Note''': /inc always keeps the unset time if there is one for the current variable, as though there was a -k switch from {{mIRC|/set}}, there's no switch to prevent this behavior and unset the time while setting the value.
 
  
 
== Synopsis ==
 
== Synopsis ==
  /inc [-scrzeuN] <%var> [value]
+
  /inc [-sczeuN] <%var> [value]
  
 
== Switches ==
 
== Switches ==
 +
* '''-c''' - Increases the variable once per second
 
* '''-s''' - Prints out the value of the variable  
 
* '''-s''' - Prints out the value of the variable  
Global variables only:
+
* '''-z''' - Increases the variable every second until it reaches zero at which point the variable will get removed.  
* '''-c''' - Increases the variable by 1 every second
 
* '''-r''' - Increases the variable by 1 every second (same as -c)
 
* '''-z''' - Decreases the variable by 1 every second until it reaches zero at which point the variable will get unset.  
 
 
* '''-e''' - Unsets the variable when mIRC exits  
 
* '''-e''' - Unsets the variable when mIRC exits  
* '''-uN''' - Increases the variable once and unsets the variable after N seconds
+
* '''-uN''' - Increases the variable once and unsets the variable after N seconds.
  
 
== Parameters ==
 
== Parameters ==
 
* '''%var''' - The variable's name  
 
* '''%var''' - The variable's name  
* '''[value]''' - Optional numeric value to increase the variable by. Default is 1 if [value] not used
+
* '''[value]''' - Optional numeric value to increase the variable by
  
 
== Example ==
 
== Example ==
Line 30: Line 25:
 
}</syntaxhighlight>
 
}</syntaxhighlight>
  
<source lang="mIRC">
+
== Compatibility ==
Note: if script or timer execution lasts longer than 1 second, -c and -z can skip increments or decrements:
+
Added: mIRC v4.0
//set %i 10 | inc -z %i | timertest 5 1 echo -a $!timer(test).reps $!asctime i= $eval(%i,0) $(|) var $eval(%j,0) 99999 $(|) while ( $eval(%j,0) ) $chr(123) var $eval(%k,0) $!rand(1,999) $(|) dec $eval(%j,0) $chr(125) | echo -a com: $timer(test).com | timer
+
 
 +
Added On: 20/03/1996
 +
 
  
//var %i 1 | inc %i 0 | echo -a this did not change i= %i | var %j $null | inc %i | echo -a this changed by 1 because [value] is null i= %i
 
  this did not change i= 1
 
  this changed by 1 because [value] is null i= 2
 
  this incremented by 3 i= 5
 
  
//var %i foo | inc %i | inc %i 5 | echo -a inc does not alter non-numeric values i= %i
 
</source>
 
== Compatibility ==
 
{{mIRC compatibility|4.0}}
 
 
== See also ==
 
== See also ==
 
* [[List of commands - mIRC|List of commands]]
 
* [[List of commands - mIRC|List of commands]]
Line 53: Line 42:
 
* {{mIRC|/var}}
 
* {{mIRC|/var}}
 
{{mIRC command list}}
 
{{mIRC command list}}
[[Category:mIRC commands|inc command - mIRC]]
+
 
 +
[[Category:MIRC commands]]

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)