From WikiChip
Difference between revisions of "mirc/identifiers/$rand"
m |
|||
Line 1: | Line 1: | ||
− | {{mirc title|$rand | + | {{mirc title|$rand identifier}}'''$rand''' returns a random number between v1 and v2. If you supply a value which is not a number, it uses its code point value as the number. |
− | '''$rand''' returns a random number between v1 and v2. If you supply a value which is not a number, it uses its code point value as the number. | + | |
+ | '''Note:''' This replaces the deprecated '''$r''' identifier. | ||
+ | |||
== Synopsis == | == Synopsis == | ||
− | <source lang="mIRC"> | + | <source lang="mIRC">$rand(value1,value2)</source> |
− | $rand(value1,value2)</source> | ||
− | == | + | == Parameters == |
+ | '''value1''' = the starting value | ||
− | ''' | + | '''value2''' = the ending value |
− | |||
− | |||
== Properties == | == Properties == | ||
− | |||
None | None | ||
Line 22: | Line 21: | ||
<source lang="mIRC">//echo -a $rand(A,Z)</source> | <source lang="mIRC">//echo -a $rand(A,Z)</source> | ||
− | |||
will return a random upper case between A and Z. | will return a random upper case between A and Z. | ||
Line 29: | Line 27: | ||
== See Also == | == See Also == | ||
− | |||
* {{mIRC|$r}} | * {{mIRC|$r}} | ||
* {{mIRC|$v1}} | * {{mIRC|$v1}} | ||
* {{mIRC|$v2}} | * {{mIRC|$v2}} | ||
+ | {{mIRC identifier list}} | ||
+ | [[Category:mIRC identifiers|rand]] |
Revision as of 12:14, 22 September 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$rand returns a random number between v1 and v2. If you supply a value which is not a number, it uses its code point value as the number.
Note: This replaces the deprecated $r identifier.
Synopsis
$rand(value1,value2)
Parameters
value1 = the starting value
value2 = the ending value
Properties
None
Examples
//echo -a $rand(0,10)
will return a random number between 0 up to 10.
//echo -a $rand(A,Z)
will return a random upper case between A and Z.
Compatibility
Added: mIRC v2.1a
Added on: 28 Feb 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See Also
mIRC identifier list