footballjds
2013-11-13 12:32:45
With recent runescape bans human-like scripts are more important than ever.
This advice is very simple, I hope most people already practice proper randomness in failsafes
I cannot count how many times I've seen the following code:
This does function. However, imagine worst case scenario, imagine we fail. Then we'll be waiting almost exactly 3 seconds for chooseOption each time and we'll quit trying after almost exactly 10 seconds.
For obvious reasons this isn't optimal. The below is far more human IMHO:
This advice is very simple, I hope most people already practice proper randomness in failsafes
I cannot count how many times I've seen the following code:
function openBank: boolean;
var
timerX: integer;
begin
timerX := getSystemTime+10000;
while timerX > getSystemTime and (not result) do
begin
Mouse(bankPoint, Mouse_Right, Mouse_Human);
result := chooseOption.select(['Use Bank'], 3000);
wait(randomRange(100, 400));
end;
end;
That looks pretty good right? We're trying to open the bank. We're waiting a random amount of time each loop to add randomness. If we can't open it within 10 seconds we give up. We also wait to "Use Bank" for 3 seconds without giving up.This does function. However, imagine worst case scenario, imagine we fail. Then we'll be waiting almost exactly 3 seconds for chooseOption each time and we'll quit trying after almost exactly 10 seconds.
For obvious reasons this isn't optimal. The below is far more human IMHO:
function openBank: boolean;
var
timerX: integer;
begin
timerX := getSystemTime+randomRange(9000,15000);
while timerX > getSystemTime and (not result) do
begin
Mouse(bankPoint, Mouse_Right, Mouse_Human);
result := chooseOption.select(['Use Bank'], randomRange(2500,4000));
wait(randomRange(100, 400));
end;
end;
