SRL Archive - OSR Help

need help with fishing procedure


Bicep

2013-04-02 11:55:08

Hi guys. I got this fishing procedure for my barbarian fishing script.

procedure Fish;
var
x, y, i: integer;
begin
if (FindObjCustom(x, y, ['ure', 'ishin', 'ot'], [14597535, 15123609, 14794914, 14858129, 13216647, 14597268, 15123625, 14398100, 14729121], 3) ) then
begin
wait(1000 + random(500));
mouse(x,y,1,1,1)
wait(10000 + random(100));
end else
end;

now I got it to wait 10000 ms after clicking a fish spot but the timer keeps going after the spot is gone. I need it to directly search for a new fishing spot when the old one is gone. How can I do this? (Kinda noob but just started scripting).

Ian

2013-04-02 11:58:13

From: Bicep
Hi guys. I got this fishing procedure for my barbarian fishing script.

procedure Fish;
var
x, y, i: integer;
begin
if (FindObjCustom(x, y, ['ure', 'ishin', 'ot'], [14597535, 15123609, 14794914, 14858129, 13216647, 14597268, 15123625, 14398100, 14729121], 3) ) then
begin
wait(1000 + random(500));
mouse(x,y,1,1,1)
wait(10000 + random(100));
end else
end;

now I got it to wait 10000 ms after clicking a fish spot but the timer keeps going after the spot is gone. I need it to directly search for a new fishing spot when the old one is gone. How can I do this? (Kinda noob but just started scripting).


In your mainloop you can do something like

repeat
Fish;
until(InvFull);
This will do the Fish procedure until the inventory is full. Does that help? :)

Bicep

2013-04-02 12:08:47

From: BMWxi
In your mainloop you can do something like

repeat
Fish;
until(InvFull);

This will do the Fish procedure until the inventory is full. Does that help? :)


Hi mate, thanks for your response.

I have tried editing this into my main loop.


begin
SetupSRL;
activateclient;
DeclarePlayer;
LoginPlayer;
wait(325);
repeat
begin
Antiban;
Fish;
until(InvFull);
Drop;
until(false);
end;
end.

got this error trying to compile:

[Error] (78:3): Identifier expected at line 77
Compiling failed.

Also tried:

until (ItemExists(28));
No luck :)

Ian

2013-04-02 12:23:41

From: Bicep
Hi mate, thanks for your response.

I have tried editing this into my main loop.


begin
SetupSRL;
activateclient;
DeclarePlayer;
LoginPlayer;
wait(325);
repeat
begin
Antiban;
Fish;
until(InvFull);
Drop;
until(false);
end;
end.

got this error trying to compile:

[Error] (78:3): Identifier expected at line 77
Compiling failed.


That's because your begins, ends, repeats, and untils are all mixed up. I recommend indenting after each begin and repeat and un-indenting after every end and until because it makes it easier to read the code and see these errors.

Here is what it should be like:


begin
SetupSRL;
activateclient;
DeclarePlayer;
LoginPlayer;
wait(325);
repeat
Antiban;
repeat
Fish;
until(InvFull);
Drop;
until(false);
end.

Bicep

2013-04-02 12:27:06

From: BMWxi
That's because your begins, ends, repeats, and untils are all mixed up. I recommend indenting after each begin and repeat and un-indenting after every end and until because it makes it easier to read the code and see these errors.

Here is what it should be like:


begin
SetupSRL;
activateclient;
DeclarePlayer;
LoginPlayer;
wait(325);
repeat
Antiban;
repeat
Fish;
until(InvFull);
Drop;
until(false);
end.


Cheers mate I got it compiling :) Still learning hehe….

Ian

2013-04-02 12:29:46

From: Bicep
Cheers mate I got it compiling :) Still learning hehe….


Just post here if you have any other questions :)

Bicep

2013-04-02 12:33:09

From: BMWxi
Just post here if you have any other questions :)


Will do, running into ENOUGH problems :P.. Now it's mass clicking the fishing spot. Adjusted the timer but can I get it to recognize when it's fishing and when not? So it will start looking for a new fishing spot when it's not fishing and that it won't mass click the fishing spot.

Ian

2013-04-04 11:39:23

From: Bicep
Will do, running into ENOUGH problems :P.. Now it's mass clicking the fishing spot. Adjusted the timer but can I get it to recognize when it's fishing and when not? So it will start looking for a new fishing spot when it's not fishing and that it won't mass click the fishing spot.


I use PixelShift to detect when it's fishing, see Flight's tutorial to learn how :)

Bicep

2013-04-04 17:22:53

From: BMWxi
I use PixelShift to detect when it's fishing, see Flight's tutorial to learn how :)


ah thats the method i was looking for. didnt know such thing did exist :) thanks will have a look!