SRL Archive - RS3 Help

Spam clicking APTA


GetHyper

2015-06-15 03:57:28

I believe I'm close to releasing my first script, it's nothing special but it's a start.

I'm having 1 issue though, once it gets to the furnace and finds it, it spam clicks and carries on doing so once the productionScreen.isOpen for a few seconds. It does this again when I have to find it to do the cballs, I can't seem to find where I'm going wrong so would appreciate the help.

Thank you in advance.

Here is what I am getting in the debug(it does go on longer but I not post all)
-- isMouseOverText()
---- Current mouse-over text: ""
---- Current mouse-over text: "Smelt Furnace"
---- Found "urnace" in mouse-over string: "Smelt Furnace"
-- isMouseOverText(): True
-- isMouseOverText()
---- Current mouse-over text: "Smelt Furnace"
---- Found "urnace" in mouse-over string: "Smelt Furnace"
-- isMouseOverText(): True
-- isMouseOverText()
---- Current mouse-over text: "Smelt Furnace"
---- Found "urnace" in mouse-over string: "Smelt Furnace"
-- isMouseOverText(): True
-- isMouseOverText()
---- Current mouse-over text: "Smelt Furnace"
---- Found "urnace" in mouse-over string: "Smelt Furnace"
-- isMouseOverText(): True
-- isMouseOverText()
---- Current mouse-over text: "Smelt Furnace"
---- Found "urnace" in mouse-over string: "Smelt Furnace"
-- isMouseOverText(): True
-- isMouseOverText()
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
-- isMouseOverText(): False
-- isMouseOverText()
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""
---- Current mouse-over text: ""

The Mayor

2015-06-15 04:24:53

It clicks 11 times because, well, you tell it to:


for i := 0 to 10 do
begin
mouse(middleTPA(ATPA[0]), MOUSE_MOVE);
if isMouseOverText(['urnace', 'nace'], 1000) then
fastClick(MOUSE_LEFT);
end;

There is actually a couple of things wrong here:

  • You always click ATPA[0], rather than looping through them ( ATPA )
  • If there is < 11 TPAs in the ATPA you will get an out of range error (i.e., trying to access ATPA[7] when there is only 4 TPAs in the ATPA)
  • You don't break out of the loop if you clicked


for i := 0 to high(ATPA) do // loop through the length of the ATPA
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE); // Each index in the ATPA

if isMouseOverText(['urnace', 'nace'], 1000) then
begin
fastClick(MOUSE_LEFT);
break; // Break
end;
end;

GetHyper

2015-06-15 06:05:28

From: The Mayor
It clicks 11 times because, well, you tell it to:


for i := 0 to 10 do
begin
mouse(middleTPA(ATPA[0]), MOUSE_MOVE);
if isMouseOverText(['urnace', 'nace'], 1000) then
fastClick(MOUSE_LEFT);
end;

There is actually a couple of things wrong here:

  • You always click ATPA[0], rather than looping through them ( ATPA )
  • If there is < 11 TPAs in the ATPA you will get an out of range error (i.e., trying to access ATPA[7] when there is only 4 TPAs in the ATPA)
  • You don't break out of the loop if you clicked


for i := 0 to high(ATPA) do // loop through the length of the ATPA
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE); // Each index in the ATPA

if isMouseOverText(['urnace', 'nace'], 1000) then
begin
fastClick(MOUSE_LEFT);
break; // Break
end;
end;


Oh my days, why did I change the to a [0]? Silly me.

Reading your reply I understand why I would click the same spot 11 times.

Thank you for your help, I thought I had followed your guide right but then I thought 'oh, lets change stuffs'.