Results 1 to 5 of 5

Thread: Testing and Script Help

  1. #1
    Join Date
    Oct 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Testing and Script Help

    Today I made a iron miner and banker for the Varrock East mine, but I have no way of really testing it since I don't have an account that can mine iron I was also wondering if you could fix it up and show me what I could do better? You could even release it as yours lol I just did it for the practice. Thanks a lot. The script was designed for ScarScape so it will not work with a regular RS client.

    SCAR Code:
    ////////////////////////////////////////////////////////////////////////////////
    //                     Maxcore's Varrock Iron Miner v 1.0                     //
    //                                                                            //
    // Description: This script will mine iron in the mines east of Varrock. It   //
    //              works with multiple players so maximize efficiency/safety.    //
    //              This script was designed for ScarScape, AND IT MUST BE USED   //
    //              WITH IT! Enjoy the script and if you use my methods please    //
    //              credit.                                                       //
    //                                                                            //
    // Directions:                                                                //
    //       1) If you do not have ScarScape, get it at [url]www.sythe.org/ss.rar[/url].     //
    //       2) Open up ScarScape and select the client with the crosshair.       //
    //       3) Position all characters in the Varrock East Bank, next to stalls. //
    //       4) Enter the user name and pass of all characters.                   //
    //       5) Set MaxOre to the number of ore to mine on each character.        //
    //       6) Press play.                                                       //
    //                                                                            //
    // -------------------------------------------------------------------------- //
    // | Change Log                                                             | //
    // -------------------------------------------------------------------------- //
    // | v 1.0 (11/3/07):                                                       | //
    // | Created script, so everything has change :)                            | //
    // -------------------------------------------------------------------------- //
    //                                                                            //
    // Credits: No real credits to speak of, but thanks to everyone at srl who    //
    //          helped me out. Oh, and Aphex Twin and The Tuss for making the     //
    //          most w00ty w00t playlist anyone could ever listen to.             //
    ////////////////////////////////////////////////////////////////////////////////

    program VarrockIronMiner;
         {.include SRL\SRL.scar}
         {.include SRL\SRL\Skill\Mining.scar}
    var
         intOre : integer;
    const
         MaxOre = 2000;                // The amount of ore to mine on each account.

    ////////////////////////////////////////////////////////////////////////////////
    // Procedure: DeclarePlayers;                                                 //
    // Author: Wizzup?                                                            //
    // Description: Declare the players that will be running the script.          //
    //                                                                            //
    // Note: When setting a Nick, make sure it has no capital letters or spaces.  //
    //       ex: If your username is 'Damon B4ird' make your nick '4ird'          //
    ////////////////////////////////////////////////////////////////////////////////
    procedure DeclarePlayers;
    begin
         HowManyPlayers := 5;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer := 0;
         
         Players[0].Name :='USERNAME1';
         Players[0].Pass :='PASSWORD1';
         Players[0].Nick :='';
         Players[0].Active:=True;

         Players[1].Name :='USERNAME2';
         Players[1].Pass :='PASSWORD2';
         Players[1].Nick :='';
         Players[1].Active:=True;

         Players[2].Name :='USERNAME3';
         Players[2].Pass :='PASSWORD3';
         Players[2].Nick :='';
         Players[2].Active:=True;

         Players[3].Name :='USERNAME4';
         Players[3].Pass :='PASSWORD4';
         Players[3].Nick :='';
         Players[3].Active:=True;

         Players[4].Name :='USERNAME5';
         Players[4].Pass :='PASSWORD5';
         Players[4].Nick :='';
         Players[4].Active:=True;
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Function: CheckBank;                                                       //
    // Author: Maxcore                                                            //
    // Description: Checks if user is in the bank.                                //
    ////////////////////////////////////////////////////////////////////////////////
    function CheckBank: Boolean;
    var
         x, y : integer;
    begin
         if FindSymbol(x, y, 'bank') then
         begin
              Writeln('Found bank!');
              Result := true;
         end else if FindColorSpiralTolerance(x, y, 5034473, MMX1, MMY1, MMX2, MMY2, 40) then
         begin
              Writeln('Found bank! (failsafe)');
              Result := true;
         end else
         begin
              Writeln('Could not find bank :(');
              Result := false;
         end;
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Function: GetOutOfVarrock;                                                 //
    // Author: Maxcore                                                            //
    // Description: Walks the character out of Varrock.                           //
    ////////////////////////////////////////////////////////////////////////////////
    function GetOutOfVarrock: Boolean;
    var
         x, y, LittleRocksBottom, LittleRocksTop : integer;
    begin
         LittleRocksBottom := DTMFromString('78DA635CC7C4C010CF801530C2E8E94035A9' +
              'A87276760EA86A6603D5641050B39008354B08AB0100EE990826');
         LittleRocksTop := DTMFromString('78DA635CC5C4C010C7801530C2E89940359EA' +
              '87276760EA86AA612A16622508D0B11E6D8E2570300B8EF0774');

         // Get out of bank
         Mouse(676, 51, 3, 3, true);
         Wait(9000 + Random(1000));
         
         // Get out of Varrock
         if DTMRotated(LittleRocksBottom, x, y, MMX1, MMY1, MMX2, MMY2) then
         begin
              Mouse(MMX2 - 10, y - 7, 3, 3, true);
              Writeln('Found little rocks, moving.');
              FreeDTM(LittleRocksBottom);
              FreeDTM(LittleRocksTop);
              Wait(10000 + Random(1000));
              Result := true;
         end else if DTMRotated(LittleRocksTop, x, y, MMX1, MMY1, MMX2, MMY2) then
         begin
              Mouse(MMX2 - 10, y - 7, 3, 3, true);
              Writeln('Found little rocks, moving. (failsafe)');
              FreeDTM(LittleRocksBottom);
              FreeDTM(LittleRocksTop);
              Wait(10000 + Random(1000));
              Result := true;
         end else
         begin
              Writeln('Could not find little rocks, gay.');
              FreeDTM(LittleRocksBottom);
              FreeDTM(LittleRocksTop);
              Result := false;
         end;
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Function: WalkSouthToMines                                                 //
    // Author: Maxcore                                                            //
    // Description: Returns true if it sucessfully walks to the mines.            //
    ////////////////////////////////////////////////////////////////////////////////
    function WalkSouthToMines: Boolean;
    var
         x, y, WaterAndRocks, TreesAndShirt : integer;
    begin
         WaterAndRocks := DTMFromString('78DA63DCC9C4C010C98002DA9A6A18FE03694' +
              '620FE0F048C71403529A86A8E1E7F0BA619A17CC666A09A3C5435' +
              '05EDCF51D51401D594A2AA89880847555306545345404D0D504D2' +
              'D7E3500850D1399');
         TreesAndShirt := DTMFromString('78DA63DCCAC4C010CF8002DA9A6A18FE03694' +
              '620FE0F048CFD40356DA86A8C7A42C0342394CF580D54938FAAA6' +
              'A0FD39AA9AE94035A1A86AD47CF950D400001C1E0E00');

         // First click south
         Mouse(647, 143, 3, 3, true);
         Wait(10000 + Random(1000));

         if DTMRotated(WaterAndRocks, x, y, MMX1, MMY1, MMX2, MMY2) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found road, clicking.');
              FreeDTM(WaterAndRocks);
              FreeDTM(TreesAndShirt);
              Wait(10000 + Random(1000));
         end else if DTMRotated(WaterAndRocks, x, y, MMX1, MMY1, MMX2, MMY2) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found road, clicking. (failsafe)');
              FreeDTM(WaterAndRocks);
              FreeDTM(TreesAndShirt);
              Wait(10000 + Random(1000));
         end else
         begin
              Writeln('Could not find south road, gay.');
              FreeDTM(WaterAndRocks);
              FreeDTM(TreesAndShirt);
              Result := false;
         end;
         
         // Walk more south
         if FindColor(x, y, 8160134, 618, 144, 668, 160) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found road, walking south.');
              Wait(10000 + Random(1000));
         end else
         begin
              Mouse(648, 154, 3, 3, true);
              Writeln('Could not find road, guessing.');
              Wait(10000 + Random(1000));
         end;
         
         // Walk more south
         if FindColor(x, y, 8160134, 618, 144, 668, 160) then
         begin
              Mouse(x + 3, y, 3, 3, true);
              Writeln('Found road, walking south.');
              Wait(10000 + Random(1000));
         end else
         begin
              Mouse(648, 154, 3, 3, true);
              Writeln('Could not find road, guessing.');
              Wait(10000 + Random(1000));
         end;
         
         // Walk to mines
         Mouse(657, 120, 3, 3, true);
         Wait(10000 + Random(1000));
         
         if FindSymbol(x, y, 'mining site') then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found mine, w00t!');
              Wait(10000 + Random(1000));
              Result := true;
         end else if FindColor(x, y, 4934475, MMX1, MMY1, MMX2, MMY2) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found mine, w00t! (failsafe)');
              Wait(10000 + Random(1000));
              Result := true;
         end else
         begin
              Writeln('Could not find mine, EPIC FAIL!');
              Result := false;
         end;
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Procedure: MineRocks;                                                      //
    // Author: Maxcore                                                            //
    // Description: Mines iron rocks until inventory is full.                     //
    ////////////////////////////////////////////////////////////////////////////////
    procedure MineRocks;
    var
         x, y : integer;
    begin
         repeat
              // Find iron rock
              if FindColor(x, y, 263530, MSX1, MSY1, MSX2, MSY2) then
              begin
                   if not GasFound(x, y) and IsUpText('ock') then
                   begin
                        Mouse(x, y, 3, 3, true);
                        FindNormalRandoms;
                        Wait(5000 + Random(1000));
                   end;
              end;
         until(InvFull);
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Function: WalkNorthToVarrock;                                              //
    // Author: Maxcore                                                            //
    // Description: Walks from mines back to Varrock.                             //
    ////////////////////////////////////////////////////////////////////////////////
    Function WalkNorthToVarrock: Boolean;
    var
         x, y : integer;
    begin
         // Walk north of mines
         Mouse(675, 26, 3, 3, true);
         Wait(10000 + Random(1000));
         
         // Find the road going north
         if FindColor(x, y, 8159622, MMX1, MMY1, MMX2, 37) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found road north, clicking.');
              Wait(11000 + Random(1000));
         end else
         begin
              Mouse(642, 20, 3, 3, true);
              Writeln('Could not find road, guessing.');
              Wait(11000 + Random(1000));
         end;
         
         // Find the road going north, again
         if FindColor(x, y, 8159622, MMX1, MMY1, MMX2, 37) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found road north, clicking.');
              Wait(11000 + Random(1000));
         end else
         begin
              Mouse(642, 20, 3, 3, true);
              Writeln('Could not find road, guessing.');
              Wait(11000 + Random(1000));
         end;
         
         // Find the road going north, for the third time
         if FindColor(x, y, 8159622, MMX1, MMY1, MMX2, 37) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found road north, clicking.');
              Wait(11000 + Random(1000));
         end else
         begin
              Mouse(642, 20, 3, 3, true);
              Writeln('Could not find road, guessing.');
              Wait(11000 + Random(1000));
         end;
         
         //Find way into Varrock
         if FindColor(x, y, 6388110, 673, 18, MMX2, MMY2) then
         begin
              Mouse(x - 102, y, 3, 3, true);
              Writeln('Found road into Varrock, clicking.');
              Wait(10000 + Random(1000));
         end else
         begin
              Mouse(575, 73, 3, 3, true);
              Writeln('Could not find road, guessing.');
              Wait(10000 + Random(1000));
         end;
         
         // Get to the front of the bank
         Mouse(587, 84, 3, 3, true);
         Wait(10000 + Random(1000));
         
         if FindSymbol(x, y, 'bank') then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found bank!');
              Wait(10000 + Random(1000));
              Result := true;
         end else if FindColorSpiralTolerance(x, y, 5034473, MMX1, MMY1, MMX2, MMY2, 40) then
         begin
              Mouse(x, y, 3, 3, true);
              Writeln('Found bank! (failsafe)');
              Wait(10000 + Random(1000));
              Result := true;
         end else
         begin
              Writeln('Could not find bank :(');
              Result := false;
         end;
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Procedure: BankItems;                                                      //
    // Author: Maxcore                                                            //
    // Description: Banks items and preps progress report.                        //
    ////////////////////////////////////////////////////////////////////////////////
    procedure BankItems;
    var
         IronOre : integer;
    begin
         IronOre := BitmapFromString(9, 11, 'beNpjYGBgYDRTlIQgINvDzh' +
              'iEGAyAEgaMAgwKEm4KLAxAxMAIQyBgrSLjoMHoZ6DiBpViyAqzKYh' +
              '0ADKYFGScFBi8FBSACCgF1Fzg4MCQAJLy0lMEIrhRAc5qjZlenfl+' +
              'DFDAaGxszGBkDGQAdTTm+gARUNRNSx7uMCCj2MWxJdsbIgW0AmgXs' +
              'tsaMr0gZgHd5mSgArQOoh1iLEQNXApiKUSQEexlnAAAePsgXw==');
         OpenBankQuiet('veb');
         intOre := intOre + CountItemBmpTol(IronOre, 30);
         FreeBitmap(IronOre);
         Deposit(2, 28, 2);
         // Deposit anything else in inventory.
         Deposit(2, 28, 1);
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Procedure: ProgressReport;                                                 //
    // Author: Maxcore                                                            //
    // Description: Prints out a progress report.                                 //
    ////////////////////////////////////////////////////////////////////////////////
    procedure ProgressReport;
    begin
         // ClearDebug;
         Writeln('========================================>');
         Writeln('Script running for: ' + TimeRunning);
         Writeln('So far we have mined ' + IntToStr(intOre) + ' out of ' + IntToStr(MaxOre) + ' ore');
         Writeln('========================================>');
    end;

    ////////////////////////////////////////////////////////////////////////////////
    // Procedure: GoMining;                                                       //
    // Author: Maxcore                                                            //
    // Description: Walks the user to the mines, gets irons, and walks back.      //
    ////////////////////////////////////////////////////////////////////////////////
    procedure GoMining;
    begin
         SetRun(false);
         CheckBank;
         GetOutOfVarrock;
         WalkSouthToMines;
         SetRun(true);
         MineRocks;
         SetRun(false);
         WalkNorthToVarrock;
         BankItems;
         ProgressReport;
    end;

    begin
         SetUpSRL;
         Cleardebug;
         GetSelf.WindowState := wsMinimized;
         wait(1500);
         LoginPlayer;
         repeat
               intOre := 0;
               while(intOre <= MaxOre) do
               begin
                    PerfectNorth;
                    GoMining;
                    Logout;
               end;
               NextPlayer(true);
         until(false);
    end.

    EDIT: It also appears my mining function does not work, do you think anyone could help me with this? It just freezes when it gets to it so I think maybe it is an infinite loop or something?

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    i'll give it a 1 load try.

    EDIT:

    first off al: Put declare players in the main loop!

    second. this is not working. it walked me to the prayer stuff under the bank. sorry but you need to get an test account.

  3. #3
    Join Date
    Oct 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I did put delcareplayers when i was testing it yesterday, I just forgot to add it here sorry lol. Are you sure you are using ScarScape? Because it walks me to the mines and back every time. The only problem is when it calls MineRocks it freezes up.

  4. #4
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    no i didn't use scarscape lol.

    you shouldtry to learn using roadwalk and stuff.

    gl scripting

  5. #5
    Join Date
    Oct 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay I'll try that, maybe there are some good tuts on this board

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. I was testing..
    By Xerxes in forum The Bashing Club / BBQ Pit
    Replies: 40
    Last Post: 03-24-2006, 06:54 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
  •