SRL Archive - FAQ

Why isn't repeat .. until working for me


gillian

2010-11-14 17:28:39

No snarking .. I realize it's pretty rudimentary; I'm trying to re-learn again, and it's a Facebook script :) I can't get my repeat to work .. it clicks more than the 25 times I want it to. Help?

(and I'm using standards, you just can't tell from the paste!!! :)

program VoteWhore;
const
LINK_COLOR = 6629341;
var
NumberOfVotes: integer;
procedure ScrollDown;
begin
ScrollMouse(451,651,-8)
Wait(1500);
end;
procedure SetHouse;
begin
MoveMouse(1065,414);
Wait(1500);
ClickMouse(1065,414,1);
Wait(5000);
MoveMouse(755,452);
Wait(3500);
ClickMouse(755,452,1);
Wait(3000);
MoveMouse(719,549);
Wait(1500);
ClickMouse(719,549,1);
Wait(3000);
MoveMouse(731,799);
Wait(300);
end;
Procedure VoteSisters;
begin
ClickMouse(731,799,1);
Wait(300);
end;
procedure VoteStrangers;
begin
MoveMouse(456,112);
Wait(1500);
ClickMouse(456,112,1);
Wait(1500);
end;
procedure MoveOn1;
begin
MoveMouse(458,695);
Wait(1500);
if(LINK_COLOR = 6629341)then
begin
ClickMouse(458,695,1);
Wait(1500);
end;
end;
procedure MoveOn2;
begin
MoveMouse(405,780);
Wait(1500);
ClickMouse(405,780,1);
Wait(1500);
end;
procedure MoveOn3;
begin
MoveMouse(403,868);
Wait(1500);
ClickMouse(403,868,1);
Wait(1500);
end;
begin
SetHouse;
repeat
VoteSisters;
until(NumberOfVotes = 25);
MoveMouse(451,651);
Wait(1500);
ClickMouse(451,651,1);
Wait(1500);
ScrollDown;
repeat
VoteStrangers;
MoveOn1;
VoteStrangers;
MoveOn2;
VoteStrangers;
MoveOn1;
VoteStrangers;
MoveOn3;
VoteStrangers;
MoveOn2;
VoteStrangers;
MoveOn3;
until(NumberOfVotes = 25);
end.

Shuttleu

2010-11-14 17:32:43

fixed your standards, and using simba tags

program VoteWhore;

const
LINK_COLOR = 6629341;

var
NumberOfVotes: integer;

procedure ScrollDown;
begin
ScrollMouse(451,651,-8)
Wait(1500);
end;

procedure SetHouse;
begin
MoveMouse(1065,414);
Wait(1500);
ClickMouse(1065,414,1);
Wait(5000);
MoveMouse(755,452);
Wait(3500);
ClickMouse(755,452,1);
Wait(3000);
MoveMouse(719,549);
Wait(1500);
ClickMouse(719,549,1);
Wait(3000);
MoveMouse(731,799);
Wait(300);
end;

Procedure VoteSisters;
begin
ClickMouse(731,799,1);
Wait(300);
end;

procedure VoteStrangers;
begin
MoveMouse(456,112);
Wait(1500);
ClickMouse(456,112,1);
Wait(1500);
end;

procedure MoveOn1;
begin
MoveMouse(458,695);
Wait(1500);
if(LINK_COLOR = 6629341)then
begin
ClickMouse(458,695,1);
Wait(1500);
end;
end;

procedure MoveOn2;
begin
MoveMouse(405,780);
Wait(1500);
ClickMouse(405,780,1);
Wait(1500);
end;

procedure MoveOn3;
begin
MoveMouse(403,868);
Wait(1500);
ClickMouse(403,868,1);
Wait(1500);
end;

begin
SetHouse;
repeat
VoteSisters;
until(NumberOfVotes = 25);
MoveMouse(451,651);
Wait(1500);
ClickMouse(451,651,1);
Wait(1500);
ScrollDown;
repeat
VoteStrangers;
MoveOn1;
VoteStrangers;
MoveOn2;
VoteStrangers;
MoveOn1;
VoteStrangers;
MoveOn3;
VoteStrangers;
MoveOn2;
VoteStrangers;
MoveOn3;
until(NumberOfVotes = 25);
end.

~shut

EDIT: as for the problem, you never increase the var NumberOfVotes

gillian

2010-11-14 21:40:15

aw thanks!! :) well crap, ok, I will look at how to increase the value!!!

Shuttleu

2010-11-15 04:18:55

From: gillian
aw thanks!! :) well crap, ok, I will look at how to increase the value!!!


hint, Inc(NumberOfVotes);
put it whenever you want it to increase
if you want it to increase more than one then you can use IncEx(NumberOfVotes, 3);

~shut

gillian

2010-11-15 19:28:01

Okay I officially don't get it :( how do I incorporate that into a repeat?

Shuttleu

2010-11-15 19:30:21

something like this
  repeat
VoteSisters;
Inc(NumberOfVotes);
until(NumberOfVotes = 25);

~shut

gillian

2010-11-15 20:34:16

MUAH!!!!! Thank you!! :)

gillian

2010-11-19 18:09:23

Now I'm having issues with ScrollMouse .. I've gotten it to scroll down using negatives .. I can't get it to scroll up!

procedure ScrollUp;
begin
ScrollMouse(451,651,8);
Wait(1500);
end;

Cstrike

2010-11-19 18:14:08

From: gillian
Now I'm having issues with ScrollMouse .. I've gotten it to scroll down using negatives .. I can't get it to scroll up!

procedure ScrollUp;
begin
ScrollMouse(451,651,8);
Wait(1500);
end;


One possible idea is if you know where the up arrow is on the scroll bar, move mouse there, hold down for a few increments, and then let go of it and check if you're at a height you want

Though AFAIK there's got to be a way with scroll mouse :)

gillian

2010-11-19 23:03:08

Thanks!! I did that :)

Ok .. new issue:

 repeat
VoteStrangers;
Inc(NumberOfVotes);
MoveOn2;
VoteStrangers;
Inc(NumberOfVotes);
MoveOn1;
VoteStrangers;
Inc(NumberOfVotes);
MoveOn3;
VoteStrangers;
Inc(NumberOfVotes);
until(NumberOfVotes = 5);


Okay .. so, what I'd like to see happen is that 5 votes take place (VoteStrangers). It doesn't do that; it goes indefinitely, which means I'm looping :( what's wrong with it??

i luffs yeww

2010-11-20 00:02:29

Make sure you set NumberOfVotes to 0 before the repeat..until loop. It probably just is greater than five so it doesn't stop. Or you could check to see if it's a multiple of five.

until NumberOfVotes mod 5 = 0;

gillian

2010-11-20 09:44:04

Ah .. maybe it's because prior to that, it does this:

 repeat
VoteSisters;
Inc(NumberOfVotes);
until(NumberOfVotes = 200);

So, NumberOfVotes is already at 200, which confuses it? Ok, trying to figure out how to set it to 0 prior :) Thank you!

Shuttleu

2010-11-20 10:02:06

one thing you could also do
 until(NumberOfVotes >= 200);
that way, if it is more than 200 then it will exit

this is useful with the one above where it increases it by 4 each time so it would go 4 then 8 but miss 5, with this if it is more than or equal to 5 then it will exit

~shut

i luffs yeww

2010-11-20 14:35:40

The >= method is generally good to use, as well, because every once in awhile (usually with loops that take only milliseconds each, and not for RuneScape scripts) you can have a mistake where it won't stop even though it went from 0-100 and it was supposed to stop at 5.

ZephyrsFury

2010-11-20 20:35:01

From: i luffs yeww
The >= method is generally good to use, as well, because every once in awhile (usually with loops that take only milliseconds each, and not for RuneScape scripts) you can have a mistake where it won't stop even though it went from 0-100 and it was supposed to stop at 5.


Does that really happen?

i luffs yeww

2010-11-20 21:19:18

Mhmm. From memory it did. Dunno if it happens anymore. (Never seen it happen in Simba, actually.)

gillian

2010-11-21 10:08:07

It worked wonderfully :) you guys have been awesome help .. thank you!!!