SRL Archive - OSR Help

Fishing help?


stu

2012-04-15 11:08:45

Hey, I have made a very basic barbarian fishing script for Otto's Grotto, and it is working fine so far except that when a spot disappears it does not detect this and find a next one, and I can't seem to fix it.
Here's the relevant part of the script

Procedure Spotfinding;
Begin
If Not loggedin Then
Exit;
If (not (FindColorSpiralTolerance(x, y, SpotColor, MSX1, MSY1, MSX2, MSY2, 5))) Then
begin
Wait(100+random(70));
Tried:= Tries + 1;
end;
if(Tries = 15)Then
Begin
Logout;
Exit;
End else
Begin
if FindObjCustom(x, y, ['Use', 'rod'], [SpotColor], 5)Then
MMouse(x, y, 5, 5);
end;
if IsUpText('Use') then
begin
Mouse(x, y, 0, 0, true);
end;
end;


Procedure Fishing;
begin
repeat
MarkTime(Fishcounter);
If InvCount=+1 Then
MarkTime(FishCounter);
Antiban;
Wait(1000);
until(TimeFromMark(FishCounter)>7000) or (InvFull)
end;

Also, I am a completely new scripter, never attempted it in any format before, so have pity ;)

weeps

2012-04-15 13:41:31

I would go with either DTM to find the spot or TPA. Check out the tut for some awesome tut on DTMS.

Good luck with the script!

stu

2012-04-15 13:45:00

It's not that I can't find the water, I just dont know what's wrong with my script that it won't look for a new spot when one disappears in the middle of an inventory

Total

2012-04-15 13:45:27

Your Fishing procedure is in an infinite loop. It is repeating the MarkTime(FishCounter); every second, so it will never get out. If you want to fix it, take the MarkTime(Fishcounter); out of the repeat statement(the one on top of the if…then statement. Then it should work. Just mark the timer before you enter the loop.

stu

2012-04-15 13:50:41

like this?
Procedure Fishing;
begin
MarkTime(Fishcounter);
repeat
If InvCount=+1 Then
MarkTime(FishCounter);
Antiban;
Wait(1000);
until(TimeFromMark(FishCounter)>7000) or (InvFull)
end;


that just makes it drop fish every 7 seconds?
(sorry dont really know what im doing, this is all new to me)

Total

2012-04-15 13:54:54

Yes that's right. If that is the procedure you call after you click on the fishing spot, it will mark the time, if you gain a fish it will reset the timer. If you don't get any fish in 7 seconds or your inventory is full, it will exit the procedure.

stu

2012-04-15 13:57:01

thats what i thought, but testing it just made it drop my fish and click a new spot every 7 seconds no matter what

Total

2012-04-15 14:08:51

Oh, you need to set a variable to your invcount.


Procedure Fishing;
var
CurrentInv : Integer;
begin
CurrentInv := InvCount;
MarkTime(Fishcounter);
repeat
If CurrentInv <> InvCount Then
begin
CurrentInv := InvCount;
MarkTime(FishCounter);
end;
Antiban;
Wait(1000);
until(TimeFromMark(FishCounter)>7000) or (InvFull)
end

Try that. I don't know if that =+1 works in pascal, even if it did it would be +=1 I think.

stu

2012-04-15 14:11:22

haha thank you, genius :D