SUNiNET - Your Eggdrop & TCL resources site
[ Home Eggdrop TCL Links About ]

Guide to TCL scripting for Eggdrop 1.6


[ Previous ] [ Index ] [ Next ]


12.2 Random numbers

You can get a random number with the rand command.
The syntax of a rand command is rand <number>.

The <number> is the number possibilities from which you want rand to return a number.
If you want 2 possibilities you will have to use rand 2, but rand starts counting at zero so this will either return a 0 or a 1. Thus the return of a rand command is a random number between 0 and (<number> - 1).

For example rand 10 would give a random number between 0 and 9.


[ Previous ] [ Index ] [ Next ]


Design & Graphics by Shawn Borton
Copyright © 2000-2005 Marijn van Zon