Difference between revisions of "Random"

From Wiki
Jump to: navigation, search
m (→‎Description: fixed high & low values)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
−
== #random ==
+
{{header| Miscellaneous Variables|ro|Holds a changing random value that ranges between 0 and 999.}}
−
'''Miscellaneous System Variables'''
+
−
=== Description ===
+
−
{{ro}}
+
−
 
+
−
Holds a changing random value that ranges between 0 and 999.
+
  
 
==== Example ====
 
==== Example ====
 
<pre>
 
<pre>
−
 
+
;make a random number between 0 and 99.
−
; make a random number between 0 and 99.
+
 
set %a #random % 100
 
set %a #random % 100
  
 +
;make a random number between a range of two numbers
 +
;set %random1 #random % %increments + #bottom
 +
;%increments is (top# - bottom#) + 1
 +
;#top is the highest number of the range
 +
;#bottom is the lowest number of the range
 +
;example of two random numbers between 3 and 10
 +
set %random1 #random % 8 + 3
 
</pre>
 
</pre>
−
==== See Also ====
+
=See Also=
−
{|
+
{{Miscellaneous Variables}}
−
| Width=200px |
+
−
|}
+
−
----
+
−
{|
+
−
| Width=200px | [[Main_Page]] || Width=200px | [[Documentation]] || Width=200px | [[Documentation#Miscellaneous_Variables|Miscellaneous System Variables]]
+
−
|}
+

Latest revision as of 09:11, 13 September 2007

⇒ Holds a changing random value that ranges between 0 and 999.

Example

;make a random number between 0 and 99.
set %a #random % 100

;make a random number between a range of two numbers
;set %random1 #random % %increments + #bottom
;%increments is (top# - bottom#) + 1
;#top is the highest number of the range
;#bottom is the lowest number of the range
;example of two random numbers between 3 and 10
set %random1 #random % 8 + 3

See Also

Miscellaneous Variables

  • These system variables are not easily categorized in any other category, and therefore are placed here.
#shard ⇒ Returns which shard you are logged into
#date ⇒ Returns the local date on your computer
#time ⇒ Returns the local time on your computer
#sysTime ⇒ Counts the number of milliseconds since 01/Jan/1980 UTC
#sCnt ⇔ Timer in seconds since Windows boot
#sCnt2 ⇔ Timer in tenths of seconds since Windows boot
#pixCol ⇒ Returns the color of the pixel last saved with savePix
#cursorX ⇒ Returns the x-coordinate of the cursor
#cursorY ⇒ Returns the y-coordinate of the cursor
#random ⇒ Holds a random number
#dispRes ⇒ Returns button clicked in last call to display
#lShard ⇔ Set the last shard of your choice
#osVer ⇒ Returns the OS version
#euoVer ⇒ Returns the current EasyUO version