SRL Archive - RS3 Help

Click Count?


Penguin

2014-07-14 10:21:16

For a failsafe, I'm trying to find a way so that it will read how many clicks it has performed before giving up on the inventory and continuing to the banking. I've been looking around the functionlist for a while now and have just brainfarted, here's my idea:
var
ClickCount:Integer;

Begin
ClickCount := 0; <-- Resets the clickcount to 0 for every loop
repeat
TypeSend('1', False);
Wait(randomRange(50, 150));
fastclick(MOUSE_LEFT);
Wait(randomRange(1500, 350));
until
(isMouseOverText(['une bar']));
or
ClickCount >= 6; <-- Limits the amount of clicks since the beginning of the procedure
End;

TLDR, Can I count Clicks?
Any help/advice would be amazing :)

sdf

2014-07-14 10:23:52

You are looking for
inc(ClickCount)

i.e.
var
ClickCount: Integer;
begin
ClickCount := 0;
repeat
TypeSend('1', False);
Wait(randomRange(50, 150));
fastclick(MOUSE_LEFT);
inc(ClickCount);
Wait(randomRange(1500, 350));
until (isMouseOverText(['une bar']));
or ClickCount >= 6;
end;

Penguin

2014-07-14 10:28:14

From: sdf
You are looking for
inc(ClickCount)

i.e.
var
ClickCount: Integer;
begin
ClickCount := 0;
repeat
TypeSend('1', False);
Wait(randomRange(50, 150));
fastclick(MOUSE_LEFT);
inc(ClickCount);
Wait(randomRange(1500, 350));
until (isMouseOverText(['une bar']));
or ClickCount >= 6;
end;


Facepalm, Thank you :)

Turpinator

2014-07-14 10:41:29

var
ClickCount: Integer;
begin
ClickCount := 0;
repeat
TypeSend('1', False);
Wait(randomRange(50, 150));
fastclick(MOUSE_LEFT);
//inc(ClickCount); /// or below.
ClickCount := ClickCount + 1;
Wait(randomRange(1500, 350));
until isMouseOverText(['une bar']) or (ClickCount >= 6);
end;
changed the end to that until statement to correct syntax/standards. did it work like that before?

Penguin

2014-07-14 10:44:49

From: Turpinator
var
ClickCount: Integer;
begin
ClickCount := 0;
repeat
TypeSend('1', False);
Wait(randomRange(50, 150));
fastclick(MOUSE_LEFT);
//inc(ClickCount); /// or below.
ClickCount := ClickCount + 1;
Wait(randomRange(1500, 350));
until isMouseOverText(['une bar']) or (ClickCount >= 6);
end;
changed the end to that until statement to correct syntax/standards. did it work like that before?


It actually did, but thanks for going back and double checking

The Mayor

2014-07-14 16:08:43

You could also use:



procedure something();
var
clickCount: integer;
begin
while clickCount < 7 do
begin
typeSend('1', False);
wait(randomRange(50, 150));
fastclick(MOUSE_LEFT);
wait(randomRange(1500, 350));
if isMouseOverText(['une bar'])) then
break;
end;
end;