Plugin::RandomRange()
Here is another very simple plugin I made that others might find useful. It works similar to the quest::ChooseRandom() command, accept this selects randomly from a range of numbers instead of a list. It is useful if you want to select a random from 1-100 or something. You can easily do exactly what this script does just by using the perl rand() command, but I think this make selecting a range a tad bit easier.
Here are the steps to add this plugin to your server: 1. Open notepad, or whatever text editor you prefer. 2. Copy and paste the following code into Notepad: (Note: Edited in the updated version) Code:
#Usage: plugin::RandomRange(minvalue, maxvalue); 4. Do a #questreload and the new plugin should be ready for use :D To use it, just do something like this in your script: Code:
my $randomnumber = plugin::RandomRange(10, 100); |
I think I love you trevius.
I've wanted something like this forever, thanks! |
Minor correction for this plugin, since it always rounds down:
Code:
#Usage: plugin::RandomRange(minvalue, maxvalue); |
Quote:
Thanks |
Yeah, that is a GM command you use from in-game. You can always do a #help to see a list of all of the commands your account has access to. In order to get access to all commands, your account status should be 250. You can do "#help quest" to see all of the commands that contain "quest" in them as well.
|
Wow. Works like a charm. Thank you, I am rolling now.
|
Quote:
Just a little delayed response I think. |
All times are GMT -4. The time now is 12:39 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.