SRL Archive - OSR Help

Need Help on Disney Channel Game (Trying to Learn How to Script)


MakingPaint

2013-02-22 15:20:25

So I've been watching tutorials and decided to try to script for a Disney Channel game called "Bueno Rufus". The link to the game is here:
http://disney.go.com/disneychannel/games/bueno-rufus-1966338

The problem that I am having is that when the script detects, for example, ice cream under the chocolate squirter, the script goes frantic and constantly clicks the squirter, which causes it to squirt things other than ice cream, causing the score to be lowered. Yes, I realize this happens because the script clicks as many times as it can in the very short amount of time that the ice cream is below the squirter due to the "repeat". But this repeat has to be there, so how do I get it to click only once? Please help!

This is my script so far:


program Rufus;

procedure Squirt;
var
x, y:Integer;
begin
repeat
If FindColorSpiral(x, y, 10066431, 371, 342, 431, 367) then
begin
MoveMouse(393, 213);
ClickMouse(393, 213, 1);
end;
until(false)
end;
procedure StartGame;
begin
ActivateClient;
MoveMouse(534, 346);
ClickMouse(534,346, 1);
Wait(750);
ClickMouse(534, 346, 1);
end;


begin
Startgame;
Squirt;
end.

Element17

2013-02-23 16:54:19

Function Squirt: Boolean;
var
x, y:Integer;
begin
repeat
If FindColorSpiral(x, y, 10066431, 371, 342, 431, 367) then
MoveMouse(393, 213);
ClickMouse(393, 213, 1);
Result:= True;
until(Result)
end;

Try that?

mcbain

2013-02-23 19:38:34

Why does the repeat have to be there? It shouldn't have to be there.

I would find the color like this..

procedure Squirt;
var
x, y:Integer;
begin
If FindColortolerance(x, y, 10066431, 371, 342, 431, 367,5) then
//the "5" is the tolerance.
begin
Mmouse(x,y,0,0);//SRL function, so we need to setupSRL in the main loop
wait(400);
clickmouse2(mouse_left);//SRL function, so we need to setupSRL in the main loop
end;
end;

begin//main loop
SetupSRL;
Squirt;//calling Squirt procedure
end.

That would work to find the color on the screen, move the mouse to the location and then click the left mouse button.

Feel free to pm me if my instructions aren't clear :)

Element17

2013-02-23 22:18:09

That only works once then the scripts ends and that is not what he is looking for. He only wants it to click once, then wait again for that color and click once more. So yes he needs the repeat.

mcbain

2013-02-25 03:30:53

From: Element17
That only works once then the scripts ends and that is not what he is looking for. He only wants it to click once, then wait again for that color and click once more. So yes he needs the repeat.


Ahh I thought he said he only wanted to do it once then stop. baha my bad :D