SRL Archive - OSR Help

Fishing Guild script, need to distinguish between different fishing spots [07].


Fishh

2013-02-25 20:44:47

Hey, I'm making a small Fishing Guild script for '07. I've managed to find a fishing spot, right click and select Harpoon. The problem is I want it to only select Lobster/Sword/Tuna fishing spots and it selects Shark fishing spots as well.

program GuildFisher;
{$i SRL/SRL.simba}
{$i P07Include.simba}

procedure P07_DeclarePlayer;
begin

P07_PlayerName := '';
P07_PlayerPass := '';
P07_PName := ''
P07_PPass := '';

end;

function FishSpot: boolean;

var
x, y: integer;

begin

if P07_FindObjCustom(x, y, ['Cage'], [15717294, 14198143], 5) then
Wait(100 + random(100));
ClickMouse2(mouse_right);
Wait(50 + random(126));
P07_ChooseOptionMulti(['Harpoon']);

end;

begin

SetupSRL;
SetupP07Include;
P07_DeclarePlayer;

FishSpot;

end.

I have the UpText set for 'Cage' but it still selects the 'Net' spots, there isn't a colour differentiation between them either (I don't think)

How would I solve this? Cheers.

I'm also completely new to Pascal as well, only know C#.

blockay

2013-02-26 01:25:30

this is what i use
If P07_FindObjCustom(x, y, ['ree', 'tre'], [TreeColor, TreeColors], 1) Then
begin
Mouse(x, y, Random(2), Random(2), false);
P07_ChooseOptionMulti(['hop']);
end;
it hovers over oaks sometimes but never clicks them

DannyRS

2013-02-26 01:36:32

You need begin and end's after if statement's like you need { } in c#, you are only calling the line after finding the object because you only have then, meaning all it does is wait when it finds the fishing spot


From: blockay
this is what i use
If P07_FindObjCustom(x, y, ['ree', 'tre'], [TreeColor, TreeColors], 1) Then
begin
Mouse(x, y, Random(2), Random(2), false);
P07_ChooseOptionMulti(['hop']);
end;
it hovers over oaks sometimes but never clicks them


Alot of people having this issue, I'm looking into it, and SRL dev's are working on a real UpText function ;)

Edit - Try this for me, it's working fine for me


If P07_FindObjCustom(x, y, ['Tree', 'Oak'], [TreeColor, TreeColors], 5) Then
Begin
ClickMouse2(mouse_right);
P07_ChooseOptionMulti([Chop]);
End;

Fishh

2013-02-26 04:31:21

From: DannyRS
You need begin and end's after if statement's like you need { } in c#, you are only calling the line after finding the object because you only have then, meaning all it does is wait when it finds the fishing spot





Alot of people having this issue, I'm looking into it, and SRL dev's are working on a real UpText function ;)

Edit - Try this for me, it's working fine for me


If P07_FindObjCustom(x, y, ['Tree', 'Oak'], [TreeColor, TreeColors], 5) Then
Begin
ClickMouse2(mouse_right);
P07_ChooseOptionMulti([Chop]);
End;



Ahh, thanks, my bad. Still getting used to Pascal. I'll try this when I get back home.

Fishh

2013-02-26 10:37:42

Thanks for the help, sorted out the script. It now successfully clicks 'Harpoon' on the correct spots. Just need to figure out walking now, got banking at almost 90% I think, can open and deposit. Not sure if there's any walking methods for '07 yet though.

Cheers!

EDIT: Double posted, my bad.