SRL Archive - OSR Help

Working an Inventory Timer


lilcmp1

2011-12-28 19:47:40

I'm trying to recognize when it's no longer fishing by a time since the inventory has been + 1. Trying the following code it doesn't always write the line 'caught one!' every time one is caught OR my character stops fishing and it writes it a bunch of 'caught one'. It will click the spot while fishing and no click when not fishing :( Procedure works prior to adding the repeat and marktimes

Procedure Fishy;
var
SeX, SeY, PlusOne, FishCounter: Integer;

Begin

PlusOne:= InvCount + 1;

SeX:= MSCX;
SeY:= MSCY;
why If FindObjCustom(SeX, SeY, ['Cage', 'Fishing'], [7956571, 9998731,9406078], 10) Then
WriteLn('Found Spot!');
Begin
Case Random(2) Of
0:Mouse(SeX,SeY, 5,5, True);
1: Begin
Mouse(SeX,SeY,4,4,False);
WaitOption('Cage',Randomrange(100,300));
Wait(300 + Randomrange(300,500));
End;
End;
End;

Repeat
wait(1000);
If InvCount=PlusOne Then
Begin
WriteLn('Caught One!');
MarkTime(FishCounter);
End;
Until (TimeFromMark(FishCounter) > 8000);




End;

JuKKa

2011-12-28 19:49:45

You need to do
PlusOne:= InvCount + 1;
after writeln "caught one!"

by catching one you get a new item, right?

lilcmp1

2011-12-28 20:03:51

From: JuKKa
You need to do
PlusOne:= InvCount + 1;
after writeln "caught one!"

by catching one you get a new item, right?


Correct! Thank you very much. The very basic cray power fisher script is now complete :D I wasn't quite sure how to mark inventory over and over but I see now why that spot makes sense.