SRL Archive - OSR Help

Curve Ball


EvilmanK

2012-01-15 02:04:42

So, I have the following script:

program CurveBall;


procedure PlayPong;
var
x,y: integer;
begin
if
FindColorSpiralTolerance(x, y, 15728626, 47, 52, 612, 428, 0)
then
//above finds the color of the ball to find coords to move mouse to
begin
MoveMouse(x, y);
ClickMouse(x, y, 1);
end;
end;

begin
MoveMouse(333, 223); //move mouse to the "start game" button
ClickMouse(333, 223, 1); //click "start game"
wait(2000); //waits 2 seconds to account for "level one"
repeat
PlayPong;
until(false);
end.
It works great but there's one problem: it doesn't stop until the game ends. What I mean is, it will keep tracking the color until the game is over and the color doesn't appear anymore. I try pressing F2 and even ctrl+alt+s as YoHoJo's video suggests but none of those work. Is there a way to stop the script prematurely?

Gushers

2012-01-15 02:19:10

You can try to not repeat it, since you have it repeating over and over again.
repeat
PlayPong;
until(false);
Remove 'repeat' and 'until(false);' and see if that works.

EvilmanK

2012-01-15 02:23:11

Without the repeat, it finds the color once and then doesn't anymore. It won't "play" the game for you.

Gushers

2012-01-15 02:32:17

Oo, you want it to keep finding the color but to stop when you want it to?
I was a bit confused on how you stated that…

Kyle Undefined

2012-01-15 02:40:32


repeat
PlayPong;
until(IsKeyDown(VK_DOWN));

That will allow you to stop it.

EvilmanK

2012-01-15 02:42:41

From: Kyle Undefined

repeat
PlayPong;
until(IsKeyDown(VK_DOWN));

That will allow you to stop it.


Thanks. What is VK_DOWN? The down button on the arrow-pad?

Kyle Undefined

2012-01-15 02:43:34

The down arrow on the arrow-pad :)