Results 1 to 6 of 6

Thread: Making the script log out and stop after it's done the job

  1. #1
    Join Date
    Jan 2008
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Making the script log out and stop after it's done the job

    How do I make it? I tried but it doesn't work... I want it to stop when it finish's alching. Here's the script.

    SCAR Code:
    program AbsTrACtAutoAlcherSmartVersion;//This is my very first script but I believe it is a pretty good one.

      {///////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
      { Title:           AbsTrACtAutoAlcher                                                   }
      { Version:         1.02 SMART                                                           }
      { Author:          AbsTrACt'^.|                                                         }
      { Settings:        I don't use colors in this script so it's the same...                }
      { Recommendation:  Use it in Barrows Tombs as there are no randoms there                }
      {although you may find some persons there and I didn't made an AutoResponder yet        }
      { SetUp Lines:                                                                          }
      {///////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}

      {.include SRL\SRL\Misc\Smart.scar}
      {.include SRL\SRL.scar}
      {.include SRL\SRL\misc\Users.scar}
    var
      Alch: Integer;
      Alchs: Integer;
      Alchspell: Integer;
      AlchLong: Integer;
      x, y: Integer;

      {/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
      {                   Begin SetUp                  }
      {\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}
    const

      RunD           = 'n'; //Direction to run from Attacking Random (n, s, w, e)
      ItemToAlchName = 'yew longbow';
      //Name of the item you are alching (for antiban)
      Alchstodo = 900; //How many alchs the bot should do?

    procedure DeclarePlayers; // this procedure is used to log players in
    begin
      HowManyPlayers := 5;               // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers);   // Sets the Players Array Length;
      CurrentPlayer := 0;                // CurrentPlayer = Array Index

      Players[1].Name := 'USERNAME';//Your account username
      Players[1].Pass := 'PASSWORD';//Your account password
      Players[1].Nick := 'ser';     //3-4 Small letters of your username
      Players[1].Active := True;
      //Player in use or not in use (True for in use, False for not in use)

      Players[1].Name := 'USERNAME';//Your account username
      Players[1].Pass := 'PASSWORD';//Your account password
      Players[1].Nick := 'ser';     //3-4 Small letters of your username
      Players[1].Active := false;
      //Player in use or not in use (True for in use, False for not in use)

      Players[2].Name := 'USERNAME';//Your account username
      Players[2].Pass := 'PASSWORD';//Your account password
      Players[2].Nick := 'ser';     //3-4 Small letters of your username
      Players[2].Active := false;
      //Player in use or not in use (True for in use, False for not in use)

      Players[3].Name := 'USERNAME';//Your account username
      Players[3].Pass := 'PASSWORD';//Your account password
      Players[3].Nick := 'ser';     //3-4 Small letters of your username
      Players[3].Active := false;
      //Player in use or not in use (True for in use, False for not in use)

      Players[4].Name := 'USERNAME';//Your account username
      Players[4].Pass := 'PASSWORD';//Your account password
      Players[4].Nick := 'ser';     //3-4 Small letters of your username
      Players[4].Active := false;
      //Player in use or not in use (True for in use, False for not in use)
    end;
      {/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
      {                     End SetUp                  }
      {\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
      {                Do Not Touch Below              }
      {\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    procedure Randoms;
    begin
      FindNormalRandoms;  //finds normal randoms
      DwarfItem;          //dropes dwarf items
      if (FindFight) then //runs away from fight
      begin
        MakeCompass('n');
        RunTo(RunD, true);
        Wait(3500 + Random(3000));
        RunTo(RunD, true);
      end;
    end;

    procedure DTMs;
    begin
      Alchspell := DTMFromString('78DA63E461606010644001BFBEF130FC07D28' +
           'C40FC1F081805800C560634C08844026911202146400D485E8880' +
           '1A6622D470126117C84F5C04D4F011610E1B95EC02F9898708BBF' +
           '889081F41FC6A0095B60893');

      AlchLong := DTMFromString('78DA631467606090614001BECE9C0CFF81342' +
           '310FF0702463120438B010D302291409A0348A81050A304248408' +
           'A8510612D244A85123A0461E48681350C303243409A8E126C23D7' +
           '2404200BF1A00F35607DF');
    end;

    procedure AntiBan;
    begin
       Case Random(5) of

       0:
        begin

          Wait(1000+Random(550));
          HoverSkill('Magic', False);
          Wait(1000+Random(550));
          Randoms;
          Wait(1000+Random(550));
          GameTab(7);
        end;

        1:
         Begin

           Wait(1000+Random(550));
           RandomRClick;
           Wait(1000+Random(550));
           Randoms;
           Wait(1000+Random(550));
           GameTab(7);
          end;

         2:
          Begin

            Wait(1000+Random(550));
            RandomMovement;
            Wait(1000+Random(550));
            Randoms;
            Wait(1000+Random(550));
            GameTab(7);
           end;

          3:
           Begin

             Wait(1000+Random(550));
             BoredHuman;
             Wait(1000+Random(550));
             Randoms;
             Wait(1000+Random(550));
             GameTab(7);
            end;

           4:
            Begin

              Wait(1000+Random(550));
              AlmostLogout;
              Wait(1000+Random(550));
              Randoms;
              Wait(1000+Random(550));
              GameTab(7);
             end;
             end;
    end;

    procedure Report;
    begin
      Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      Writeln('| AbsTrACt Auto Alcher Report! Feel free to post');
      Writeln('| Alched ' + IntToStr(Alchs) + ' ' + ItemToAlchName + 's.');
      Writeln('| Worked for ' + (TimeRunning));
      Writeln('| Exp gained ' + IntToStr(alchs * 65));
      Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      Writeln('Made By AbsTrACt!');
    end;

    procedure Finished;
    begin
      if (alchs = alchstodo) then
      begin
        LogOut;
        Report;
      end;
    end;

    procedure Alching;
    begin
      GameTab(7);
      repeat
        Wait(500 + Random(150));
        if FindDTM(Alchspell, x, y, MIX1, MIY1, MIX2, MIY2) then
        Wait(100+Random(100));
          Mouse(x, y, 5, 5, true);
        Wait(100+Random(100));
        if FindDTM(AlchLong, x, y, MIX1, MIY1, MIX2, MIY2) then
        Wait(100+Random(100));
          Mouse(x, y, 10, 10, true);
        Wait(2000 + Random(100));
        case Random(8) of
          0:
            Wait(150 + (Random(376)));
          1:
            Wait(55 + (Random(100)));
          2:
            Wait(0 + (Random(2500)));
          3:
            AntiBan;
          4:
            Wait(0 + (Random(150)));
          5:
            Wait(150 + (Random(100)));
          6:
            Wait(0 + (Random(1000)));
          7:
            Wait(0+ (Random(1000)));
        end;
        Report;
        Finished;
      until alchs = alchstodo;
    end;

    procedure Setup;
    begin
      smartSetup('World157', true, true);
      while not (SmartReady) do
        Wait(100);
      SetTargetDC(SmartGetDC);
      if not (LoggedIn) then
        while not (SmartGetColor(386, 249) = 65535) do
          Wait(100);
      SetupSRL;;
      wait(1000)
      ActivateClient;
      wait(1000)
    end;

    begin
      SetupSRL;
      Setup;
      DeclarePlayers;
      LoginPlayer;
      DTMs;
      Alching;
      FreeDTM(Alchspell);
      FreeDTM(AlchLong);
    end.

    I need help with another 2 things. First is that I need to fix the report (the report doesn't count the alch's done) and second I would like to add this but I don't know how:

    if can't find DTM then LogOut

    Please help.

  2. #2
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    youc could have failsafes like if finddead then logout and at end of main loop you can put until not loggedin
    or you can put

    or you can put until alchs =alchstodo
    logoutplayer;

    also do until alchs>=to alchstodo so that if something goes wron and it skips the nuumber to do it wont go on for ever

    also another good way of finding help with stuff is look in the includes folders =]
    Blank!

  3. #3
    Join Date
    Dec 2007
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The problem with your report is that the program doesn't count when alching.
    Add
    SCAR Code:
    alch := alch + 1;
    after it clicks the item to alch in your Alching-procedure.


    Making it logout if it fails to find the DTM is easy. Just add an "else" in your procedure.
    SCAR Code:
    if FindDTM(Alchspell, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin //it found the DTM...
      Wait(100+Random(100));
      Mouse(x, y, 5, 5, true);
      Wait(100+Random(100));
    else //it didn't find the DTM...
    begin
      LogOut;
    end;
    This sentence is false.

  4. #4
    Join Date
    Sep 2007
    Location
    Sweden
    Posts
    765
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    you will need to declare alch as a var, just like x and y.
    SCAR Code:
    if FindDTM(Alchspell, x, y, MIX1, MIY1, MIX2, MIY2) then
    begin //it found the DTM...
      Wait(100+Random(100));
      Mouse(x, y, 5, 5, true);
      Wait(100+Random(100));
      alch := alch + 1;
    else //it didn't find the DTM...
    begin
      LogOut;
    end;


    ^LOL^

  5. #5
    Join Date
    Jan 2008
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok now it does that but now my repeat doesn't work. Here is my script atm:

    SCAR Code:
    program AbsTrACtAutoAlcherSmartVersion;//This is my very first script but I believe it is a pretty good one.

      {///////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
      { Title:           AbsTrACtAutoAlcher                                                   }
      { Version:         1.02 SMART                                                           }
      { Author:          AbsTrACt'^.|                                                         }
      { Settings:        I don't use colors in this script so it's the same...                }
      { Recommendation:  Use it in Barrows Tombs as there are no randoms there                }
      {although you may find some persons there and I didn't made an AutoResponder yet        }
      { SetUp Lines:                                                                          }
      {///////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}

      {.include SRL\SRL\Misc\Smart.scar}
      {.include SRL\SRL.scar}
      {.include SRL\SRL\misc\Users.scar}
    var
      Alch: Integer;
      Alchs: Integer;
      Alchspell: Integer;
      AlchLong: Integer;
      x, y: Integer;

      {/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
      {                   Begin SetUp                  }
      {\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}
    const

      RunD           = 'n'; //Direction to run from Attacking Random (n, s, w, e)
      ItemToAlchName = 'yew longbow';
      //Name of the item you are alching (for antiban)
      Alchstodo = 161; //How many alchs the bot should do?

    procedure DeclarePlayers; // this procedure is used to log players in
    begin
      HowManyPlayers := 5;               // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers);   // Sets the Players Array Length;
      CurrentPlayer := 0;                // CurrentPlayer = Array Index

      Players[0].Name := 'USERNAME';//Your account username
      Players[0].Pass := 'PASSWORD';//Your account password
      Players[0].Nick := 'ser';     //3-4 Small letters of your username
      Players[0].Active := true;
      //Player in use or not in use (True for in use, False for not in use)

      Players[1].Name := 'USERNAME';//Your account username
      Players[1].Pass := 'PASSWORD';//Your account password
      Players[1].Nick := 'ser';     //3-4 Small letters of your username
      Players[1].Active := false;
      //Player in use or not in use (True for in use, False for not in use)

      Players[2].Name := 'USERNAME';//Your account username
      Players[2].Pass := 'PASSWORD';//Your account password
      Players[2].Nick := 'ser';     //3-4 Small letters of your username
      Players[2].Active := false;
      //Player in use or not in use (True for in use, False for not in use)

      Players[3].Name := 'USERNAME';//Your account username
      Players[3].Pass := 'PASSWORD';//Your account password
      Players[3].Nick := 'ser';     //3-4 Small letters of your username
      Players[3].Active := false;
      //Player in use or not in use (True for in use, False for not in use)

      Players[4].Name := 'USERNAME';//Your account username
      Players[4].Pass := 'PASSWORD';//Your account password
      Players[4].Nick := 'ser';     //3-4 Small letters of your username
      Players[4].Active := false;
      //Player in use or not in use (True for in use, False for not in use)
    end;
      {/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
      {                     End SetUp                  }
      {\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
      {                Do Not Touch Below              }
      {\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
      {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    procedure Randoms;
    begin
      FindNormalRandoms;  //finds normal randoms
      DwarfItem;          //dropes dwarf items
      if (FindFight) then //runs away from fight
      begin
        MakeCompass('n');
        RunTo(RunD, true);
        Wait(3500 + Random(3000));
        RunTo(RunD, true);
      end;
    end;

    procedure DTMs;
    begin
      Alchspell := DTMFromString('78DA63E461606010644001BFBEF130FC07D28' +
           'C40FC1F081805800C560634C08844026911202146400D485E8880' +
           '1A6622D470126117C84F5C04D4F011610E1B95EC02F9898708BBF' +
           '889081F41FC6A0095B60893');

      AlchLong := DTMFromString('78DA631467606090614001BECE9C0CFF81342' +
           '310FF0702463120438B010D302291409A0348A81050A304248408' +
           'A8510612D244A85123A0461E48681350C303243409A8E126C23D7' +
           '2404200BF1A00F35607DF');
    end;

    procedure AntiBan;
    begin
       Case Random(5) of

       0:
        begin

          Wait(1000+Random(550));
          HoverSkill('Magic', False);
          Wait(1000+Random(550));
          Randoms;
          Wait(1000+Random(550));
          GameTab(7);
        end;

        1:
         Begin

           Wait(1000+Random(550));
           RandomRClick;
           Wait(1000+Random(550));
           Randoms;
           Wait(1000+Random(550));
           GameTab(7);
          end;

         2:
          Begin

            Wait(1000+Random(550));
            RandomMovement;
            Wait(1000+Random(550));
            Randoms;
            Wait(1000+Random(550));
            GameTab(7);
           end;

          3:
           Begin

             Wait(1000+Random(550));
             BoredHuman;
             Wait(1000+Random(550));
             Randoms;
             Wait(1000+Random(550));
             GameTab(7);
            end;

           4:
            Begin

              Wait(1000+Random(550));
              AlmostLogout;
              Wait(1000+Random(550));
              Randoms;
              Wait(1000+Random(550));
              GameTab(7);
             end;
             end;
    end;

    procedure Report;
    begin
      Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      Writeln('| AbsTrACt Auto Alcher Report! Feel free to post');
      Writeln('| Alched ' + IntToStr(Alch) + ' ' + ItemToAlchName + 's.');
      Writeln('| Worked for ' + (TimeRunning));
      Writeln('| Exp gained ' + IntToStr(alchs * 65));
      Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      Writeln('Made By AbsTrACt!');
    end;

    procedure Finished;
    begin
      if (alch = alchstodo) then
      begin
        LogOut;
        Report;
      end;
    end;

    procedure Alching;
    begin
      GameTab(7);
        repeat
        Wait(500 + Random(150));
      if FindDTM(Alchspell, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Wait(100+Random(100));
        Mouse(x, y, 5, 5, true);
        Wait(100+Random(100));
      End else
      begin
        LogOut;
      end;
      begin
        if FindDTM(AlchLong, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin //Found the DTM
        Wait(100+Random(100));
        Mouse(x, y, 10, 10, true);
      End else //Didn't find the DTM
      begin
        LogOut;
      end;
        Alch := alch + 1;
        Wait(2000 + Random(100));
        case Random(8) of
          0:
            Wait(150 + (Random(376)));
          1:
            Wait(55 + (Random(100)));
          2:
            Wait(0 + (Random(2500)));
          3:
            AntiBan;
          4:
            Wait(0 + (Random(150)));
          5:
            Wait(150 + (Random(100)));
          6:
            Wait(0 + (Random(1000)));
          7:
            Wait(0+ (Random(1000)));
        end;
        Report;
        Finished;
        until alch =: alchstodo
    end;
    end;

    procedure Setup;
    begin
      smartSetup('World157', true, true);
      while not (SmartReady) do
        Wait(100);
      SetTargetDC(SmartGetDC);
      if not (LoggedIn) then
        while not (SmartGetColor(386, 249) = 65535) do
          Wait(100);
      SetupSRL;;
      wait(1000)
      ActivateClient;
      wait(1000)
    end;

    begin
      SetupSRL;
      Setup;
      DeclarePlayers;
      LoginPlayer;
      DTMs;
      Alching;
      FreeDTM(Alchspell);
      FreeDTM(AlchLong);
    end.

  6. #6
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok first off, your standards could do with some fixing...
    ill fix em up for you and post a link on how it should be,Here look at this.
    and why your repeat doesn't work is because you have random begins and ends and its throwing it off... here try this:
    SCAR Code:
    procedure Alching; // You had to many begins in there and it threw it off.
    begin
      GameTab(7);
        repeat
          Wait(500 + Random(150));
          if FindDTM(Alchspell, x, y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Wait(100+Random(100));
            Mouse(x, y, 5, 5, true);
            Wait(100+Random(100));
          End else
          begin
            LogOut;
            Report; //You should make it show a proggy then end the script so it doesn't just sit there idle
            TerminateScript;
          end;
          if FindDTM(AlchLong, x, y, MIX1, MIY1, MIX2, MIY2) then
          begin //Found the DTM
            Wait(100+Random(100));
            Mouse(x, y, 10, 10, true);
          End else //Didn't find the DTM
          begin
            LogOut;
          end;
          Alch := alch + 1;
          Wait(2000 + Random(100));
          case Random(8) of //Fixed up case to make it more pleaseing looking.
            0:  Wait(150 + (Random(376)));
            1:  Wait(55 + (Random(100)));
            2:  Wait(0 + (Random(2500)));
            3:  AntiBan;
            4:  Wait(0 + (Random(150)));
            5:  Wait(150 + (Random(100)));
            6:  Wait(0 + (Random(1000)));
            7:  Wait(0+ (Random(1000)));
          end;
          Report;
          Finished;
        until(alch = alchstodo); //You forgot the parentheses and its not "=:" that is for declaring things or setting things to somthing
        Logout;                  //"=" is used for comparing or if statments
    end;
    Other then that looks like this could work out to something good.
    Keep up the good work and hope to se you in members soon
    Kindof Inactive...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help Making Script.
    By seany in forum OSR Help
    Replies: 2
    Last Post: 10-14-2008, 09:03 PM
  2. Script is making the rs lag
    By fudgepack a in forum OSR Help
    Replies: 6
    Last Post: 03-13-2008, 11:25 PM
  3. Should I (Yanix) Stop Make threads And Stop Post?
    By yanix in forum News and General
    Replies: 11
    Last Post: 08-31-2007, 09:10 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
  •