SRL Archive - OSR Help

[HELP] change the spot, if not found


iraqownz

2013-04-09 19:31:12

hello :)

i am having problems, letting the bot finding another spot, when it cant find the actual spot.

it keep trying finding the spot, when it is told, to find something else.

well, here is my code

procedure Fish;
var
x, y: integer;
begin
if (P07_FindObjCustom(x, y, ['age', 'ishin', 'ot'], [6706507, 15257010, 6049092, 6378056, 6049092, 6707280, 6048578, 15394011, 5982785], 3) ) then
begin
mouse(x,y,1,1,1)
wait(1000 + random(50));
end else
begin
changeSpot;
end;
end;


as you can see, it is told to "ChangeSpot" when it cannot find the actual spot.

but it just wont find it… kinda annoying :)

Vusn

2013-04-09 22:17:05

Have you tried to add another way to find the spot? Here is something I pieced together quickly, but you can find more info on it by looking up 'TPAs'.

procedure Fish;
var
x, y, tmpCTS, i, l, r, counter: integer;
FishTPA: TPointArray;
begin
if (not P07_FindObjCustom(x, y, ['age', 'ishin', 'ot'], [6706507, 15257010, 6049092, 6378056, 6049092, 6707280, 6048578, 15394011, 5982785], 3) ) then
begin
writeln('First try failed, searching for TPA now');
wait(randomrange(1500, 2000));
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.03, 0.13);
FindColorsTolerance(FishTPA, 6706507, MSX1, MSY1, MSX2, MSY2, 9);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(FishTPA)
marktime(counter);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
mmouse(FishTPA[r].x, FishTPA[r].y, 2, 2);
if waituptext('age', 300) then
break;
if timefrommark(counter) > 3000 then
begin
writeln('Could not find fish, changing spots!');
ChangeSpots;
end;
end;
writeln('Found the spot! Fishing..');
clickmouse2(mouse_left);
end;
end;

iraqownz

2013-04-11 18:21:16

thanks, ima going to try it :) will give you feedback, when i have tried it :)

rj

2013-04-11 18:59:35

Just use 100% tpas there's no point in adding the extra code