SRL Archive - OSR Help

My script won't click


RequiredOne

2013-03-03 21:35:20

Why won't this simple script I made click?

procedure Attack;
var x, y: integer;
begin
if findobj(x, y, 'iant', 12040108, 5) then
begin
Mouse(x, y, 5, 5, true);
ClickMouse2(Mouse_left);
end;
end;

Aarondawg

2013-03-03 21:37:09

From: RequiredOne
Why won't this simple script I made click?

procedure Attack;
var x, y: integer;
begin
if findobj(x, y, 'iant', 12040108, 5) then
begin
Mouse(x, y, 5, 5, true);
ClickMouse2(Mouse_left);
end;
end;


The last "End" has to end with this "end."

rj

2013-03-03 21:37:49

You did not add the procedure to the main loop also check your color

RequiredOne

2013-03-03 21:40:32

Here is my full code;

program KillSomething;
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}

procedure Attack;
var x, y: Integer;
begin
if findobj(x, y, 'iant', 12040108, 25) then
begin
Mouse(x, y, 5, 5, true);
ClickMouse2(Mouse_Left);
end;
end;

begin
SetupP07Include;
ActivateClient;
Attack;
end.

Noob King

2013-03-03 21:50:35

From: RequiredOne
Here is my full code;


First:
Mouse(x, y, 5, 5, true);
ClickMouse2(Mouse_Left);

"Mouse" moves the mouse and clicks, so you don't need ClickMouse.
If you are using the P07 include then you need to change
if findobj(x, y, 'iant', 12040108, 25) then
to
if P07_findobj(x, y, 'iant', 12040108, 25) then

If that doesn't work, you may have the incorrect color for what you are trying to find.

RequiredOne

2013-03-03 21:56:32

Thank you very much I figured this out before you posted. Any way to get Right click and Attack working? I only have left click :/

rj

2013-03-03 22:07:24

P07_chooseoptionmuilti[('ttack')] to choose the attack option