matviy
11-13-2011, 11:54 PM
Most of you have probably at some point played the curveball game. It's been around for a few years so it's nothing new.
http://www.freegames.ws/games/free_online_games/pong_game/3dpong.swf
There are apparently 10 levels to the game, each with increasing difficulty, and you only get so many lives. The challenge is simple, create a SIMBA script which can play the game, and hopefully, beat it.
You can download the .swf file and convert it to an .exe (use google) so you can run it from your desktop, which you can then resize. The game window must be 1000x750 while the script is running.
Although simple at first, the speed of the ball in the last few levels can make tracking it on time incredibly difficult.
Here is the script i created. It tracks the ball simply by searching for a color, and monitors the speed of the ball (distance changed between scans) to predict it's movement and keep the mouse slightly ahead. However, it doesn't seem to be too successful, and is still stuck at lv 9.
WARNING: Once the script starts it doesn't stop, and takes complete control of your mouse. An easy way to stop it is to just alt-f4 out of the game window and the script should stop, or hit "F2" if you can. Due to the exponential movement of the mouse as the speed increases, things can get wild.
program Untitled;
{$I SRL/SRL.scar}
var
X, Y, oX, oY, dist, m, b : Integer;
procedure MouseToColor;
begin
if (X <> oX) and (oX <> 0) then
begin
m := (Y-oY)/(X-oX);
b := Y - (m*X);
dist := Distance(X,Y,oX,oY);
dist := round(pow(dist,12/10)); //modify mouse position based on speed
if oX - X < 0 then
begin
oX := X;
oY := Y;
X := X + (dist/round((Sqrt(1 + Sqr(m)))));
end
else
begin
oX := X;
oY := Y;
X := X - (dist/round((Sqrt(1 + Sqr(m)))));
end;
Y := (m*X) + b;
end;
MoveMouse(X,Y);
ClickMouse(X,Y,1);
end;
procedure TryFindColor;
begin
if FindColor(X,Y,16777215,76,113,923,678)then //rectangle around play area
MouseToColor;
end;
begin
SetupSRL;
oX:= 1;
oY:= 1;
repeat
TryFindColor;
until(False);
end.
Good luck! I'm interested in what people come up with.
EDIT: Huge script error. Fixed now.
http://www.freegames.ws/games/free_online_games/pong_game/3dpong.swf
There are apparently 10 levels to the game, each with increasing difficulty, and you only get so many lives. The challenge is simple, create a SIMBA script which can play the game, and hopefully, beat it.
You can download the .swf file and convert it to an .exe (use google) so you can run it from your desktop, which you can then resize. The game window must be 1000x750 while the script is running.
Although simple at first, the speed of the ball in the last few levels can make tracking it on time incredibly difficult.
Here is the script i created. It tracks the ball simply by searching for a color, and monitors the speed of the ball (distance changed between scans) to predict it's movement and keep the mouse slightly ahead. However, it doesn't seem to be too successful, and is still stuck at lv 9.
WARNING: Once the script starts it doesn't stop, and takes complete control of your mouse. An easy way to stop it is to just alt-f4 out of the game window and the script should stop, or hit "F2" if you can. Due to the exponential movement of the mouse as the speed increases, things can get wild.
program Untitled;
{$I SRL/SRL.scar}
var
X, Y, oX, oY, dist, m, b : Integer;
procedure MouseToColor;
begin
if (X <> oX) and (oX <> 0) then
begin
m := (Y-oY)/(X-oX);
b := Y - (m*X);
dist := Distance(X,Y,oX,oY);
dist := round(pow(dist,12/10)); //modify mouse position based on speed
if oX - X < 0 then
begin
oX := X;
oY := Y;
X := X + (dist/round((Sqrt(1 + Sqr(m)))));
end
else
begin
oX := X;
oY := Y;
X := X - (dist/round((Sqrt(1 + Sqr(m)))));
end;
Y := (m*X) + b;
end;
MoveMouse(X,Y);
ClickMouse(X,Y,1);
end;
procedure TryFindColor;
begin
if FindColor(X,Y,16777215,76,113,923,678)then //rectangle around play area
MouseToColor;
end;
begin
SetupSRL;
oX:= 1;
oY:= 1;
repeat
TryFindColor;
until(False);
end.
Good luck! I'm interested in what people come up with.
EDIT: Huge script error. Fixed now.