Results 1 to 7 of 7

Thread: YoHoJo's Beginner Scripting help

  1. #1
    Join Date
    Feb 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default YoHoJo's Beginner Scripting help

    I have followed his guide and looked carefully at my script but I cant see what i've done wrong. It is for his SaveTheGoldFish

    Here's what Ive got so far,


    My error message is "Exception: Range check error at line 20"

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Can you post the code in simba tags
    Current Project: Retired

  3. #3
    Join Date
    Feb 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry first time, ill do it now

  4. #4
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    your script compiled ok for me? does it error when run?

    Simba Code:
    program SaveTheFish;

    procedure StartGame;
    begin
      MoveMouse(319, 654);
      ClickMouse(319, 654, 1);
      Wait(1500);
      MoveMouse(477, 627);
      ClickMouse(477, 627, 1);
      Wait(500);
      MoveMouse(426, 453);
      ClickMouse(426, 453, 1);
    End;


    Procedure SaveGoldFish;
    var
      x, y:Integer;
    begin
      If FindColorSpiralTolerance(x, y, 172287 , 97, 256, 337, 430, (20)) or
        FindColorSpiralTolerance(x, y, 556031 , 97, 256, 337, 430, 20) or
        FindColorSpiralTolerance(x, y, 1204732 , 97, 256, 337, 430, 20) or
        FindColorSpiralTolerance(x, y, 416254 , 97, 256, 337, 430, 20) or
        FindColorSpiralTolerance(x, y, 75960 , 97, 256, 337, 430, 20) Then
        Begin
          MoveMouse(x, y);
          HoldMouse(x, y, 1);
          MoveMouse(448, 271);
          ReleaseMouse(448, 271, 1);
        end;
    end;

    begin
      StartGame;
      Repeat
      SaveGoldfish;
      until(false);
    end.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  5. #5
    Join Date
    Feb 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It doesn't even run the first few steps, It just compiles then gives me an error on line 20.

    P.S. How do I post my script like that?

  6. #6
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    try this script (srl extension in Simba must be enabled):

    Simba Code:
    program SaveTheFish;

    {$I SRL/SRL.Simba}

    procedure StartGame;
    begin
      MMouse(319, 654,0,0);
      ClickMouse2(mouse_left);
      Wait(1500);
      MMouse(477, 627,0,0);
      ClickMouse2(mouse_left);
      Wait(500);
      MMouse(426, 453,0,0);
      ClickMouse2(mouse_left);
    End;


    Procedure SaveGoldFish;
    var
      x, y:Integer;
    begin
      If FindColorSpiralTolerance(x, y, 172287 , 97, 256, 337, 430, (20)) or
        FindColorSpiralTolerance(x, y, 556031 , 97, 256, 337, 430, 20) or
        FindColorSpiralTolerance(x, y, 1204732 , 97, 256, 337, 430, 20) or
        FindColorSpiralTolerance(x, y, 416254 , 97, 256, 337, 430, 20) or
        FindColorSpiralTolerance(x, y, 75960 , 97, 256, 337, 430, 20) Then
        Begin
          MMouse(x, y,0,0);
          HoldMouse(x, y, 1);
          MMouse(448, 271,0,0);
          ReleaseMouse(448, 271, 1);
        end;
    end;

    begin
      SetupSRL;
      StartGame;
      Repeat
      SaveGoldfish;
      until(false);
    end.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  7. #7
    Join Date
    Feb 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That looks like it will work, I just need to adjust my client coordinates. What did you change?

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
  •