Etrnl Fear
08-05-2012, 07:30 PM
Please move to http://villavu.com/forum/forumdisplay.php?f=70
Just realized this was in the wrong section.. -Head Desk-
So, for a fishing script, I have a wait loop that begins after the procedure for clicking the fishing spot (to prevent rapid clicking, of course). It's designed to wait 15 seconds if there is no fishing exp pop-up (the 'Fishingi' DTM...) and to repeat the whole loop if it is found (gaining exp, obviously).
This is the loop I have:
procedure WaitLoop;
begin
if (Repeats = 2) then
Writeln('[' + TheTime + '] Wait Loop...');
//^^ So the Debug isn't spammed with 'Wait Loop...' while gaining exp.
// Repeats is set to 2 after clicking the fishing spot.
Waits := 0; // I don't think it's needed, but sets the number of waits to
// 0 for the below statements.
repeat
if not FindDTM(Fishingi, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Repeats := 2 //For repeat loop = false
Writeln('[' + TheTime + '] Did not find fishing exp pop-up; Waiting 15 seconds to make sure.');
repeat
if (InvFull) then
Break;
FindNormalRandoms;
Wait(1000);
Inc(Waits);
until (Waits = 15) or FindDTM(Fishingi, x, y, MSX1, MSY1, MSX2, MSY2);
end;
if FindDTM(Fishingi, x, y, MSX1, MSY1, MSX2, MSY2) then
Repeats := 1 //For repeat loop = true, since we are gaining exp.
until (Repeats = 2) or (InvFull); //2 is basically the false boolean for repeating.
end;
Later on, I plan on making a variable for how many times to wait for (Waits = W) to easily change it, based on current fishing level.
This works pretty well, but I'm sure there's a better method out there without using GetExpBar. Any suggestions?
I'd prefer not to use pixel shift, due to other bots running around; it would throw it way off.
Note: This is for fishing lobsters on Karamja.
Any help is appreciated
Thanks. :)
Just realized this was in the wrong section.. -Head Desk-
So, for a fishing script, I have a wait loop that begins after the procedure for clicking the fishing spot (to prevent rapid clicking, of course). It's designed to wait 15 seconds if there is no fishing exp pop-up (the 'Fishingi' DTM...) and to repeat the whole loop if it is found (gaining exp, obviously).
This is the loop I have:
procedure WaitLoop;
begin
if (Repeats = 2) then
Writeln('[' + TheTime + '] Wait Loop...');
//^^ So the Debug isn't spammed with 'Wait Loop...' while gaining exp.
// Repeats is set to 2 after clicking the fishing spot.
Waits := 0; // I don't think it's needed, but sets the number of waits to
// 0 for the below statements.
repeat
if not FindDTM(Fishingi, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Repeats := 2 //For repeat loop = false
Writeln('[' + TheTime + '] Did not find fishing exp pop-up; Waiting 15 seconds to make sure.');
repeat
if (InvFull) then
Break;
FindNormalRandoms;
Wait(1000);
Inc(Waits);
until (Waits = 15) or FindDTM(Fishingi, x, y, MSX1, MSY1, MSX2, MSY2);
end;
if FindDTM(Fishingi, x, y, MSX1, MSY1, MSX2, MSY2) then
Repeats := 1 //For repeat loop = true, since we are gaining exp.
until (Repeats = 2) or (InvFull); //2 is basically the false boolean for repeating.
end;
Later on, I plan on making a variable for how many times to wait for (Waits = W) to easily change it, based on current fishing level.
This works pretty well, but I'm sure there's a better method out there without using GetExpBar. Any suggestions?
I'd prefer not to use pixel shift, due to other bots running around; it would throw it way off.
Note: This is for fishing lobsters on Karamja.
Any help is appreciated
Thanks. :)