Results 1 to 10 of 10

Thread: Curveball script help

  1. #1
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Curveball script help

    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?

    Simba Code:
    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.../curveball.jsp
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #2
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    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
    Simba Code:
    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?
    Last edited by Main; 07-13-2012 at 02:45 PM.
    Oh Hai Dar

  3. #3
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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,
    Simba Code:
    Begin
      If Findcolortolerance( X, Y, GreenCol, XS, YS, XE,YE, GreenTol) Then
        MoveMouse( X, Y);
        Clickmouse(x, y);
    End;
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  4. #4
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Simba Code:
    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.
    Last edited by Main; 07-13-2012 at 03:29 PM.
    Oh Hai Dar

  5. #5
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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!
    Last edited by Footy; 07-13-2012 at 03:43 PM.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  6. #6
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    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.

    Simba Code:
    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.
    Oh Hai Dar

  7. #7
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  8. #8
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    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).
    Oh Hai Dar

  9. #9
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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?
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  10. #10
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    shorter line
    What I mean is if you restart the script yourself then you can probably get pretty high lvls
    Oh Hai Dar

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •