Results 1 to 18 of 18

Thread: Why wont my script commit?

  1. #1
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default Why wont my script commit?

    I'm having some trouble with getting my script to commit to the srl stats feature can someone please explain where I am going wrong?

    I am trying to commit to this script http://stats.villavu.com/script/804 which can be found here http://villavu.com/forum/showthread.php?t=75636 however I will post a copy of it on this thread for simplicities sake.

    I know the script runs fine as I ran it for about 2 hours last night.

    my commit procedure is:
    SCAR Code:
    Procedure Commit;
    begin
      xpg := (XP - lxp); //calculates xp gained since last commit
      stats_IncVariable('Crafting EXP (Gained)', Round(made * XPPerGlass));
      Stats_Commit;
      lxp := XP; //saves the variable for next time it needed to commit
      MarkTime(CommitTime);
    end;

    and I have called SetupSRLStats(804, SRLStats_User, SRLStats_Password); when the script starts.




    the full script is as follows:
    SCAR Code:
    program FleaWine;
    {$DEFINE SMART}
    {$include srl/srl.simba}

    var
      StartTime, Made, MadeH, Sec, state,XP,XPH:Integer;
      xpg,lxp,totalXP:integer;
      Glass,Beer,Candle,oil,vial,fishbowl,orb,lanternlens,lightorb:integer;
      reporttime,committime:integer;

    const
      SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
      SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)
      Makewhat = 'orb'; //what to make set as either Beer,Candle,oil,vial,fishbowl,orb,lanternlens,lightorb
      XPPerGlass = 52.5;//xp per glass beerglass = 17.5, candle lantern = 19, oil lamp = 25, vial = 35
                    //             fishbowl = 42.5, orb = 52.5, latern lens = 55, lightorb = 70
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Pin := '';
        BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];//Random event prices.
      end;
    end;

    procedure setDTM;
    begin
      Glass := DTMFromString('mlwAAAHicY2dgYHBlYmDwBGJnILYCYnsg9obST4HyL4D4NQOE/RCIH0DFbuQ4MlypimY4nC/FcLo8guFokjXDkeJQhpPF0gz8QHlcmBEPhgIA5jUS+Q==');
      Beer := DTMFromString('mrAAAAHic42BgYPAAYncgdgJiFyD2B2IvKN8biBcwMjCsBOJFQDwLiBcC8XQgXg7ES4C4pqyMISMlhaG+spLBzdmZwcHWlsHf25shLzODobq0lIEfaAY+zEgAwwAAD9sQ7A==');
      Candle := DTMFromString('mrAAAAHic42BgYJgJxHOBeBoQTwLiyUA8Ayo2D4gXMjIwrATiVUC8GIjnAPFMIJ4L5Rvp6zOkZ5YwxMVnMASFxoP5IBwakcwQHJrAwA80Ax9mJIBhAADuJBGY');
      oil := DTMFromString('mbQAAAHicY2VgYHgGxC+A+C2U/RiI5zMyMCwH4qVAPB1Ky8opMXh4+jM4OrgxiIlLMYSGxTPwA9WiY0YsGAwAb8cLWw==');
      vial := DTMFromString('mrAAAAHic42BgYLBiZGAwBWInILZmhPBtgdgMiO2AeCEQrwbiVVB6OhDPA+JFQDwDiJNTMhgSE1MZbG0dGGJiEhhCQyMZXF09GFJSMhlcXN0Z+IF24MOMBDAMAAB8qQ9+');
      fishbowl := DTMFromString('mwQAAAHic42RgYOhjhOBWIJ4OxJOAuAOKQex2IJ4LxMuAeDEQzwfiGVC8AoiXAPEcIC4oKGM4d+4WGK9cuQnMh4nt3XsCzOYH2kcIMxKB4QAAOQEcPA==');
      orb := DTMFromString('mWAAAAHicY2FgYBBhZGCQAWIhIJYA4qVAPBeIF0LZyUnxDI6OdgzRkWEMjg52DFxAPciYEQ2DAABoaQbI');
      lanternlens := DTMFromString('mlwAAAHicY2dgYEhnZGBIAuJsIM4B4mQgTgDiXCCeC8RLoXgWEM8E4vlAPA+IzS0dGAyNLBhkZBXAtKd3CIOTiy+DmoYuAz/QXFyYEQ+GAgDHRwwi');
      lightorb := DTMFromString('mrAAAAHic42BgYJgJxHOBeBoQTwLiyUA8Ayo2D4gXMjIwrATiVUC8GIjnAPFMIJ4L5Rvp6zOkZ5YwxMVnMASFxoP5IBwakcwQHJrAwA80Ax9mJIBhAADuJBGY');
    end;

    procedure freeeDTM;
    begin
      FreeDTM(Glass);
      FreeDTM(Beer);
      FreeDTM(Candle);
      FreeDTM(oil);
      FreeDTM(vial);
      FreeDTM(fishbowl);
      FreeDTM(orb);
      FreeDTM(lanternlens);
      FreeDTM(lightorb);
    end;

    procedure bank;
    var
      x,y,x2,y2:Integer;
    begin
      if (state = 1) then
      begin
        Writeln('banking');
        OpenBankChest(SRL_Bank_SW);
        if PinScreen then
          InPin(Players[CurrentPlayer].Pin);
        if BankScreen then
        begin
          wait(900+random(200));
          DepositAll;
          if FindDTM(Glass,x,y,MBX1,MBy1,MBX2,MBY2) then
          begin
            Mouse(x,y,1,1,false);
            ChooseOption('All');
            wait(200+random(50));
            CloseBank;
            state := 2;
          end;
          wait(500+random(100));
        end;
      end;
    end;
    procedure hover;
    begin
      HoverSkill(SKILL_CRAFTING,False);
      wait(100+random(10));
      Ftab(25);
    end;
    procedure blowGlass;
    var
    x,y:integer;
    begin
      if (state = 2) then
      begin
        if not (GetCurrentTab = 25) then
          Ftab(25);
        if FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2) then
        begin
          Mouse(x,y,1,1,true);
          wait(100+random(100));
        end;
        if (makewhat = 'beer') then
        begin
          if FindDTM(Beer,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: hover;
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            IncEx(Made,28);
            state := 1;
          end;
        end;
        if (makewhat = 'candle') then
        begin
          if FindDTM(Candle,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        if (makewhat = 'oil') then
        begin
          if FindDTM(oil,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
             repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        if (makewhat = 'vial') then
        begin
          if FindDTM(vial,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        if (makewhat = 'fishbowl') then
        begin
          if FindDTM(fishbowl,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        if (makewhat = 'orb') then
        begin
          if FindDTM(orb,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        if (makewhat = 'lanternlens') then
        begin
          if FindDTM(lanternlens,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        if (makewhat = 'lightorb') then
        begin
        if FindDTM(lightorb,x,y,MCx1,MCy1,MCx2,MCy2) then
          begin
            Mouse(x,y,3,3,true);
            wait(50+random(200));
            repeat
              wait(1000);
              case random(700) of
              0: HoverSkill(SKILL_CRAFTING,False);
              1: BoredHuman;
              2: RandomMovement;
              end;
            until (not FindDTM(Glass,x,y,MIx1,mIy1,mix2,miy2));
            made := made + 28;
            state := 1;
          end;
        end;
        writeln('banking');
      end;
    end;

    procedure SetupLogin;
    begin
      ClearDebug;
      Smart_Server := 87;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
    end;

    procedure Proggy;
    begin
      Sec := (1+((Getsystemtime-StartTime)/1000));
      MadeH := (3600 / SeC * (Made));


      writeLn('=======FleaGlassBlower======');
      writeLn('Time Running: ' + TimeRunning);
      writeLn('Items crafted: ' + IntToStr(Made));
      writeLn('Items/h: ' + IntToStr(MadeH));
      writeLn('XP gained: ' + ToStr(made * XPPerGlass));
      writeLn('XP/h: ' + IntToStr(Round(3600 / SeC * (made * XPPerGlass))));
      writeLn('=======================');
      MarkTime(ReportTime);
    end;
    Procedure Commit;
    begin
      xpg := (XP - lxp); //calculates xp gained since last commit
      stats_IncVariable('Crafting EXP (Gained)', Round(made * XPPerGlass));
      Stats_Commit;
      lxp := XP; //saves the variable for next time it needed to commit
      MarkTime(CommitTime);
    end;

    begin
      ClearDebug;
      SetupLogin;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      SetDTM;
      StartTime:=GetSystemTime;
      SetupSRLStats(804, SRLStats_User, SRLStats_Password);
      state :=1;
      made :=0;
      MarkTime(ReportTime);
      MarkTime(CommitTime);
      if LoggedIn then
        ClickNorth(SRL_ANGLE_HIGH);
      repeat                    
        Bank;
        wait(200+random(50));
        blowGlass;
        wait(100+random(200));
        if (TimeFromMark(CommitTime)>=30000) then
          Commit;
        if (TimeFromMark(reporttime)>=30000) then
          proggy;
      until(false);
      FreeeDTM;
    end.

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

    Default

    Are there any errors being printed in the debug box after committing?
    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.


  3. #3
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default

    nope no errors being printed at all

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

    Default

    Huh, could it be a firewall issue?
    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.


  5. #5
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I think the script has to have been running for like 5 minutes or something like that..?
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  6. #6
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Huh, could it be a firewall issue?
    Other scripts that I run have been committing fine so I don't think so.

    Quote Originally Posted by Sex View Post
    I think the script has to have been running for like 5 minutes or something like that..?
    I ran it for about 2 hours so that can't be the problem.

    ----------------

    Is there a minimum amount of time required to pass between each commit? Perhaps I was trying to commit too frequently so it was disallowing it.

  7. #7
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by the flea View Post
    Other scripts that I run have been committing fine so I don't think so.



    I ran it for about 2 hours so that can't be the problem.

    ----------------

    Is there a minimum amount of time required to pass between each commit? Perhaps I was trying to commit too frequently so it was disallowing it.
    Yes there is, not sure how long. How often were you trying to commit?
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  8. #8
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default

    I was using
    Code:
       if (TimeFromMark(CommitTime)>=30000) then
          Commit;
    when I get a chance to run the script again I will increase this number and see what happens

  9. #9
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by the flea View Post
    I was using
    Code:
       if (TimeFromMark(CommitTime)>=30000) then
          Commit;
    when I get a chance to run the script again I will increase this number and see what happens
    Yeah, that's every 30 seconds....try 5 minutes or more .
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  10. #10
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default

    just like to say that it was the script trying to commit to often, I updated it to only commit every 5 minutes and although I couldn't test it I put the updated version on my thread. Checked this morning and someone has ran it and it committed.

    Thank's for the help guys.

  11. #11
    Join Date
    Feb 2012
    Location
    California
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just spent about an hour troubleshooting my code to figure out why mine wasn't committing even though I also tried literally mimicking your script's layout. I figured out what it was. After a sufficient face palming, I entered the line

    Code:
    Stats_Commit;
    Into the bottom of my CommitStats procedure. Oh the joys of scripting. Thanks for the help in getting through it guys haha.


    EDIT:

    On the first commit, it goes through with no errors and the Writeln(); directly after shows up. Second commit and on its says:

    SRL_Stats: Wrong info for variable

    Any quick pointers before I have to try and submit only one variable at a time every 10 minutes?
    Last edited by drfreshtacular; 02-24-2012 at 02:38 AM.

  12. #12
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by drfreshtacular View Post
    Just spent about an hour troubleshooting my code to figure out why mine wasn't committing even though I also tried literally mimicking your script's layout. I figured out what it was. After a sufficient face palming, I entered the line

    Code:
    Stats_Commit;
    Into the bottom of my CommitStats procedure. Oh the joys of scripting. Thanks for the help in getting through it guys haha.


    EDIT:

    On the first commit, it goes through with no errors and the Writeln(); directly after shows up. Second commit and on its says:

    SRL_Stats: Wrong info for variable

    Any quick pointers before I have to try and submit only one variable at a time every 10 minutes?
    Let's see your code.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  13. #13
    Join Date
    Feb 2012
    Location
    California
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program ShiloGemtacular;
    {.DEFINE SMART}
    {.DEFINE SRL5}
    {.include srl/srl.simba}
    {.include sps/sps.simba}
    
    //  ------------------------------------------------------------------------ //
    //    _________.__    .__.__                                                 //
    //  /   _____/|  |__ |__|  |   ____     Shilo Gemtacular                     //
    //  \_____  \ |  |  \|  |  |  /  _ \                                         //
    //  /        \|   Y  \  |  |_(  <_> )                                        //
    //  /_______  /|___|  /__|____/\____/         A DrFreshtacular Script        //
    //          \/      \/                            (with help from masterBB)  //
    //    ________                __                      .__                    //
    //   /  _____/  ____   ______/  |______    ____  __ __|  | _____ _______     //
    //  /   \  ____/ __ \ /     \   __\__  \ _/ ___\|  |  \  | \__  \\_  __ \    //
    //  \    \_\  \  ___/|  Y Y  \  |  / __ \\  \___|  |  /  |__/ __ \|  | \/    //
    //   \______  /\___  >__|_|  /__| (____  /\___  >____/|____(____  /__|       //
    //          \/     \/      \/          \/     \/                \/           //
    //                                                                           //
    //   Version: 1.2                                                            //
    // ------------------------------------------------------------------------- //
    //                                                                           //
    //                           ENTER PREFERENCES BELOW                         //
    //                                                                           //
    
    const
      Trips = 10; // How many trips would you like to make before logging out?
      LampXp = 'Prayer'; // What skill should XP lamps default to?
      LevelOfAntiBan = 3; // (1 being a ton of antiban, 5 being hardly any)
      MiniBreaks = 'Yes'; // Random 10-60 second breaks (Yes or No)
      SRLStats_Username = ''; // SRL Stats username
      SRLStats_Password = ''; // SRL Stats password
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name := ''; // Username
      Players[0].Pass := '' // Password
      Players[0].Nick := ''; // 3-4 lowercase letters from ingame username;
      Players[0].Active := True; // Set to true if you want to use Player 0
      Players[0].Pin := ''; // Bank Pin
    end;
    
    
    //--------------------------------------------------------------------------//
    //                                                                          //
    //       !!!                TOUCH NOTHING UNDER HERE          !!!           //
    //                   (unless you're Bart...you can touch me)                //
    //--------------------------------------------------------------------------//
    
    var
      xph, mineXp, lastMineXp, submitMineXp, profit, profith :Integer;
      bitmaps, gems, prices:Array of Integer;
      gemNames:Array of String;
    
    
    //--------------------------------------------------------------------------//
    // GetPrices     -     Grabs grand exchange prices from GlowBotting         //
    //                     by ID #. Also converts diamond value to a            //
    //                           rounded yet usable integer                     //
    //--------------------------------------------------------------------------//
    procedure GetPrices;
    var
      url, strPrice : String;
      i:Integer;
      ids:Array of Integer;
    begin
      ids := [1625,1627,1629,1623,1621,1619,1617];
      for i:=0 to high(ids) do
      begin
        url := 'http://glowbotting.x10.mx/GEPriceChecker.php?id='+IntToStr(ids[i]);
        strPrice := Trim(GetPage(url));
        strPrice := Replace(strPrice,'k','00');
        strPrice := Replace(strPrice,'.','');
        prices[i] := StrToInt(strPrice);
        Writeln(gemNames[i] + ': ' + IntToStr(prices[i]));
      end;
    end;
    
    
    
    //------------------------------------------------------------------------------//
    //  PerHourCalculations  - Uses standard hourly rate formulas on profit and xp  //
    //------------------------------------------------------------------------------//
    Procedure PerHourCalculations;
    Begin
      XPH := Round((MINEXP * 3600) / (GetTimeRunning / 1000));
      PROFITH := Round((PROFIT * 3600) / (GetTimeRunning / 1000));
    End;
    
    //--------------------------------------------------------------------------//
    // CalculateStats   -   Grabs the values for gems collected and             //
    //                      total profit to display in a report later           //
    //--------------------------------------------------------------------------//
    procedure CalculateStats;                //Bart: cleaned and added the arrays
    var
      i:Integer;
    begin
      profit := 0;
      for i := 0 to High(gems) do
        profit := profit + gems[i] * prices[i];
    
      mineXp := 65 * SumIntegerArray(gems);
      PerHourCalculations;
    end;
    
    //--------------------------------------------------------------------------//
    //  LoadBitmaps    -    Loads bitmaps for counting gems                     //
    //--------------------------------------------------------------------------//
    procedure LoadBitmaps;              //Bart: This wasn't a function!
    begin
      setLength(bitmaps,7);
      bitmaps[0]:= BitmapFromString(5, 5, 'meJwram5OKy2Nz80FooDY2KLmZiCa' +         //opal
                         'vWVLTm0tnAtEyUVFwQkJxa1tEBSenALhAhlpZeUJ+flALgALFSFV');
      bitmaps[1]:= BitmapFromString(5, 5, 'meJxLLspMLsqMzUmGoPzGUjg3IDYU' +         //jade
                         'yAWiGRsWZFUXwLlAlFSUEZwQXtRcAUHhKdFALgC0CR/j');
      bitmaps[2]:= BitmapFromString(5, 5, 'meJzzFKr3FKp3FSiHoGCRCXCuFV8a' +         //topaz
                          'kAtEhdKH/YQ74Fwg8hCsteHLCBGZBEH2/LlALgAy/xXM');
      bitmaps[3] := BitmapFromString(5, 5, 'meJzLF+JPEeCL5ecBogAe7nwhfiCa' +        //sapphire
                            'JiGaKcgP5wJRIj9vIC93kRA/BIXx8UC4QEaaAF8cWBYA+LAMzw==');
      bitmaps[4]:= BitmapFromString(5, 5, 'meJzjj+bhDYEiHg9O/mgEG4gE0vjE' +         //emerald
                            'eoT5E3nhXCDii+Th8eYCIsEMPiDi8eOGcAGjLAsH');
      bitmaps[5]:= BitmapFromString(5, 5, 'meJzjEQzj4vfl5HMDIg4eGx7BMCDi' +         //ruby
                         'Fy/hFgiEc3lAarw5eOx4hMIhiJPXCcIFMrj5/Tj5PYBcAIFuCh8=');
      bitmaps[6] := BitmapFromString(6, 6, 'meJyrrm6sRkVr127BFIGgqqp6CIJw' +        //diamond
                            'O7smABGmCEQQTQSIAHrXPBc=');
    end;
    
    
    //--------------------------------------------------------------------------//
    //  CountGems  -  Goes through each slot in the inventory and compares with //
    //                loaded bitmaps for each gem. Then logs each gem           //
    //--------------------------------------------------------------------------//
    procedure CountGems;
    var
      currentSlot : TBox;
      i, j, x, y : Integer;
    begin
      LoadBitMaps;
      For i := 1 to 28 Do
      Begin
        currentSlot := InvBox(i);
        for j := 0 to High(gems) do
          If FindBitmapToleranceIn(bitmaps[j], x, y, currentSlot.X1, currentSlot.Y1, currentSlot.X2, currentSlot.Y2, 15) then
            Inc(gems[j]);
      end;
      CalculateStats;
      for i := 0 to high(bitmaps) do
        FreeBitmap(bitmaps[i]);
    end;
    
    
    //--------------------------------------------------------------------------//
    //  SubmitStats     -    Submits stats to SRL Stats                         //
    //--------------------------------------------------------------------------//
    procedure SubmitStats;
    begin
      submitMineXP := (mineXp - lastMineXp);
      stats_IncVariable('Gems (Mined)', SumIntegerArray(gems));
      stats_IncVariable('Sapphires (Mined)', gems[3]);
      stats_IncVariable('Emeralds (Mined)', gems[4]);
      stats_IncVariable('Rubies (Mined)', gems[5]);
      stats_IncVariable('Diamond (Mined)', gems[6]);
      stats_IncVariable('Mining EXP (Gained)', submitMineXP);
      stats_IncVariable('Profit Gained', profit);
      Stats_Commit;
      lastMineXp := mineXp;
    end;
    
    //--------------------------------------------------------------------------//
    //  Searches for Random Events and sets the lamp skill value to your choice //
    //--------------------------------------------------------------------------//
    procedure AntiRandom;
    begin
      FindNormalRandoms;
      LampSkill := (LampXp);
      LevelUp;
    end;
    
    //--------------------------------------------------------------------------//
    //  Antiban    -     Extensive antiban procedures (calls antirandom)        //
    //--------------------------------------------------------------------------//
    procedure Antiban;
    begin
      case Random(75 * LevelOfAntiBan) of
        1: begin
            RandomRClick;
           end;
        2: begin
            HoverSkill('Mining', False);
           end;
        3: begin
            PickUpMouse;
           end;
        4: begin
            RandomMovement;
           end;
        5: begin
            BoredHuman;
           end;
        6: begin
            ExamineInv;
           end;
        7: begin
            HoverSkill('random', False);
           end;
      end;
      Writeln('[' + TimeRunning + '] Antiban Measures Taken');
      if (MiniBreaks = 'Yes') then
      Begin
      Case Random (750 * LevelOfAntiBan) Of
        1: begin
            Writeln('[' + TimeRunning + '] ~13 Second Mini Break');
            Wait(11111 + random(2000));
           end;
        2: begin
            Writeln('[' + TimeRunning + ']  20-30 Second Mini Break');
            Wait(21212 + random(8000));
           end;
        3: begin
            Writeln('[' + TimeRunning + '] 30-40 Second Mini Break');
            Wait(32323 + random(8000));
           end;
        4: begin
            Writeln('[' + TimeRunning + '] 45-50 Second Mini Break');
            Wait(43434 + random(8000));
           end;
        5: begin
            Writeln('[' + TimeRunning + '] 55-60 Second Mini Break');
            Wait(54545 + random(8000));
           end;
        end;
      end;
        AntiRandom;
    end;
    
    //--------------------------------------------------------------------------//
    //  WalkToGemMine  -   Basic SPS path from bank to the mine                 //
    //--------------------------------------------------------------------------//
    function WalkToGemMine:Boolean;
    Var
      myPath:TPointArray;
    begin
    SPS_Setup(RUNESCAPE_SURFACE, ['8_12','8_11','7_11']);
    myPath := [Point(3241, 4859), Point(3239, 4854), Point(3247, 4859),
    Point(3245, 4850), Point(3240, 4847), Point(3246, 4842), Point(3245, 4836),
    Point(3242, 4834), Point(3240, 4832), Point(3239, 4827), Point(3237, 4823),
    Point(3235, 4818), Point(3231, 4814), Point(3227, 4810), Point(3223, 4809),
    Point(3217, 4805), Point(3211, 4798), Point(3205, 4797), Point(3214, 4800),
    Point(3201, 4796), Point(3196, 4793), Point(3190, 4794), Point(3184, 4794),
    Point(3179, 4795), Point(3171, 4796), Point(3164, 4796), Point(3165, 4793),
    Point(3164, 4789), Point(3162, 4783), Point(3162, 4780), Point(3162, 4776),
    Point(3162, 4774), Point(3162, 4770), Point(3162, 4768), Point(3161, 4765),
    Point(3158, 4762), Point(3156, 4762), Point(3154, 4760), Point(3150, 4754),
    Point(3150, 4752), Point(3151, 4749), Point(3154, 4748), Point(3154, 4742),
    Point(3153, 4738), Point(3149, 4736), Point(3145, 4732), Point(3145, 4728),
    Point(3146, 4724), Point(3150, 4723), Point(3152, 4718), Point(3153, 4714),
    Point(3147, 4711), Point(3147, 4708), Point(3150, 4706), Point(3150, 4701),
    Point(3146, 4693), Point(3144, 4689), Point(3142, 4686), Point(3139, 4683),
    Point(3136, 4679), Point(3133, 4676), Point(3125, 4676), Point(3131, 4665),
    Point(3135, 4661), Point(3138, 4670), Point(3132, 4670), Point(3123, 4670),
    Point(3120, 4673), Point(3123, 4676)];
    SPS_WalkPath(myPath);
    end;
    
    //--------------------------------------------------------------------------//
    //   WalkToBank    -   Basic SPS path from the mine to bank                 //
    //--------------------------------------------------------------------------//
    function WalkToBank:boolean;
    Var
      myPath:TPointArray;
    begin
    Writeln('[' + TimeRunning + '] Walking to Bank');
    SPS_Setup(RUNESCAPE_SURFACE,['7_11','8_11','8_12']);
    myPath := [Point(3141, 4674), Point(3133, 4681), Point(3123, 4685),
    Point(3135, 4694), Point(3151, 4711), Point(3156, 4761), Point(3165, 4762),
    Point(3159, 4765), Point(3166, 4769), Point(3162, 4788), Point(3190, 4792),
    Point(3196, 4795), Point(3200, 4799), Point(3204, 4794), Point(3219, 4795),
    Point(3226, 4807), Point(3234, 4820), Point(3242, 4833), Point(3244, 4850),
    Point(3248, 4857)];
    SPS_WalkPath(myPath);
    end;
    
    
    //--------------------------------------------------------------------------//
    //  Mining    -    Checks to see if player is currently mining              //
    //--------------------------------------------------------------------------//
    Function Mining: Boolean;
    var
      PBox: TBox;
    begin
      PBox := IntToBox(245, 130, 285, 195);
      Result := (AveragePixelShift(PBox, 250, 500) > 550);
    end;
    
    
    //--------------------------------------------------------------------------//
    //  BankGems - Walks to the bank, searches for banker, enters PIN if needed //
    //             deposits all gems, Walks back to gem mine. Failsafes include //
    //             checking for pinscreen multiple times, checking to see if    //
    //             inventory is still full at the end and repeating if so.      //
    //                                MILDY BUGGY as of V0.1                    //
    //--------------------------------------------------------------------------//
    procedure BankGems;
    var
      x, y : Integer;
      foundBanker : boolean;
    begin
      Antiban;
      WalktoBank;
      repeat
      Writeln('[' + TimeRunning + '] Searching For Banker...');
      if FindObj(x, y, 'anker', 16445433, 30) or
      (PinScreen) then
      begin
        wait(500+random(200))
        if PinScreen then
        begin
          Writeln('[' + TimeRunning + '] Entering Pin.');
          InPin(Players[CurrentPlayer].Pin);
        end
        else
        Mouse(x, y, 2, 2, false);
        ChooseOption('ank Banker');
        Wait(800+random(500));
        foundBanker := true;
        Wait(800+random(200));
        DepositAll;
        Wait(600+random(300));
        CloseBank;
        if (InvFull) then
          BankGems;
        Writeln('[' + TimeRunning + '] Banking Complete.');
      end;
    
      wait(800+random(200));
      until foundBanker;
      Writeln('[' + TimeRunning + '] Walking to Gem Mine.');
      WalkToGemMine;
    end;
    
    
    //--------------------------------------------------------------------------//
    //  Report    -   Simple ASCII report to track progress                     //
    //--------------------------------------------------------------------------//
    procedure Report;
    var
      i:Integer;
    begin
      Writeln('|---------------------------------------------------------------|');
      Writeln('|  SHILO GEMTACULAR V1.2 REPORT  | (' + TimeRunning + ') |');
      Writeln('|---------------------------------------------------------------|');
      Writeln('|  Mining XP  |  Mining XP/Hour  |  Total Profit  |  Gold/Hour  |');
      Writeln('|---------------------------------------------------------------|');
      Writeln('|   ' + IntToStr(mineXP) + '           ' + IntToStr(xph) + '              ' + IntToStr(profit) + '            ' + IntToStr(profith) + '    |');
      Writeln('|---------------------------------------------------------------| ');
      Writeln('|         Gem            |     Amount        |       Profit     |');
      Writeln('|---------------------------------------------------------------| ');
      for i := 0 to High(gems) do
      begin
        Writeln('|   ' + gemNames[i] + '                  ' + IntToStr(gems[i]) + '           ' + IntToStr(gems[i] * prices[i]));
      end;
      Writeln('|---------------------------------------------------------------| ');
      SubmitStats;
      Writeln('Stats were commited!');
    end;
    
    
    function SearchAndMineGems:Boolean;
    var
      x, y, i : integer;
    begin
      if (i = 10) then
      begin
        Writeln('i = 10');
        MakeCompass(-180 + random(360));
        i:=0;
      end else
      if (FindObj(x, y, 'ine', 13578450, 50)) or (FindObj(x, y, 'ine', 6364771, 50)) then
      begin
        Mouse(x, y, 6, 6, false);
        Writeln('[' + TimeRunning + '] Mining gem.');
        ChooseOption('ine');
      end else
      i := i + 1;
    
    end;
    
    
    //--------------------------------------------------------------------------//
    //  MineGems - If inventory isnt full, and not currently mining, searches   //
    //             for gems, mines them using left and right clicks randomly    //
    //--------------------------------------------------------------------------//
    procedure MineGems;
    begin
      if not (InvFull) then
      begin
        WalkToGemMine;
        Writeln('[' + TimeRunning + '] Arrived at mine. Searching for gems.');
        repeat;
        Antiban;
        SubmitStats;
        while (Mining) do
        begin
          Wait(50);
        end;
        SearchAndMineGems;
        Wait(500+random(200));
        until(InvFull);
        CountGems;
        Report;
        BankGems;
      end;
    end;
    
    
    //--------------------------------------------------------------------------//
    //  Loop    -                      Main loop of the script                  //
    //--------------------------------------------------------------------------//
    procedure Loop;
    var
      i : Integer;
    begin
      for i := 0 to Trips do
      begin
        AntiBan;
        if (InvFull) then
          BankGems
        else
          MineGems;
      end;
    end;
    
    
    //--------------------------------------------------------------------------//
    //  StartRunescape    -    Starts runescape with typical client settings    //
    //--------------------------------------------------------------------------//
    procedure StartRunescape;
    begin
      Smart_Server := 53;
      Smart_Members := False;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      MouseSpeed := 10;
      SetupSRLStats(789, SRLStats_Username, SRLStats_Password);
      ClearDebug;
      DeclarePlayers;
    
      setLength(prices,7);
      setLength(gems,7);
      gemNames := ['opal','jade','red topaz','sapphire','emerald','ruby','diamond'];
    end;
    
    begin
      StartRunescape;
      GetPrices;
      LoginPlayer;
      SetAngle(SRL_ANGLE_HIGH);
      Loop;
      CountGems;
      Report;
    end.

  14. #14
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by drfreshtacular View Post
    Code:
    program ShiloGemtacular;
    {.DEFINE SMART}
    {.DEFINE SRL5}
    {.include srl/srl.simba}
    {.include sps/sps.simba}
    
    //  ------------------------------------------------------------------------ //
    //    _________.__    .__.__                                                 //
    //  /   _____/|  |__ |__|  |   ____     Shilo Gemtacular                     //
    //  \_____  \ |  |  \|  |  |  /  _ \                                         //
    //  /        \|   Y  \  |  |_(  <_> )                                        //
    //  /_______  /|___|  /__|____/\____/         A DrFreshtacular Script        //
    //          \/      \/                            (with help from masterBB)  //
    //    ________                __                      .__                    //
    //   /  _____/  ____   ______/  |______    ____  __ __|  | _____ _______     //
    //  /   \  ____/ __ \ /     \   __\__  \ _/ ___\|  |  \  | \__  \\_  __ \    //
    //  \    \_\  \  ___/|  Y Y  \  |  / __ \\  \___|  |  /  |__/ __ \|  | \/    //
    //   \______  /\___  >__|_|  /__| (____  /\___  >____/|____(____  /__|       //
    //          \/     \/      \/          \/     \/                \/           //
    //                                                                           //
    //   Version: 1.2                                                            //
    // ------------------------------------------------------------------------- //
    //                                                                           //
    //                           ENTER PREFERENCES BELOW                         //
    //                                                                           //
    
    const
      Trips = 10; // How many trips would you like to make before logging out?
      LampXp = 'Prayer'; // What skill should XP lamps default to?
      LevelOfAntiBan = 3; // (1 being a ton of antiban, 5 being hardly any)
      MiniBreaks = 'Yes'; // Random 10-60 second breaks (Yes or No)
      SRLStats_Username = ''; // SRL Stats username
      SRLStats_Password = ''; // SRL Stats password
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name := ''; // Username
      Players[0].Pass := '' // Password
      Players[0].Nick := ''; // 3-4 lowercase letters from ingame username;
      Players[0].Active := True; // Set to true if you want to use Player 0
      Players[0].Pin := ''; // Bank Pin
    end;
    
    
    //--------------------------------------------------------------------------//
    //                                                                          //
    //       !!!                TOUCH NOTHING UNDER HERE          !!!           //
    //                   (unless you're Bart...you can touch me)                //
    //--------------------------------------------------------------------------//
    
    var
      xph, mineXp, lastMineXp, submitMineXp, profit, profith :Integer;
      bitmaps, gems, prices:Array of Integer;
      gemNames:Array of String;
    
    
    //--------------------------------------------------------------------------//
    // GetPrices     -     Grabs grand exchange prices from GlowBotting         //
    //                     by ID #. Also converts diamond value to a            //
    //                           rounded yet usable integer                     //
    //--------------------------------------------------------------------------//
    procedure GetPrices;
    var
      url, strPrice : String;
      i:Integer;
      ids:Array of Integer;
    begin
      ids := [1625,1627,1629,1623,1621,1619,1617];
      for i:=0 to high(ids) do
      begin
        url := 'http://glowbotting.x10.mx/GEPriceChecker.php?id='+IntToStr(ids[i]);
        strPrice := Trim(GetPage(url));
        strPrice := Replace(strPrice,'k','00');
        strPrice := Replace(strPrice,'.','');
        prices[i] := StrToInt(strPrice);
        Writeln(gemNames[i] + ': ' + IntToStr(prices[i]));
      end;
    end;
    
    
    
    //------------------------------------------------------------------------------//
    //  PerHourCalculations  - Uses standard hourly rate formulas on profit and xp  //
    //------------------------------------------------------------------------------//
    Procedure PerHourCalculations;
    Begin
      XPH := Round((MINEXP * 3600) / (GetTimeRunning / 1000));
      PROFITH := Round((PROFIT * 3600) / (GetTimeRunning / 1000));
    End;
    
    //--------------------------------------------------------------------------//
    // CalculateStats   -   Grabs the values for gems collected and             //
    //                      total profit to display in a report later           //
    //--------------------------------------------------------------------------//
    procedure CalculateStats;                //Bart: cleaned and added the arrays
    var
      i:Integer;
    begin
      profit := 0;
      for i := 0 to High(gems) do
        profit := profit + gems[i] * prices[i];
    
      mineXp := 65 * SumIntegerArray(gems);
      PerHourCalculations;
    end;
    
    //--------------------------------------------------------------------------//
    //  LoadBitmaps    -    Loads bitmaps for counting gems                     //
    //--------------------------------------------------------------------------//
    procedure LoadBitmaps;              //Bart: This wasn't a function!
    begin
      setLength(bitmaps,7);
      bitmaps[0]:= BitmapFromString(5, 5, 'meJwram5OKy2Nz80FooDY2KLmZiCa' +         //opal
                         'vWVLTm0tnAtEyUVFwQkJxa1tEBSenALhAhlpZeUJ+flALgALFSFV');
      bitmaps[1]:= BitmapFromString(5, 5, 'meJxLLspMLsqMzUmGoPzGUjg3IDYU' +         //jade
                         'yAWiGRsWZFUXwLlAlFSUEZwQXtRcAUHhKdFALgC0CR/j');
      bitmaps[2]:= BitmapFromString(5, 5, 'meJzzFKr3FKp3FSiHoGCRCXCuFV8a' +         //topaz
                          'kAtEhdKH/YQ74Fwg8hCsteHLCBGZBEH2/LlALgAy/xXM');
      bitmaps[3] := BitmapFromString(5, 5, 'meJzLF+JPEeCL5ecBogAe7nwhfiCa' +        //sapphire
                            'JiGaKcgP5wJRIj9vIC93kRA/BIXx8UC4QEaaAF8cWBYA+LAMzw==');
      bitmaps[4]:= BitmapFromString(5, 5, 'meJzjj+bhDYEiHg9O/mgEG4gE0vjE' +         //emerald
                            'eoT5E3nhXCDii+Th8eYCIsEMPiDi8eOGcAGjLAsH');
      bitmaps[5]:= BitmapFromString(5, 5, 'meJzjEQzj4vfl5HMDIg4eGx7BMCDi' +         //ruby
                         'Fy/hFgiEc3lAarw5eOx4hMIhiJPXCcIFMrj5/Tj5PYBcAIFuCh8=');
      bitmaps[6] := BitmapFromString(6, 6, 'meJyrrm6sRkVr127BFIGgqqp6CIJw' +        //diamond
                            'O7smABGmCEQQTQSIAHrXPBc=');
    end;
    
    
    //--------------------------------------------------------------------------//
    //  CountGems  -  Goes through each slot in the inventory and compares with //
    //                loaded bitmaps for each gem. Then logs each gem           //
    //--------------------------------------------------------------------------//
    procedure CountGems;
    var
      currentSlot : TBox;
      i, j, x, y : Integer;
    begin
      LoadBitMaps;
      For i := 1 to 28 Do
      Begin
        currentSlot := InvBox(i);
        for j := 0 to High(gems) do
          If FindBitmapToleranceIn(bitmaps[j], x, y, currentSlot.X1, currentSlot.Y1, currentSlot.X2, currentSlot.Y2, 15) then
            Inc(gems[j]);
      end;
      CalculateStats;
      for i := 0 to high(bitmaps) do
        FreeBitmap(bitmaps[i]);
    end;
    
    
    //--------------------------------------------------------------------------//
    //  SubmitStats     -    Submits stats to SRL Stats                         //
    //--------------------------------------------------------------------------//
    procedure SubmitStats;
    begin
      submitMineXP := (mineXp - lastMineXp);
      stats_IncVariable('Gems (Mined)', SumIntegerArray(gems));
      stats_IncVariable('Sapphires (Mined)', gems[3]);
      stats_IncVariable('Emeralds (Mined)', gems[4]);
      stats_IncVariable('Rubies (Mined)', gems[5]);
      stats_IncVariable('Diamond (Mined)', gems[6]);
      stats_IncVariable('Mining EXP (Gained)', submitMineXP);
      stats_IncVariable('Profit Gained', profit);
      Stats_Commit;
      lastMineXp := mineXp;
    end;
    
    //--------------------------------------------------------------------------//
    //  Searches for Random Events and sets the lamp skill value to your choice //
    //--------------------------------------------------------------------------//
    procedure AntiRandom;
    begin
      FindNormalRandoms;
      LampSkill := (LampXp);
      LevelUp;
    end;
    
    //--------------------------------------------------------------------------//
    //  Antiban    -     Extensive antiban procedures (calls antirandom)        //
    //--------------------------------------------------------------------------//
    procedure Antiban;
    begin
      case Random(75 * LevelOfAntiBan) of
        1: begin
            RandomRClick;
           end;
        2: begin
            HoverSkill('Mining', False);
           end;
        3: begin
            PickUpMouse;
           end;
        4: begin
            RandomMovement;
           end;
        5: begin
            BoredHuman;
           end;
        6: begin
            ExamineInv;
           end;
        7: begin
            HoverSkill('random', False);
           end;
      end;
      Writeln('[' + TimeRunning + '] Antiban Measures Taken');
      if (MiniBreaks = 'Yes') then
      Begin
      Case Random (750 * LevelOfAntiBan) Of
        1: begin
            Writeln('[' + TimeRunning + '] ~13 Second Mini Break');
            Wait(11111 + random(2000));
           end;
        2: begin
            Writeln('[' + TimeRunning + ']  20-30 Second Mini Break');
            Wait(21212 + random(8000));
           end;
        3: begin
            Writeln('[' + TimeRunning + '] 30-40 Second Mini Break');
            Wait(32323 + random(8000));
           end;
        4: begin
            Writeln('[' + TimeRunning + '] 45-50 Second Mini Break');
            Wait(43434 + random(8000));
           end;
        5: begin
            Writeln('[' + TimeRunning + '] 55-60 Second Mini Break');
            Wait(54545 + random(8000));
           end;
        end;
      end;
        AntiRandom;
    end;
    
    //--------------------------------------------------------------------------//
    //  WalkToGemMine  -   Basic SPS path from bank to the mine                 //
    //--------------------------------------------------------------------------//
    function WalkToGemMine:Boolean;
    Var
      myPath:TPointArray;
    begin
    SPS_Setup(RUNESCAPE_SURFACE, ['8_12','8_11','7_11']);
    myPath := [Point(3241, 4859), Point(3239, 4854), Point(3247, 4859),
    Point(3245, 4850), Point(3240, 4847), Point(3246, 4842), Point(3245, 4836),
    Point(3242, 4834), Point(3240, 4832), Point(3239, 4827), Point(3237, 4823),
    Point(3235, 4818), Point(3231, 4814), Point(3227, 4810), Point(3223, 4809),
    Point(3217, 4805), Point(3211, 4798), Point(3205, 4797), Point(3214, 4800),
    Point(3201, 4796), Point(3196, 4793), Point(3190, 4794), Point(3184, 4794),
    Point(3179, 4795), Point(3171, 4796), Point(3164, 4796), Point(3165, 4793),
    Point(3164, 4789), Point(3162, 4783), Point(3162, 4780), Point(3162, 4776),
    Point(3162, 4774), Point(3162, 4770), Point(3162, 4768), Point(3161, 4765),
    Point(3158, 4762), Point(3156, 4762), Point(3154, 4760), Point(3150, 4754),
    Point(3150, 4752), Point(3151, 4749), Point(3154, 4748), Point(3154, 4742),
    Point(3153, 4738), Point(3149, 4736), Point(3145, 4732), Point(3145, 4728),
    Point(3146, 4724), Point(3150, 4723), Point(3152, 4718), Point(3153, 4714),
    Point(3147, 4711), Point(3147, 4708), Point(3150, 4706), Point(3150, 4701),
    Point(3146, 4693), Point(3144, 4689), Point(3142, 4686), Point(3139, 4683),
    Point(3136, 4679), Point(3133, 4676), Point(3125, 4676), Point(3131, 4665),
    Point(3135, 4661), Point(3138, 4670), Point(3132, 4670), Point(3123, 4670),
    Point(3120, 4673), Point(3123, 4676)];
    SPS_WalkPath(myPath);
    end;
    
    //--------------------------------------------------------------------------//
    //   WalkToBank    -   Basic SPS path from the mine to bank                 //
    //--------------------------------------------------------------------------//
    function WalkToBank:boolean;
    Var
      myPath:TPointArray;
    begin
    Writeln('[' + TimeRunning + '] Walking to Bank');
    SPS_Setup(RUNESCAPE_SURFACE,['7_11','8_11','8_12']);
    myPath := [Point(3141, 4674), Point(3133, 4681), Point(3123, 4685),
    Point(3135, 4694), Point(3151, 4711), Point(3156, 4761), Point(3165, 4762),
    Point(3159, 4765), Point(3166, 4769), Point(3162, 4788), Point(3190, 4792),
    Point(3196, 4795), Point(3200, 4799), Point(3204, 4794), Point(3219, 4795),
    Point(3226, 4807), Point(3234, 4820), Point(3242, 4833), Point(3244, 4850),
    Point(3248, 4857)];
    SPS_WalkPath(myPath);
    end;
    
    
    //--------------------------------------------------------------------------//
    //  Mining    -    Checks to see if player is currently mining              //
    //--------------------------------------------------------------------------//
    Function Mining: Boolean;
    var
      PBox: TBox;
    begin
      PBox := IntToBox(245, 130, 285, 195);
      Result := (AveragePixelShift(PBox, 250, 500) > 550);
    end;
    
    
    //--------------------------------------------------------------------------//
    //  BankGems - Walks to the bank, searches for banker, enters PIN if needed //
    //             deposits all gems, Walks back to gem mine. Failsafes include //
    //             checking for pinscreen multiple times, checking to see if    //
    //             inventory is still full at the end and repeating if so.      //
    //                                MILDY BUGGY as of V0.1                    //
    //--------------------------------------------------------------------------//
    procedure BankGems;
    var
      x, y : Integer;
      foundBanker : boolean;
    begin
      Antiban;
      WalktoBank;
      repeat
      Writeln('[' + TimeRunning + '] Searching For Banker...');
      if FindObj(x, y, 'anker', 16445433, 30) or
      (PinScreen) then
      begin
        wait(500+random(200))
        if PinScreen then
        begin
          Writeln('[' + TimeRunning + '] Entering Pin.');
          InPin(Players[CurrentPlayer].Pin);
        end
        else
        Mouse(x, y, 2, 2, false);
        ChooseOption('ank Banker');
        Wait(800+random(500));
        foundBanker := true;
        Wait(800+random(200));
        DepositAll;
        Wait(600+random(300));
        CloseBank;
        if (InvFull) then
          BankGems;
        Writeln('[' + TimeRunning + '] Banking Complete.');
      end;
    
      wait(800+random(200));
      until foundBanker;
      Writeln('[' + TimeRunning + '] Walking to Gem Mine.');
      WalkToGemMine;
    end;
    
    
    //--------------------------------------------------------------------------//
    //  Report    -   Simple ASCII report to track progress                     //
    //--------------------------------------------------------------------------//
    procedure Report;
    var
      i:Integer;
    begin
      Writeln('|---------------------------------------------------------------|');
      Writeln('|  SHILO GEMTACULAR V1.2 REPORT  | (' + TimeRunning + ') |');
      Writeln('|---------------------------------------------------------------|');
      Writeln('|  Mining XP  |  Mining XP/Hour  |  Total Profit  |  Gold/Hour  |');
      Writeln('|---------------------------------------------------------------|');
      Writeln('|   ' + IntToStr(mineXP) + '           ' + IntToStr(xph) + '              ' + IntToStr(profit) + '            ' + IntToStr(profith) + '    |');
      Writeln('|---------------------------------------------------------------| ');
      Writeln('|         Gem            |     Amount        |       Profit     |');
      Writeln('|---------------------------------------------------------------| ');
      for i := 0 to High(gems) do
      begin
        Writeln('|   ' + gemNames[i] + '                  ' + IntToStr(gems[i]) + '           ' + IntToStr(gems[i] * prices[i]));
      end;
      Writeln('|---------------------------------------------------------------| ');
      SubmitStats;
      Writeln('Stats were commited!');
    end;
    
    
    function SearchAndMineGems:Boolean;
    var
      x, y, i : integer;
    begin
      if (i = 10) then
      begin
        Writeln('i = 10');
        MakeCompass(-180 + random(360));
        i:=0;
      end else
      if (FindObj(x, y, 'ine', 13578450, 50)) or (FindObj(x, y, 'ine', 6364771, 50)) then
      begin
        Mouse(x, y, 6, 6, false);
        Writeln('[' + TimeRunning + '] Mining gem.');
        ChooseOption('ine');
      end else
      i := i + 1;
    
    end;
    
    
    //--------------------------------------------------------------------------//
    //  MineGems - If inventory isnt full, and not currently mining, searches   //
    //             for gems, mines them using left and right clicks randomly    //
    //--------------------------------------------------------------------------//
    procedure MineGems;
    begin
      if not (InvFull) then
      begin
        WalkToGemMine;
        Writeln('[' + TimeRunning + '] Arrived at mine. Searching for gems.');
        repeat;
        Antiban;
        SubmitStats;
        while (Mining) do
        begin
          Wait(50);
        end;
        SearchAndMineGems;
        Wait(500+random(200));
        until(InvFull);
        CountGems;
        Report;
        BankGems;
      end;
    end;
    
    
    //--------------------------------------------------------------------------//
    //  Loop    -                      Main loop of the script                  //
    //--------------------------------------------------------------------------//
    procedure Loop;
    var
      i : Integer;
    begin
      for i := 0 to Trips do
      begin
        AntiBan;
        if (InvFull) then
          BankGems
        else
          MineGems;
      end;
    end;
    
    
    //--------------------------------------------------------------------------//
    //  StartRunescape    -    Starts runescape with typical client settings    //
    //--------------------------------------------------------------------------//
    procedure StartRunescape;
    begin
      Smart_Server := 53;
      Smart_Members := False;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      MouseSpeed := 10;
      SetupSRLStats(789, SRLStats_Username, SRLStats_Password);
      ClearDebug;
      DeclarePlayers;
    
      setLength(prices,7);
      setLength(gems,7);
      gemNames := ['opal','jade','red topaz','sapphire','emerald','ruby','diamond'];
    end;
    
    begin
      StartRunescape;
      GetPrices;
      LoginPlayer;
      SetAngle(SRL_ANGLE_HIGH);
      Loop;
      CountGems;
      Report;
    end.
    Have you added the variables to your script?
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  15. #15
    Join Date
    Feb 2012
    Location
    California
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes all of them. I added the variables on the site before i put them in my script.


    EDIT: Oh it worked! It just took almost an hour to show up on the site?
    EDIT2: Looks like it doesn't like using arrays to up the variable count though.
    Last edited by drfreshtacular; 02-24-2012 at 07:22 AM.

  16. #16
    Join Date
    Feb 2012
    Posts
    212
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I get the same sortv'e problem as drfreshtacular, any help would be appreciated, my script is in the prayer section to anybody who wants to take a look.... same error in debug console too.
    Previously known as sockz
    - Dwarven Stout buyer (F2P MONEYMAKER) http://villavu.com/forum/showthread....45#post1001045
    - G-Altar script, tons of failsafes. (Flawless for me) http://villavu.com/forum/showthread.php?t=79454

  17. #17
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Sockz View Post
    I get the same sortv'e problem as drfreshtacular, any help would be appreciated, my script is in the prayer section to anybody who wants to take a look.... same error in debug console too.
    http://villavu.com/forum/showthread....995#post848995 see this thread..

  18. #18
    Join Date
    Jan 2012
    Posts
    273
    Mentioned
    7 Post(s)
    Quoted
    6 Post(s)

    Default

    they are committing but i think stats aren't showing for any commit that uses variables - i already replied to the stats update script about it

    my script gets very large number of commits and sometime in last 1 1/2 days, the 95% of the commits from newer versions, that report variables, are not showing up
    Perfect script? There is no such thing as "perfect", only "better than you expect".

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
  •