All that is man
2009-10-02 03:31:12
function SometimesWait(Percent, WaitTime, RWaitTime: integer): boolean;
begin
if(Percent <= 0)or(Percent > 99)then
begin
srl_Warn('SometimesWait', 'Invalid percentage specified', warn_Warning);
Exit;
end;
case (random(99) + 1) of
1..Percent: begin
result := true;
Wait(Waittime+random(RWaitTime));
end;
(Percent + 1)..100: Exit;
end;
end;
Could be useful for antiban procedures or something….
YoHoJo
2009-10-02 03:34:51
Neato function :D
Looks kinda fishy to me though :/.
XRaye
2009-10-02 03:36:12
That actually seems like a pretty good idea :)
All that is man
2009-10-02 03:36:40
From: YoHoJo
Neato function :D
Looks kinda fishy to me though :/.
Thanks, and whats does that mean lol, works fine.
From: XRaye
That actually seems like a pretty good idea :)
Thanks
Good idea, you can shorten to
function SWait(Percent, WaitTime, RWaitTime: Integer): Boolean;
begin
case Random(99) of
0..Percent:
begin
Wait(WaitTime + Random(RWaitTime));
Result := True;
end;
end;
end;
you don't really need to check the percentage for range. If its 100+ its guaranteed, 0 or less, its not gunna happen.
EvilChicken!
2009-10-02 04:05:22
function SometimesWait(Percent: Byte; WaitTime, RWaitTime: Integer): Boolean;
begin
if (not InRange(Percent, 0, 99)) then
begin
srl_Warn('SometimesWait', 'Invaliid percentage specified', warn_Warning);
Exit;
end;
Result := (Percent > Random(100));
if (Result) then
Wait(WaitTime + Random(RWaitTime));
end;
Improved a tiny bit. :)
EDIT: FUUUUUUUUUUUUUUUUU—
Neehosoft
2009-10-02 05:00:21
You truly do hate everything.
This could make it look like you went to bathroom or something, we should add to antiban
All that is man
2009-10-02 05:05:56
From: r!ch!e
you don't really need to check the percentage for range.
Well true but that defeats the purpose…
From: r!ch!e
If its 100+ its guaranteed,
wait();
From: r!ch!e
0 or less, its not gunna happen.
waste 1 line
What I mean is that, you don't really need to verify the percentage amount. As it won't cause any errors. It's probably better practice to put a check in though.
marpis
2009-10-04 19:11:51
Why not just do
if Random(5) = 0 then Wait(500 + Random(200));
?
function SWait(Percent: Byte; WaitTime, RWaitTime: Integer) : Boolean;
begin
if InRange((Random(100) + 1), 1, Percent) then
Wait(WaitTime + Random(RWaitTime));
end;
Personally, I don't see a use for it, but a nice contribution anyway.
From: R1ch
function SWait(Percent: Byte; WaitTime, RWaitTime: Integer) : Boolean;
begin
if InRange((Random(100) + 1), 1, Percent) then
Wait(WaitTime + Random(RWaitTime));
end;
Personally, I don't see a use for it, but a nice contribution anyway.
Just cause I can :p:
function SWait(Percent: Byte; WaitTime, RWaitTime: Integer) : Boolean;
begin
Wait((WaitTime + Random(RWaitTime)) * Integer(InRange((Random(100) + 1), 1, Percent)));
end;
Cartmann
2010-01-05 13:20:43
Nice! i've been talking with my uncle about the same type of function, but used differently, i would use it for allmost any wait function, seeing as i believe that runescapes anti client registrate thoese kind of stuff (their computer calculates your wait(1000+random(500)) ) within some hours of playing, maybe less.
Becouse of that a added "10% chance of waiting an extra armount of time" would be less suspicious.
Could be something like:
5% Random(-200)
4% Random(3000)
0,5% Random(5000)
0,4% Random(10000)
0,1% Random(20000)
Ofcourse you would have to know WHEN to use each type of random amount wait, seeing as some task in runescape, such as minning iron or wood, a normal person might daze away once in awhile watching TV or something "distracting" and other task such as "right click, wait(100);" might not require the same amount of gap.