View Full Version : Curveball script help
Footy
07-13-2012, 02:32 PM
Hey guys, I decided to make a curveball script out of boredom, but It doesent work well... At all... I decided to use pixelshift to figure out when the round was over, but the mouse is uber jumpy and slow at getting to the ball. Can someone show me what I;m doing wrong?
program Curveball;
{$i srl/srl.simba}
Procedure StartGame;
begin
Mouse(330, 225, 3, 3, 1);
wait(randomrange(1000,2000));
end;
Procedure Ingame;
var
x, y:integer;
PBox:TBox;
begin
PBox := IntToBox(0, 0, 616, 413);
repeat
findcolorspiraltolerance(x, y, 10485682, 0, 0, 616, 431, 10);
Movemouse(x, y);
until(pixelshift(Pbox, 10) = 0)
end;
procedure StartRound;
var
x, y:integer;
PBox: TBox;
begin
PBox := IntToBox(0, 0, 616, 413);
if pixelshift(Pbox, 20) < 10 then
begin
findcolorspiraltolerance(x, y, 10485682, 0, 0, 616, 431, 3)
Mouse(x, y, 5, 5, 1);
end else
Ingame;
end;
begin
SetupSRL
StartGame
repeat
StartRound
Ingame
until(false);
end.
Game = http://www.addictinggames.com/sports-games/curveball.jsp
You don't need pixel shift.
Because ball is always green when you are suppost to block it. You don't need to worry about round over.
Because all then you gotta do is
Begin
If Findcolortolerance( X, Y, GreenCol, XS, YS, XE,YE, GreenTol) Then
MoveMouse( X, Y);
End;
No need for pixel shift.
Allow me to finish 1 round of the game.
EDIT: How the hell do you restart after you finish the game? Do you have to refresh the browser?
Footy
07-13-2012, 02:42 PM
but at the end of a round, you have to click the ball to start the next round, So I used pixelshift to determine when the round was over. I guess I could just spamclick the ball, :D
Begin
If Findcolortolerance( X, Y, GreenCol, XS, YS, XE,YE, GreenTol) Then
MoveMouse( X, Y);
Clickmouse(x, y);
End;
Program CurveBall;
{$i SRL\SRL.simba}
Var
WT: Integer;
OldTP, TP, CD: TPoint;
TPA: TPointArray;
ATPA: array of TPointArray;
Var
OldDB: String;
Procedure SDB( S: String);
Begin
If S = OldDB Then
Exit;
Writeln( S);
OldDB := S;
End;
Function TPEqual( TP1, TP2: TPoint):Boolean;
Begin
Result := (round( abs(TP1.X - TP2.X)) < 10) and (round( abs(TP1.X - TP2.X)) < 10);
End;
Function CoordToStr( TP: TPoint): String;
Begin
Result := '( ' + IntToStr( TP.X) + ', ' + IntToStr( TP.Y) + ')';
End;
Begin
Setupsrl;
MarkTime( WT);
GetClientDImensions( CD.X, CD.Y);
Mousespeed:=99999;
Repeat
If FindColorsTolerance( TPA, 6684547, 1, 1, CD.X - 1, CD.Y - 1, 3) and MiddleTPAEx( TPA, TP.X, TP.Y) Then
Begin
MoveMouse( TP.X, TP.Y);
If Not TPEqual( TP, OLDTP) Then
Begin
MarkTime( WT);
OLDTP := TP;
End Else
If TimeFromMark( WT) > 500 Then
ClickMouse( TP.X, TP.y, 1);
End;
Until False;
End.
That should do the trick :)
So what I did was have a TPEqual function to tell the script whether or not the current position is same as the previous position. And if the ball's position didn't change significantly in the previous 500ms then it clicks on the ball.
Footy
07-13-2012, 03:41 PM
I understand bits of it, but I really have to idea what TPA's are yet, other then Tpoint is a co-ordinate. Thanks! works well!
Heres the much simpler and slightly faster one. Am sure it can be faster with a better logic, and maybe use count color change in the score box rather than clicking it any time.
Program CurveBall;
{$i SRL\SRL.simba}
Var
TP: TPoint;
Begin
Setupsrl;
Repeat
If FindColorTolerance( TP.X, TP.Y, 52427367, 85, 75, 500, 350, 74) Then
MoveMouse( TP.X, TP.Y);
If ( GetColor(551, 220) = 16580471) Then
ClickMouse2( true);
Until False;
End.
Footy
07-13-2012, 04:51 PM
This one makes a little more sence, but do we have to use tpoints? couldnt it be done with x and y instead?
And at your other edit, yes, you have to refresh the game every time, which is likely why it has sooo many hits.
i can't seems to go to lvl 10. But if you wanna do half legit half bot, its very very very easy. (So just restart yourself).
Footy
07-13-2012, 05:02 PM
Looking at comments on other bots, It appears no-one really gets much farther then 8-9. Playing legit I think I got to 10 once, Its insane! Is there any advantage to using Tpoints rather then x and y integers?
shorter line
What I mean is if you restart the script yourself then you can probably get pretty high lvls
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.