Laughmaster
04-18-2008, 12:47 AM
Hey, I've been working on my first script for a few weeks now, and even though I don't think it's quite ready to post yet ( just got 2nd 10-day ban :duh: ) I have come up with a couple advanced randomization functions which allow you to make some numbers more common than others.
As far as I've seen, this isn't included in SRL (but works just fine if you dont have SRL anyway) or programed into SCAR... So I figured I would share it with you guys who are just as obsessed with not being caught as I am :D.
All I realy need to know is where to post it, and if I overlooked something and someone else allready created something like this :redface:.
The simpler one:
Function RndParab (Bottom, Top: Integer): Integer;
Var Avg: Integer;
Begin
Avg:= (Bottom + Top)/2;
Result:=(Avg+Random(Avg-Bottom+1)-Random(Avg-Bottom+1));
End;
Just put the minimum number in Bottom and the maximum number in Top and it will automaticaly make the average of the two occur most often and the ones on the ends the least :sasmokin:.
As far as I've seen, this isn't included in SRL (but works just fine if you dont have SRL anyway) or programed into SCAR... So I figured I would share it with you guys who are just as obsessed with not being caught as I am :D.
All I realy need to know is where to post it, and if I overlooked something and someone else allready created something like this :redface:.
The simpler one:
Function RndParab (Bottom, Top: Integer): Integer;
Var Avg: Integer;
Begin
Avg:= (Bottom + Top)/2;
Result:=(Avg+Random(Avg-Bottom+1)-Random(Avg-Bottom+1));
End;
Just put the minimum number in Bottom and the maximum number in Top and it will automaticaly make the average of the two occur most often and the ones on the ends the least :sasmokin:.