SRL Archive - OSR Help

None of my mousecommands work?


uaexed

2013-02-24 21:18:00

Well. I have tried these methods:

            HoldMouse(x, y, 1);
Wait(800+random(10));
ReleaseMouse(x, y, 1);


clickmouse2(mouse_Right);
Wait(500+random(50));
P07_ChooseOptionMulti(['']);

Mouse(x, y, 4, 4, True);

My problem being… They won't click. They just hover over where they are supposed to click.

My latest "script"

program Fisher;
{$I SRL/SRL.Simba}
{$I P07Include.Simba}

Procedure P07_DeclarePlayer;
begin
P07_PlayerName:='user';
P07_PlayerPass:='pw';
end;

Procedure Fish;
var x, y: integer;
begin
repeat
if P07_FindObj(x, y,'ishing',15518109, 5) then
begin
HoldMouse(x, y, 1);
Wait(800+random(10));
ReleaseMouse(x, y, 1);
end;
repeat
Wait(5000+random(500));
Until not (P07_InvFull);
until(P07_InvFull);
end;
begin
SetupP07Include;
ActivateClient;
P07_DeclarePlayer;
if (Not P07_LoggedIn) Then
P07_LogInPlayer;
Fish;
end.

What am I doing wrong?

tealc

2013-02-24 21:45:05

       

if P07_FindObj(x, y,'ishing',15518109, 5) then
begin
WriteLn('found object');
HoldMouse(x, y, 1);
Wait(800+random(10));
ReleaseMouse(x, y, 1);
end;

Try something like above to make sure the FindObj is returning true.

Le Jingle

2013-02-25 00:35:27

While I don't have time to explain fully the practices that I'd suggest be changed, you'll/I'd recommend that you:
1. want to make sure the find obj function actually finds what you are looking for, and
2. MMouse(x, y, 0, 0); GetMousePos(x, y); – calling these two methods before the holdMouse call.

uaexed

2013-02-25 08:06:43

Thanks to both of you.