XxKanexX
2006-03-20 07:20:56
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.
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:
And the results (In Milliseconds):
I won't add this to SRL until i get everyones opinion. Should it be added?
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
If you are going to use this please read My DivWait thread so you can get an understanding of what this is based about.
[FONT="Courier New"]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;[/FONT]
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.
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:
[FONT="Courier New"]var
st, i: integer;
begin
for i:= 1 to 7 do
begin
st:= getsystemtime;
rwait(1000);
writeln(floattostr(getsystemtime-st));
end;
end.[/FONT]
And the results (In Milliseconds):
3915
2093
1743
1682
2594
3976
1543
I won't add this to SRL until i get everyones opinion. Should it be added?
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