Results 1 to 7 of 7

Thread: Curve Ball

  1. #1
    Join Date
    Jan 2012
    Posts
    78
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Curve Ball

    So, I have the following script:
    Code:
    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?

  2. #2
    Join Date
    Dec 2011
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

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

  3. #3
    Join Date
    Jan 2012
    Posts
    78
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  4. #4
    Join Date
    Dec 2011
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    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...

  5. #5
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Simba Code:
    repeat
      PlayPong;
    until(IsKeyDown(VK_DOWN));

    That will allow you to stop it.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  6. #6
    Join Date
    Jan 2012
    Posts
    78
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Simba Code:
    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?

  7. #7
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    The down arrow on the arrow-pad
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


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
  •