Results 1 to 7 of 7

Thread: Terminate Script bug?

  1. #1
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default Terminate Script bug?

    ok so im adding my tree finding failsafe to my powerchopper and i want it to terminate the script when it doesnt find the tree....

    so when it doesnt find the tree it terminates the script fine....BUT after its terminated....the mouse FREAKS OUT and starts moving back and forth really fast (kinda vibrating like) and i have to restart my compy for it to go back to normal.

    is this normal cuz this happens every time for me?

    if it is...then is there another command to end the script?

    thanks
    METAL HEAD FOR LIFE!!!

  2. #2
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can you post the procedure/function where you terminate the script? And the main loop if thats possible.
    On vacation from July 2nd till middle of August


    Account Creator and Tutorial Island Runner (member | public) Errors fixed


    Check out my Complete forms tutorial. It will teach you everything you need to know about forms.

  3. #3
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    ok here it is....

    SCAR Code:
    //TREE FINDER//
    procedure FindTheTree;

    var Tries: Integer;
    begin
      if(not(LoggedIn))then
        Exit;
      begin
        repeat
        Wait(1000 + random(250));
        Tries:= Tries + 1;
        if(Tries = 20)then
        begin
          Writeln('couldnt find color...ending script');
          TerminateScript;
        end;
        until(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,MSX2,MSY2,3));
      end;
    end;


    //MAIN LOOP//
    begin
      ScriptSetup;
        if (not(LoggedIn)) then
          LogInPlayer;
           Setup;
            NEWLINE:='';
            DeclarePlayers;
            Randoms;
          repeat
            if (not(LoggedIn)) then
              LogInPlayer;
              Chop;
              Drop;
              Proggy;
              Randoms;
              DontGetBanned;
            until  Loads >= Players[CurrentPlayer].Loads1
        if Loads >= Players[CurrentPlayer].Loads1 then
      Logout;
    NextPlayer(True);
    end.
    METAL HEAD FOR LIFE!!!

  4. #4
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    I'm not 100% sure this is it, but I can pretty much say that I know what the problem is.

    After your TerminateScript you shouldn't have until(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,M SX2,MSY2,3));

    There is no need to have that since the script is already ended.

    And you might not want to terminate the script if you plan on making it multiplayer. You should probably use a Break;or Exit; then NextPlayer(False) so the script will continue autoing with the next player

  5. #5
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    ok thanks,

    yea just converted to multi =p ill change that

    METAL HEAD FOR LIFE!!!

  6. #6
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    you can keep that until because it only terminates the script if tries is at 20 so you still want the until to search those 20 times then terminate.


  7. #7
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    yep i left the until but changed the terminate script to just Exit; b/c i have it on multiplayer now w00t

    thanks for your help guys
    METAL HEAD FOR LIFE!!!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. About script terminate
    By raimis89 in forum OSR Help
    Replies: 2
    Last Post: 12-14-2006, 01:41 PM

Posting Permissions

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