procedure rWait(ms: integer); - By XxKanexX
If you are going to use this please read My DivWait thread so you can get an understanding of what this is based about.
In Divwait you had to choose it's divisision and random wait time. Well, in this all you need to specify is the time. The rest is COMPLETELY random.Code:Procedure rWait(ms: Integer); var i, diva, a: Integer; begin a:= Getsystemtime; if(ms <= 0)then ms:= 5; Diva:= ms div(ms div(Random(ms div(ms div(ms-(ms-Random(ms+1 div 2))+1)+1)+1)+1)+1); if(Diva <= 0)then Diva:= ms/((ms/4)+1); for I:= 1 to Diva do begin Wait(ms/diva + random(diva)); if(Random(100)+1 = Random(100)+1)then Wait(Diva + Random(Diva div 2)); if(trunc(Getsystemtime-a) > ms * ((Random(7)+2 + Random(3)+1)/(Random(2)+1)))then Break; end; if(Trunc(Getsystemtime-a) = ms)or (Trunc(Getsystemtime-a) < ms + (ms/4+(Random(3)+1)))then wait(Random(ms)); end;
It divides the total wait time by a random number calculated by how big or small the wait time is (Just so it dosn't wait to long or not long enough).
If it waits more than a certain random time times by the total time then it will break.
If it waits the same amount as the time, it will wait a random time just so it's not the same.
At first i got division errors, but now everything is working. I ran it around 2000 times and not 1 division error. Dosn't mean it's not possible though.
I wouldn't suggest using this if you want to wait only the time you want to. This can increase it by a high amount.
It has a 1 out of 100 chance of waiting longer every time it waits a section.
Heres an example script:
Code:var st, i: integer; begin for i:= 1 to 7 do begin st:= getsystemtime; rwait(1000); writeln(floattostr(getsystemtime-st)); end; end.
And the results (In Milliseconds):I won't add this to SRL until i get everyones opinion. Should it be added?Code:3915 2093 1743 1682 2594 3976 1543
Sorry if that's alot of explaining. I normally want to explain it enough for everyone to understand.
I highlight keywords in bold to annoy Fakawi ^^;; kekeke






Reply With Quote



