SRL Archive - Research & Development Lounge

My Random Library by Daniel


Daniel

2012-01-02 10:11:43

Well, I couldn't be bothered scouring Simba's source to find the correct place to put all of these in and then export them, so I decided to create this!

Basically, it can do the following:
  • Custom random seeds.
  • Can update/change the random seed (only really needs to be done once per script). (call Randomise)
  • Semi-true randomness (connects to Random.ORG to get a good, random seed value).
  • Can force Simba to use this library instead of its own (forces SRL to use it as-well if included first) :D

I will be using it in my scripts :) (harder for Jagex to catch me if they can somehow generate the exact same seed value created at script execution <- PARANOIA!) :p

Properties/Methods included:
[php]
PROPERTIES:
randomSeed (unsigned integer) - The actual seed value. It is advised to
use the method SetRandomSeed to set a seed value.

METHODS:
SetRandomSeed - Modifies randomSeed to a user-entered value.
RandomiseWeb - Connects to Random.ORG to set a 'true' randomSeed value.
Randomise - Changes the randomSeed value to the current operation time
of your operating system.
Rand - Returns a random value between 0 (inclusive) and N (not
inclusive). See Random() documentation.
RandF - Returns a random value between 0.0 (inclusive) and 1.0.
RandRange - Returns a random value between two specified values.
[/php]

Anyways, enough with the chit-chat, here you go :)

Save to: Includes/Random.simba

File is attached.

nokkasiili

2012-01-02 10:21:56

I am too paranoid to use this i am using /dev/random:sasmokin: