Page 40 of 40 FirstFirst ... 30383940
Results 976 to 997 of 997

Thread: [SRL-6] AshamanHerblore

  1. #976
    Join Date
    Jan 2015
    Posts
    39
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Hello,

    I'm now a total of around 500 account hours using this as a unf potion maker. And there's two prominent fails that I have come across.

    The first seems to be when the click on the herb isn't registered and the vial of water is selected. The script will wait until it's ready to click on the Banker, but never will since the option becomes "Use Vial of Water on Banker" and the script breaks. Happens fairly often. Never seen "Use XXX Herb on Banker" so I wonder if I'm correct on how this really occurs.

    The second fail is when one of the antiban procedures occurs. When the script goes to look at the character levels, it will hover over different skills and the hover information will come up. However, there's a bug where the hover information stays even if you switch back to the backpack. The information covers the items and the script breaks.

    There's also a third fail that is worth mentioning but very rare. The script will send the character to another place in Edgeville. I don't know what causes this but likely there are some colors that make it click in weird places. I've caught the script clicking on certain green pets.


    If you could fix these and add a few failsafes, or even instruct me how do it myself, I think the script would be perfect.

  2. #977
    Join Date
    Jan 2015
    Posts
    39
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by recs7168 View Post
    If you could fix these and add a few failsafes, or even instruct me how do it myself, I think the script would be perfect.
    Hi, I added a failsafe for the two fails I mentioned above. Also, removed the update function since it's not working. I tried playing with the player form but I don't really understand how it works, if anyone could link me to some resources that'd be great

    Simba Code:
    program AshamanHerblore;
      {$DEFINE SMART}
      {$DEFINE FAILSAFE}
      {$I SRL-6/SRL.Simba}
      {$i srl-6/lib/misc/srlplayerform.simba}

    var
      itemCount, xp, slot, startingXP, itemsPH, xph, bir, bfr, stacks, stackCheck, slots: integer;
      itemType, typeEdit: string;
      timeout, currentBTime: TTimeMarker;
      W, X, Y, Z, realBTime, breakRounds, totalbreaks, antiB, mouseB, profit, totalProfit: integer;
      debug, normalBank: Boolean;
      newValues, oldValues: array [0..2] of integer;
      statsTimer: TTimeMarker;

    const
      SCRIPT_VERSION = '2.6';

    procedure declareplayers();
    var
      i,j: integer;
    begin
      players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager
      currentPlayer := 0;                                           // player to use first

      // set player attributes based on the settings from the form
      for i := 0 to high(players) do
        with players[i] do
        begin
          // convert the integers
          integers[0] := strToInt(playerForm.players[i].settings[1]);  //minutes until break
          integers[1] := strToInt(playerForm.players[i].settings[2]);  //minutes to break

          for j := 0 to high(playerForm.comboBoxItems[1]) do
            if (playerForm.players[i].settings[11] = playerForm.comboBoxItems[1][j]) then
              integers[2] := j;                                                  //bankinglocation

          Stacks := strToInt(playerForm.players[i].settings[4]);  //number of stacks
          World :=  strToInt(playerForm.players[i].settings[3]);                    //world
          ismember:=true;

          if (playerForm.players[i].settings[12] = 'Normal') then
            normalBank := true;

          if not normalBank then
            for j := 0 to high(playerForm.comboBoxItems[2]) do                            //quickload
              if (playerForm.players[i].settings[12] = playerForm.comboBoxItems[2][j]) then
                integers[4] := j+2;

          // booleans
          booleans[0] := strToBool(playerForm.players[i].settings[6]);   //takebreaks
          booleans[1] := strToBool(playerForm.players[i].settings[7]);   //switchworlds
          FindMod := strToBool(playerForm.players[i].settings[8]);      //mods
          debug := strToBool(playerForm.players[i].settings[9]);     //debug

          // any other data types you've decided to use
          strings[0] := playerForm.players[i].settings[0]; //quickkey
          strings[1] := playerForm.players[i].settings[10]; //cleanorpots

          if (not normalbank) and (strings[1] = 'Pots') then
            slots := 14 else
            slots := 28;

          if (playerForm.players[i].settings[5] = '') then
          begin
            writeln('No UserAgent detected. Opening up webpage to get userAgent');
            openWebPage('http://whatsmyuseragent.com/');
            writeln('Copy your useragent text and paste it into the form');
            writeln('Restart script');
            terminateScript;
          end else
            smartUserAgent := playerForm.players[i].settings[5]; //useragent

          print('slots: ' + toStr(slots));
        end;
    end;

    // initiates the SRL player form (you aren't restricted to the procedure name; it can be whatever you want)
    procedure initPlayerForm();
    begin
      with playerForm do
      begin
        name := 'AshamanHerblore v'+toStr(SCRIPT_VERSION); // the title of the SPF, usually the name of your script
        scriptHelpThread := '';           // a link to a help thread, if set to '' will link to my setup guide
        scriptSettingsPath := '';         // where you want the settings file to be saved; saved in script's path by default

        editBoxLabels := ['QuickKey', 'Minutes until break', '# of Minutes to break', 'World', '#ofStacks', 'Client UserAgent']; // edit boxes are created for each array element
        editBoxDefaults := [ '0', '600', '15','0', '1', ''];                                             // optional default values for each edit box; array length must equal editBoxLabel length
        editBoxHints := ['if cleaning herbs, which key do you have the herb set to in the action bar?',
        'How many minutes do you want to run the script before you break?',
        'How many minutes do you want to break for?',
        'Which world do you want to login to? 0 is random',
        'How many stacks of herbs do you want to mix?',
        'If you don''t know this, a popup will walk you through it after you hit start'];

        checkBoxLabels := ['Take breaks', 'Switch Worlds (After break)', 'Logout if Mod is near', 'Debug'];        // same as editBoxLabels but for check boxes
        checkBoxDefaults := ['True','True','True', 'False'];
        checkBoxHints := ['Do you want to take breaks?',
        'Do you want to switch worlds after you break?',
        'Do you want to logout if a jmod is detected near you?',
        'Do you want to run in debug mode? It prints out more debug and onscreen debug if there are issues'];

        comboBoxLabels := ['CleanOrPots','Location','QuickLoad'];                                                // same as editBoxLabels but for combo boxes (drop down boxes)
        comboBoxDefaults := ['Clean','NPC_BLUE','Normal'];
        comboBoxHints := ['Are you cleaning herbs or mixing pots?',
        'Which banking location are you using?',
        'Do you want to use the Preset buttons for banking? Select which one'];

        // this needs to be done for every element in the comboBoxLabels array
        setLength(comboBoxItems, length(comboBoxLabels));
        comboBoxItems[0] := ['Clean', 'Pots'];       // all the options available for the first combo box
        comboBoxItems[1] := ['NPC_BLUE', 'NPC_GREY', 'NPC_GREEN', 'NPC_DRAYNOR', 'BANK_BOOTH', 'CHEST_SW', 'CHEST_SHANTAY', 'CHEST_DUEL', 'CHEST_CW', 'CHEST_GROTTO', 'CHEST_LUMBRIDGE', 'TABLE_BURTHORPE', 'BANK_GE', 'PRIFDDINAS'];       // all the options available for the first combo box
        comboBoxItems[2] := ['Normal', 'PRESET_1', 'PRESET_2'];
      end;
    end;

    procedure debugSPFSettings();
    var
      i: integer;
    begin
      writeln('');
      writeln('Player file: ', playerForm.playerFile);

      for i := 0 to high(players) do
      begin
        writeln('QuickKey:          ', players[i].strings[0]);
        writeln('Minutes until break:            ', players[i].integers[0]);
        writeln('# of Minutes to break: ', players[i].integers[1]);
        writeln('Take breaks:        ', players[i].booleans[0]);
        writeln('Switch Worlds (After break):        ', players[i].booleans[1]);
        writeln('Logout if Mod is near:        ', players[i].findmod);
        writeln('CleanOrPots:        ', players[i].strings[1]);
        writeln('Location:        ', players[i].integers[2]);
        writeln('');
      end;
    end;

    {*******************************************************************************
    function AutoupdateMe;
    By: Shuttleu
    Edited By: Ashaman88
    Description: Autoupdates Script.
    *******************************************************************************}

    procedure autoUpdateMe;
    var
      Neifile: integer;
      OnlineVersion, NewScript, NeiFeilNennen: String;
    begin
        WriteLn('You have the latest version of the script!');
    end;

    procedure findNormalrandoms;
    begin
      exitTreasure();
      claimTicket();
    end;

    procedure antiban;
    var
      i: integer;
    begin
      i := random(600);
      case i of
        1: boredHuman(false);
        2..7:
          begin
            hoverSkill(Skill_Herblore);
            wait(gaussRangeInt(1000, 2000));
          end;
        8..50: mouseMovingObject;
        51..100: sleepAndMoveMouse(randomRange(100, mouseB));
        101..400:
          begin
            mouseOffClient(4);
            wait(randomRange(2000, mouseB));
          end;
        501..600: wait(randomRange(1000, 2000));

      end;
      wait(gaussRangeInt(0, antiB));
    end;

    { Calculated stats before sending to server by the Mayor}    // Removed since my server is expired ~TM 10/aug/15
    {
    procedure calculateStats();
    var
      i: integer;
        calcValues: Array [0..2] of integer;
    begin
      calcValues := [round(getTimeRunning() / 60000), ItemCount, XP];

        for i := 0 to high(NewValues) do
        begin
          newValues[i] := calcValues[i] - oldValues[i];
          oldValues[i] := calcValues[i];
        end;
    end;
    }

    { Sends stats to server by the Mayor}
    {
    function sendStats(): boolean;
    var
      c, i: integer;
        statvars: Array [0..2] of string;
    begin
      statvars := ['Time', 'Items', 'XP'];
      c := initializeHTTPClient(false);

        for i := 0 to high(statvars) do
          addPostvariable(c, statvars[i], intToStr(newValues[i]));

      result := pos('true', lowercase(postHTTPPageEx(c, 'http://srlmayor.com/mayorstats/asha/AshaStats.php'))) <> 0;
      freeHTTPClient(c);
      if result then
        calculateStats();
    end;
    }

    procedure progressReport;
    var
      ttb, profitPH: integer;
      method: String;
    begin
      clearDebug;

      ttb := (((W) + (Y) + breakRounds) - getTimeRunning);

      xp := (chatBox.getXPBar - startingXP);
      xph := round(xp * (3600.0 / (getTimeRunning / 1000.0)));

      totalProfit := (itemCount * profit);
      profitPH := round((totalProfit * (3600.0 / (getTimeRunning / 1000.0))));

      itemsPH := round((itemCount * (3600.0 / (getTimeRunning / 1000.0))));

      case players[currentPlayer].strings[1] of
        'Clean': method := 'Cleaned';
        'Pots':  method := 'Made';
      end;

      writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
      writeln('|                  AshamanHerblore v'+padR(toStr(SCRIPT_VERSION), 24), '|');
      writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
      writeln(padR('| Running For: '+ timeRunning, 60)+'|');
      writeln(padR('| '+ itemType + '''s ' + method + ': ' + groupDigits(itemCount, ','), 37) + padR(method + '/H: ' + groupDigits(itemsPH, ','), 23) + '|');
      writeln(padR('| Exp Earned: ' + groupDigits(xp, ','), 37) + padR('Exp/Hour: ' + groupDigits(xph, ','), 23) + '|');
      writeln(padR('| Profit: ' + groupDigits(profit,','), 37) + padR('Profit/Hour: ' + groupDigits(profitPH,','), 23) + '|');
      writeln('|___________________________________________________________|');

      disguise(itemType + '''s ' + method + ': ' + groupDigits(itemCount, ','));

      if players[currentPlayer].booleans[0] then
        writeln('Time until break: '+ msToTime(ttb, Time_Bare));
      {
      if statsTimer.getTime() > 300000 then
          if sendStats() then
              statsTimer.start() else
              writeLn('Failed to send stats');
      }

    end;

    function getProfit(herb, page: string): integer; // credit to euphemism
    var
      potString, potProfit: string;
      options: TReplaceFlags;
    begin
      options := [rfReplaceAll, rfIgnoreCase];
      potString := replace(herb, ' ', '_', options);
      potString := between('<a href="/wiki/' + potString + '"', '</tr>', getPage(page));

      potProfit := between('*', '<', potString);
      potProfit := replace(potProfit, ',', '', []);

      result := strToIntDef(potProfit, -1);
      writeln('Profit per ' + herb + ': '+toStr(result));
    end;

    function breakHandler(breakIn, breakFor, randbreakIn, randbreakFor: integer): Boolean;
    var
      H,M,S: integer;
    begin
      if not isLoggedIn then
        exit;

      if (getTimeRunning < ((W) + (Y) + breakRounds)) then
        exit Else
        if (getTimeRunning > ((W) + (Y) + breakRounds)) then
        begin
          RealBTime := Round((X+Z)/60000);
          writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
          players[currentPlayer].Logout;
          currentBTime.Reset;
          currentBTime.start;
          repeat
            wait(21000);
            ConvertTime((X+Z)-currentBTime.getTime,H,M,S);
            writeln('breaktime left: '+IntToStr(H)+':'+IntToStr(M)+':'+IntToStr(S));
          until(currentBTime.getTime>(X+Z));
          writeln('Logging in.');
          if players[currentPlayer].booleans[1] then
            players[currentPlayer].world := 0;
          players[currentPlayer].login;
          wait(4000);
          timeout.start;
          Result := isLoggedIn;
          minimap.setAngle(MM_DIRECTION_EAST);
          mainScreen.setAngle(MS_ANGLE_HIGH);
          IncEx(breakRounds, (W) + (X));
          Inc(Totalbreaks);
          writeln('The next break will occur in about ' + IntToStr(breakIn) + ' minutes.');
          W := (breakIn * 60000);
          X := (breakFor * 60000);
          Y := randomRange(-BIR * 60000, BIR * 60000);
          Z := randomRange(-BFR * 60000, BFR * 60000);
        end;
    end;

    function banking: boolean;
    var
      t: TTimeMarker;
      time: integer;
    begin
      if not isLoggedIn then
        exit;
      t.start;
      SRL_Events[EVENT_ANTIBAN] := nil;
      time := gaussRangeInt(15000, 24000);
      repeat
        wait(random(100));
        if bankscreen.open(players[currentPlayer].integers[2]) then
          break else
          begin
            minimap.setAngle(MM_DIRECTION_NORTH);
            mainScreen.setAngle(MS_ANGLE_HIGH);
          end;
        if (t.getTime > time) or (not isLoggedIn) then
          exit;
      until (bankScreen.isOpen);

      SRL_Events[EVENT_ANTIBAN] := @antiban;



      if normalBank then
        if bankScreen.GetPackCount > 0 then
          bankScreen.QuickDeposit(QUICK_DEPOSIT_INVENTORY);

      case players[currentPlayer].strings[1] of
        'Clean':
        begin
          t.start;
          time := gaussRangeInt(8000, 12000);
          repeat
            if normalBank then
            begin
              if bankScreen.withdraw(10, WITHDRAW_AMOUNT_ALL, ['']) then
                break;
            end else
              if bankScreen.clickButton(players[currentPlayer].integers[4]) then
                break;
            if (t.getTime > time) or (not isLoggedIn) then
              exit;
            wait(gaussRangeInt(0, 1500));
          until false;
        end;

        'Pots':
        begin
          t.start;
          time := gaussRangeInt(8000, 12000);
          repeat
            if normalBank then
            begin
              if bankScreen.withdraw(10, 14, ['']) then
                break;
            end else
              if bankScreen.clickButton(players[currentPlayer].integers[4]) then
                break;
            if (t.getTime > time) or (not isLoggedIn) then
              exit;
            wait(gaussRangeInt(0, 1500));
          until false;

          if normalBank then
          begin
            t.start;
            time := gaussRangeInt(8000, 12000);
            repeat
              if bankScreen.withdraw(9, 14, ['']) then
                break;
              if (t.getTime > time) Or (not isLoggedIn) then
                exit;
              wait(gaussRangeInt(0, 1500));
            until false;
          end;
        end;
      end;

      if normalBank then
        bankScreen.close else
      begin
        t.start;
        time := gaussRangeInt(4000, 8000);

        repeat
          if not bankScreen.__find() then
            break;
          if (t.getTime > time) Or (not isLoggedIn) then
            exit;
          wait(gaussRangeInt(0, 200));
        until false;
      end;

      if players[currentPlayer].strings[1] = 'Pots' then
      begin
        case random(10) of
          0..7: slot := 11;
          8..9: slot := 12;
        end;

        tabBackpack.mouseSlot(slot, MOUSE_MOVE);
      end;

      wait(gaussRangeInt(0, 100));

      t.start;
      repeat
        if (tabBackpack.isItemInSlot(slots)) then
          break;
        wait(gaussRangeInt(0, 100));
        if (t.getTime > 8000) then
        begin
          if (stacks > 1) And (stackCheck < stacks) then
          begin
            inc(stackCheck);
            exit;
          end;
          writeln('Failed withdrawing, shutting down - took a screenshot, send pic to ashaman (in the logs folder)');
          if debug then
            saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
          players[currentPlayer].logout;
          terminateScript;
        end;
        if not isLoggedIn then
          exit;
      until (tabBackpack.isItemInSlot(slots));


      if chatbox.findTextOnLines(['could not be'], [0]) then
        if countColorTolerance(66033, chatbox.lineBoxes[0], 10) > 100 then
        begin
          writeln('Failed withdrawing, shutting down - took a screenshot, send pic to ashaman (in the scripts folder)');
          if debug then
            saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
          players[currentPlayer].logout;
          terminateScript;
        end;

      if players[currentPlayer].strings[1] = 'Clean' then
        wait(gaussRangeInt(400, 800));

      result := true;
    end;

    function makeItems: boolean;
    var
      time,X,Y, i: integer;
      T: TTimeMarker;
    begin
      if not isLoggedIn then
        exit;

      case players[currentPlayer].strings[1] of
        'Clean':
          begin
            antiB := randomRange(0, 500);
            mouseB := randomRange(0, 3000);

            for i := 0 to 3 do
            begin
              wait(gaussRangeInt(0, 200));
              print('Sending quickkey to open menu');

              sendKeys(players[currentPlayer].strings[0], 60 + random(60), 60 + random(60));
              wait(gaussRangeInt(0, 100));

              print('waiting for production or tool menu');

              t.start;
              time := gaussRangeInt(4000, 7000);
              repeat
                wait(gaussRangeInt(0, 100));

                if t.getTime > time then
                  break;
              until productionscreen.isOpen or toolscreen.isOpen;

              if productionscreen.isOpen or toolscreen.isOpen then
                break;
            end;

            wait(gaussRangeInt(0, 200));

            if itemType = '' then
            begin
              itemType := productionScreen.getSelectedBoxText;
              itemType := copy(itemType, 7, length(itemType));
              typeEdit := toStr(itemType[1]);
              itemType := copy(itemType, 2, length(itemType));
              itemType := (uppercase(typeEdit) + itemType);
              itemType := trim(itemType);
              profit := getProfit(itemType, 'http://runescape.wikia.com/wiki/Calculator:Herblore/Herbs');
            end;

            print('HerbMenu is here');

            productionScreen.clickStart;

            print('waiting for StatusMenu');

            SRL_Events[EVENT_ANTIBAN] := nil;
            if not tabBackpack.waitSlotPixelChange(3, gaussRangeInt(10000, 20000)) then
            begin
              SRL_Events[EVENT_ANTIBAN] := @antiban;
              exit;
            end;

            SRL_Events[EVENT_ANTIBAN] := @antiban;

            wait(gaussRangeInt(0, 1500));

            timeout.start;

            if not tabBackpack.waitSlotPixelChange(28, gaussRangeInt(25000, 45000)) then
              exit;

            print('last slot changed');
            itemCount := itemCount + 28;
          end;
        'Pots':
          begin
            antiB := 3000;
            mouseB := 6000;

            getMousePOS(x, y);
            if slot = 0 then
              slot := 1;
            if not pointInBox(point(x, y), tabBackpack.getSlotBox(11)) and not pointInBox(point(x, y), tabBackpack.getSlotBox(12)) then
            begin
              case random(10) of
                0..7: slot := 11;
                8..9: slot := 12;
              end;
            end;
            tabBackpack.mouseSlot(slot, MOUSE_LEFT);
            wait(gaussRangeInt(0, 100));

            case random(10) of
              0..7: slot := 16;
              8..9: slot := 17;
            end;

            tabBackpack.mouseSlot(slot, MOUSE_LEFT);
            wait(gaussRangeInt(0, 200));

            t.start;
            time := gaussRangeInt(6000, 12000);
            repeat
              if productionScreen.isOpen then
                break;
              wait(gaussRangeInt(0, 500));
              if (not isLoggedIn) Or (t.getTime > time) then
                exit;
            until productionScreen.IsOpen;

            wait(gaussRangeInt(0, 400));

            if itemType = '' then
            begin
              itemType:= productionScreen.getSelectedBoxText;
              profit := getProfit(itemType, 'http://runescape.wikia.com/wiki/Calculator:Herblore/Unfinished_potions');
            end;

            productionScreen.clickStart;

            if not tabBackpack.waitForShift(randomRange(2000, 4000)) then
              exit;

            wait(gaussRangeInt(0, 1500));

            timeout.start;

            t.start;
            time := gaussRangeInt(25000, 45000);
            repeat
              wait(gaussRangeInt(0, 900));
              antiBan;
              if (not isLoggedIn) or (t.getTime > time) then
                exit;
            until not (tabBackpack.IsItemInSlot(28));

            itemCount := itemCount + 14;
          end;
        else
        begin
          writeln('CleanOrPots type wrong, shutting down');
          terminateScript;
        end;
      end;
      result := true;
    end;

    procedure setup;
    begin
      clearDebug;
      disableSRLLog := true;
      autoUpdateMe;

      initPlayerForm(); // initiate your settings
      runPlayerForm();  // run the form

      // use this so the script doesn't continue if the user exits out of the form
      if (not playerForm.isScriptReady) then
        terminatescript;

      declareplayers();

      smartShowConsole := false;

      if not debug then
        disableSRLDebug := true else
        disableSRLDebug := false;

      smartEnableDrawing := true;
      SRL_Events[EVENT_ANTIBAN] := @antiban;
      setupSRL;

      if not isLoggedIn then
      begin
        if not players[currentPlayer].login then
          terminateScript;

        writeln('Just loggedin, waiting a bit');
        wait(randomRange(6000, 10000));
      end;

      clearDebug;

      mainScreen.setAngle(MS_ANGLE_HIGH);
      findNormalrandoms;

      timeout.start;
      stackCheck := 1;

      bir := 13;      // ***random minutes to add/subtract from how long until we break***
      bfr := 7;       // ***random minutes to add/subjtract from break duraction***

      W := (players[currentPlayer].integers[0] * 60000);
      X := (players[currentPlayer].integers[1] * 60000);
      Y := randomRange(-BIR * 60000, BIR * 60000);
      Z := randomRange(-BFR * 60000, BFR * 60000);

      if conversationBox.continue(true, true) then
        wait(randomRange(3000, 2000));


      statsTimer.start();
      startingXP := chatBox.getXPBar;

      findNormalrandoms;

      print('slots: ' + toStr(slots));
    end;

    procedure mainloop;
    var
      i: integer;
    begin
      if not isLoggedIn then
      begin
        wait(5000);
        writeln('Attempting to log back in');
        disableSRLDebug := false;
        repeat
          try
            players[currentPlayer].login;
            inc(i);
          except
          end;
          if (i = 7) then
          begin
            i := 0;
            players.next(false);
          end;
        until isLoggedIn;

        disableSRLDebug := true;
        mainScreen.setAngle(MS_ANGLE_HIGH);
        minimap.setAngle(MM_DIRECTION_EAST);
      end;

      if banking then
      begin
        findNormalrandoms;
        if makeItems then
        begin
          progressReport;
          findNormalrandoms;
        end;
      end;

      if timeout.getTime > 200000 then
      begin
        writeln('Problem Occurred, Relogging');
        players[currentPlayer].Logout;

      end;

      if timeout.getTime > 300000 then
      begin
        writeln('nothing has happened for too long, shutting down!- took a screenshot, send pic to ashaman (in the logs folder)');
        if debug then
          saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
        terminateScript;
      end;

      if players[currentPlayer].Booleans[0] then
        breakHandler(players[currentPlayer].integers[0], players[currentPlayer].integers[1], bir, bfr);
    end;

    begin
      setup;
      while (players.getActive() > 0) do
        mainloop;
    end.

  3. #978
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by recs7168 View Post
    I tried playing with the player form but I don't really understand how it works, if anyone could link me to some resources that'd be great
    https://villavu.com/forum/showthread.php?t=107572

  4. #979
    Join Date
    Apr 2014
    Posts
    96
    Mentioned
    1 Post(s)
    Quoted
    35 Post(s)

    Default

    Got this error. Any help?

    Checking for script updates...
    Online Version: <!DOCTYPE html>
    <html lang=en>
    <meta charset=utf-8>
    <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
    <title>Error 404 (Not Found)!!1</title>
    <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px }body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
    </style>
    <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
    <p><b>404.</b> <ins>That’s an error.</ins>
    <p>The requested URL <code>/git/Version.txt</code> was not found on this server. <ins>That’s all we know.</ins>

    Successfully executed.

    Edit: Changed size

  5. #980
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by madmaxman3 View Post
    Got this error. Any help?
    ...
    Source code might be taken down, try uncommenting the updater at line 686
    Simba Code:
    //autoUpdateMe; //if you're new to scripting

    Creds to DannyRS for this wonderful sig!

  6. #981
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Google code was shutdown and everything on it was mirrored to github so the auto updater is broken.
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  7. #982
    Join Date
    May 2012
    Location
    Lithuania-Italy
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    Google code was shutdown and everything on it was mirrored to github so the auto updater is broken.
    Is there any other way to fix it? Manually or so?

  8. #983
    Join Date
    Sep 2014
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I am also waiting for a fix. Somehow the script doesn't work.

  9. #984
    Join Date
    Jul 2012
    Posts
    33
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by recs7168 View Post
    Hi, I added a failsafe for the two fails I mentioned above. Also, removed the update function since it's not working. I tried playing with the player form but I don't really understand how it works, if anyone could link me to some resources that'd be great

    Simba Code:
    program AshamanHerblore;
      {$DEFINE SMART}
      {$DEFINE FAILSAFE}
      {$I SRL-6/SRL.Simba}
      {$i srl-6/lib/misc/srlplayerform.simba}

    var
      itemCount, xp, slot, startingXP, itemsPH, xph, bir, bfr, stacks, stackCheck, slots: integer;
      itemType, typeEdit: string;
      timeout, currentBTime: TTimeMarker;
      W, X, Y, Z, realBTime, breakRounds, totalbreaks, antiB, mouseB, profit, totalProfit: integer;
      debug, normalBank: Boolean;
      newValues, oldValues: array [0..2] of integer;
      statsTimer: TTimeMarker;

    const
      SCRIPT_VERSION = '2.6';

    procedure declareplayers();
    var
      i,j: integer;
    begin
      players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager
      currentPlayer := 0;                                           // player to use first

      // set player attributes based on the settings from the form
      for i := 0 to high(players) do
        with players[i] do
        begin
          // convert the integers
          integers[0] := strToInt(playerForm.players[i].settings[1]);  //minutes until break
          integers[1] := strToInt(playerForm.players[i].settings[2]);  //minutes to break

          for j := 0 to high(playerForm.comboBoxItems[1]) do
            if (playerForm.players[i].settings[11] = playerForm.comboBoxItems[1][j]) then
              integers[2] := j;                                                  //bankinglocation

          Stacks := strToInt(playerForm.players[i].settings[4]);  //number of stacks
          World :=  strToInt(playerForm.players[i].settings[3]);                    //world
          ismember:=true;

          if (playerForm.players[i].settings[12] = 'Normal') then
            normalBank := true;

          if not normalBank then
            for j := 0 to high(playerForm.comboBoxItems[2]) do                            //quickload
              if (playerForm.players[i].settings[12] = playerForm.comboBoxItems[2][j]) then
                integers[4] := j+2;

          // booleans
          booleans[0] := strToBool(playerForm.players[i].settings[6]);   //takebreaks
          booleans[1] := strToBool(playerForm.players[i].settings[7]);   //switchworlds
          FindMod := strToBool(playerForm.players[i].settings[8]);      //mods
          debug := strToBool(playerForm.players[i].settings[9]);     //debug

          // any other data types you've decided to use
          strings[0] := playerForm.players[i].settings[0]; //quickkey
          strings[1] := playerForm.players[i].settings[10]; //cleanorpots

          if (not normalbank) and (strings[1] = 'Pots') then
            slots := 14 else
            slots := 28;

          if (playerForm.players[i].settings[5] = '') then
          begin
            writeln('No UserAgent detected. Opening up webpage to get userAgent');
            openWebPage('http://whatsmyuseragent.com/');
            writeln('Copy your useragent text and paste it into the form');
            writeln('Restart script');
            terminateScript;
          end else
            smartUserAgent := playerForm.players[i].settings[5]; //useragent

          print('slots: ' + toStr(slots));
        end;
    end;

    // initiates the SRL player form (you aren't restricted to the procedure name; it can be whatever you want)
    procedure initPlayerForm();
    begin
      with playerForm do
      begin
        name := 'AshamanHerblore v'+toStr(SCRIPT_VERSION); // the title of the SPF, usually the name of your script
        scriptHelpThread := '';           // a link to a help thread, if set to '' will link to my setup guide
        scriptSettingsPath := '';         // where you want the settings file to be saved; saved in script's path by default

        editBoxLabels := ['QuickKey', 'Minutes until break', '# of Minutes to break', 'World', '#ofStacks', 'Client UserAgent']; // edit boxes are created for each array element
        editBoxDefaults := [ '0', '600', '15','0', '1', ''];                                             // optional default values for each edit box; array length must equal editBoxLabel length
        editBoxHints := ['if cleaning herbs, which key do you have the herb set to in the action bar?',
        'How many minutes do you want to run the script before you break?',
        'How many minutes do you want to break for?',
        'Which world do you want to login to? 0 is random',
        'How many stacks of herbs do you want to mix?',
        'If you don''t know this, a popup will walk you through it after you hit start'];

        checkBoxLabels := ['Take breaks', 'Switch Worlds (After break)', 'Logout if Mod is near', 'Debug'];        // same as editBoxLabels but for check boxes
        checkBoxDefaults := ['True','True','True', 'False'];
        checkBoxHints := ['Do you want to take breaks?',
        'Do you want to switch worlds after you break?',
        'Do you want to logout if a jmod is detected near you?',
        'Do you want to run in debug mode? It prints out more debug and onscreen debug if there are issues'];

        comboBoxLabels := ['CleanOrPots','Location','QuickLoad'];                                                // same as editBoxLabels but for combo boxes (drop down boxes)
        comboBoxDefaults := ['Clean','NPC_BLUE','Normal'];
        comboBoxHints := ['Are you cleaning herbs or mixing pots?',
        'Which banking location are you using?',
        'Do you want to use the Preset buttons for banking? Select which one'];

        // this needs to be done for every element in the comboBoxLabels array
        setLength(comboBoxItems, length(comboBoxLabels));
        comboBoxItems[0] := ['Clean', 'Pots'];       // all the options available for the first combo box
        comboBoxItems[1] := ['NPC_BLUE', 'NPC_GREY', 'NPC_GREEN', 'NPC_DRAYNOR', 'BANK_BOOTH', 'CHEST_SW', 'CHEST_SHANTAY', 'CHEST_DUEL', 'CHEST_CW', 'CHEST_GROTTO', 'CHEST_LUMBRIDGE', 'TABLE_BURTHORPE', 'BANK_GE', 'PRIFDDINAS'];       // all the options available for the first combo box
        comboBoxItems[2] := ['Normal', 'PRESET_1', 'PRESET_2'];
      end;
    end;

    procedure debugSPFSettings();
    var
      i: integer;
    begin
      writeln('');
      writeln('Player file: ', playerForm.playerFile);

      for i := 0 to high(players) do
      begin
        writeln('QuickKey:          ', players[i].strings[0]);
        writeln('Minutes until break:            ', players[i].integers[0]);
        writeln('# of Minutes to break: ', players[i].integers[1]);
        writeln('Take breaks:        ', players[i].booleans[0]);
        writeln('Switch Worlds (After break):        ', players[i].booleans[1]);
        writeln('Logout if Mod is near:        ', players[i].findmod);
        writeln('CleanOrPots:        ', players[i].strings[1]);
        writeln('Location:        ', players[i].integers[2]);
        writeln('');
      end;
    end;

    {*******************************************************************************
    function AutoupdateMe;
    By: Shuttleu
    Edited By: Ashaman88
    Description: Autoupdates Script.
    *******************************************************************************}

    procedure autoUpdateMe;
    var
      Neifile: integer;
      OnlineVersion, NewScript, NeiFeilNennen: String;
    begin
        WriteLn('You have the latest version of the script!');
    end;

    procedure findNormalrandoms;
    begin
      exitTreasure();
      claimTicket();
    end;

    procedure antiban;
    var
      i: integer;
    begin
      i := random(600);
      case i of
        1: boredHuman(false);
        2..7:
          begin
            hoverSkill(Skill_Herblore);
            wait(gaussRangeInt(1000, 2000));
          end;
        8..50: mouseMovingObject;
        51..100: sleepAndMoveMouse(randomRange(100, mouseB));
        101..400:
          begin
            mouseOffClient(4);
            wait(randomRange(2000, mouseB));
          end;
        501..600: wait(randomRange(1000, 2000));

      end;
      wait(gaussRangeInt(0, antiB));
    end;

    { Calculated stats before sending to server by the Mayor}    // Removed since my server is expired ~TM 10/aug/15
    {
    procedure calculateStats();
    var
      i: integer;
        calcValues: Array [0..2] of integer;
    begin
      calcValues := [round(getTimeRunning() / 60000), ItemCount, XP];

        for i := 0 to high(NewValues) do
        begin
          newValues[i] := calcValues[i] - oldValues[i];
          oldValues[i] := calcValues[i];
        end;
    end;
    }

    { Sends stats to server by the Mayor}
    {
    function sendStats(): boolean;
    var
      c, i: integer;
        statvars: Array [0..2] of string;
    begin
      statvars := ['Time', 'Items', 'XP'];
      c := initializeHTTPClient(false);

        for i := 0 to high(statvars) do
          addPostvariable(c, statvars[i], intToStr(newValues[i]));

      result := pos('true', lowercase(postHTTPPageEx(c, 'http://srlmayor.com/mayorstats/asha/AshaStats.php'))) <> 0;
      freeHTTPClient(c);
      if result then
        calculateStats();
    end;
    }

    procedure progressReport;
    var
      ttb, profitPH: integer;
      method: String;
    begin
      clearDebug;

      ttb := (((W) + (Y) + breakRounds) - getTimeRunning);

      xp := (chatBox.getXPBar - startingXP);
      xph := round(xp * (3600.0 / (getTimeRunning / 1000.0)));

      totalProfit := (itemCount * profit);
      profitPH := round((totalProfit * (3600.0 / (getTimeRunning / 1000.0))));

      itemsPH := round((itemCount * (3600.0 / (getTimeRunning / 1000.0))));

      case players[currentPlayer].strings[1] of
        'Clean': method := 'Cleaned';
        'Pots':  method := 'Made';
      end;

      writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
      writeln('|                  AshamanHerblore v'+padR(toStr(SCRIPT_VERSION), 24), '|');
      writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
      writeln(padR('| Running For: '+ timeRunning, 60)+'|');
      writeln(padR('| '+ itemType + '''s ' + method + ': ' + groupDigits(itemCount, ','), 37) + padR(method + '/H: ' + groupDigits(itemsPH, ','), 23) + '|');
      writeln(padR('| Exp Earned: ' + groupDigits(xp, ','), 37) + padR('Exp/Hour: ' + groupDigits(xph, ','), 23) + '|');
      writeln(padR('| Profit: ' + groupDigits(profit,','), 37) + padR('Profit/Hour: ' + groupDigits(profitPH,','), 23) + '|');
      writeln('|___________________________________________________________|');

      disguise(itemType + '''s ' + method + ': ' + groupDigits(itemCount, ','));

      if players[currentPlayer].booleans[0] then
        writeln('Time until break: '+ msToTime(ttb, Time_Bare));
      {
      if statsTimer.getTime() > 300000 then
          if sendStats() then
              statsTimer.start() else
              writeLn('Failed to send stats');
      }

    end;

    function getProfit(herb, page: string): integer; // credit to euphemism
    var
      potString, potProfit: string;
      options: TReplaceFlags;
    begin
      options := [rfReplaceAll, rfIgnoreCase];
      potString := replace(herb, ' ', '_', options);
      potString := between('<a href="/wiki/' + potString + '"', '</tr>', getPage(page));

      potProfit := between('*', '<', potString);
      potProfit := replace(potProfit, ',', '', []);

      result := strToIntDef(potProfit, -1);
      writeln('Profit per ' + herb + ': '+toStr(result));
    end;

    function breakHandler(breakIn, breakFor, randbreakIn, randbreakFor: integer): Boolean;
    var
      H,M,S: integer;
    begin
      if not isLoggedIn then
        exit;

      if (getTimeRunning < ((W) + (Y) + breakRounds)) then
        exit Else
        if (getTimeRunning > ((W) + (Y) + breakRounds)) then
        begin
          RealBTime := Round((X+Z)/60000);
          writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
          players[currentPlayer].Logout;
          currentBTime.Reset;
          currentBTime.start;
          repeat
            wait(21000);
            ConvertTime((X+Z)-currentBTime.getTime,H,M,S);
            writeln('breaktime left: '+IntToStr(H)+':'+IntToStr(M)+':'+IntToStr(S));
          until(currentBTime.getTime>(X+Z));
          writeln('Logging in.');
          if players[currentPlayer].booleans[1] then
            players[currentPlayer].world := 0;
          players[currentPlayer].login;
          wait(4000);
          timeout.start;
          Result := isLoggedIn;
          minimap.setAngle(MM_DIRECTION_EAST);
          mainScreen.setAngle(MS_ANGLE_HIGH);
          IncEx(breakRounds, (W) + (X));
          Inc(Totalbreaks);
          writeln('The next break will occur in about ' + IntToStr(breakIn) + ' minutes.');
          W := (breakIn * 60000);
          X := (breakFor * 60000);
          Y := randomRange(-BIR * 60000, BIR * 60000);
          Z := randomRange(-BFR * 60000, BFR * 60000);
        end;
    end;

    function banking: boolean;
    var
      t: TTimeMarker;
      time: integer;
    begin
      if not isLoggedIn then
        exit;
      t.start;
      SRL_Events[EVENT_ANTIBAN] := nil;
      time := gaussRangeInt(15000, 24000);
      repeat
        wait(random(100));
        if bankscreen.open(players[currentPlayer].integers[2]) then
          break else
          begin
            minimap.setAngle(MM_DIRECTION_NORTH);
            mainScreen.setAngle(MS_ANGLE_HIGH);
          end;
        if (t.getTime > time) or (not isLoggedIn) then
          exit;
      until (bankScreen.isOpen);

      SRL_Events[EVENT_ANTIBAN] := @antiban;



      if normalBank then
        if bankScreen.GetPackCount > 0 then
          bankScreen.QuickDeposit(QUICK_DEPOSIT_INVENTORY);

      case players[currentPlayer].strings[1] of
        'Clean':
        begin
          t.start;
          time := gaussRangeInt(8000, 12000);
          repeat
            if normalBank then
            begin
              if bankScreen.withdraw(10, WITHDRAW_AMOUNT_ALL, ['']) then
                break;
            end else
              if bankScreen.clickButton(players[currentPlayer].integers[4]) then
                break;
            if (t.getTime > time) or (not isLoggedIn) then
              exit;
            wait(gaussRangeInt(0, 1500));
          until false;
        end;

        'Pots':
        begin
          t.start;
          time := gaussRangeInt(8000, 12000);
          repeat
            if normalBank then
            begin
              if bankScreen.withdraw(10, 14, ['']) then
                break;
            end else
              if bankScreen.clickButton(players[currentPlayer].integers[4]) then
                break;
            if (t.getTime > time) or (not isLoggedIn) then
              exit;
            wait(gaussRangeInt(0, 1500));
          until false;

          if normalBank then
          begin
            t.start;
            time := gaussRangeInt(8000, 12000);
            repeat
              if bankScreen.withdraw(9, 14, ['']) then
                break;
              if (t.getTime > time) Or (not isLoggedIn) then
                exit;
              wait(gaussRangeInt(0, 1500));
            until false;
          end;
        end;
      end;

      if normalBank then
        bankScreen.close else
      begin
        t.start;
        time := gaussRangeInt(4000, 8000);

        repeat
          if not bankScreen.__find() then
            break;
          if (t.getTime > time) Or (not isLoggedIn) then
            exit;
          wait(gaussRangeInt(0, 200));
        until false;
      end;

      if players[currentPlayer].strings[1] = 'Pots' then
      begin
        case random(10) of
          0..7: slot := 11;
          8..9: slot := 12;
        end;

        tabBackpack.mouseSlot(slot, MOUSE_MOVE);
      end;

      wait(gaussRangeInt(0, 100));

      t.start;
      repeat
        if (tabBackpack.isItemInSlot(slots)) then
          break;
        wait(gaussRangeInt(0, 100));
        if (t.getTime > 8000) then
        begin
          if (stacks > 1) And (stackCheck < stacks) then
          begin
            inc(stackCheck);
            exit;
          end;
          writeln('Failed withdrawing, shutting down - took a screenshot, send pic to ashaman (in the logs folder)');
          if debug then
            saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
          players[currentPlayer].logout;
          terminateScript;
        end;
        if not isLoggedIn then
          exit;
      until (tabBackpack.isItemInSlot(slots));


      if chatbox.findTextOnLines(['could not be'], [0]) then
        if countColorTolerance(66033, chatbox.lineBoxes[0], 10) > 100 then
        begin
          writeln('Failed withdrawing, shutting down - took a screenshot, send pic to ashaman (in the scripts folder)');
          if debug then
            saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
          players[currentPlayer].logout;
          terminateScript;
        end;

      if players[currentPlayer].strings[1] = 'Clean' then
        wait(gaussRangeInt(400, 800));

      result := true;
    end;

    function makeItems: boolean;
    var
      time,X,Y, i: integer;
      T: TTimeMarker;
    begin
      if not isLoggedIn then
        exit;

      case players[currentPlayer].strings[1] of
        'Clean':
          begin
            antiB := randomRange(0, 500);
            mouseB := randomRange(0, 3000);

            for i := 0 to 3 do
            begin
              wait(gaussRangeInt(0, 200));
              print('Sending quickkey to open menu');

              sendKeys(players[currentPlayer].strings[0], 60 + random(60), 60 + random(60));
              wait(gaussRangeInt(0, 100));

              print('waiting for production or tool menu');

              t.start;
              time := gaussRangeInt(4000, 7000);
              repeat
                wait(gaussRangeInt(0, 100));

                if t.getTime > time then
                  break;
              until productionscreen.isOpen or toolscreen.isOpen;

              if productionscreen.isOpen or toolscreen.isOpen then
                break;
            end;

            wait(gaussRangeInt(0, 200));

            if itemType = '' then
            begin
              itemType := productionScreen.getSelectedBoxText;
              itemType := copy(itemType, 7, length(itemType));
              typeEdit := toStr(itemType[1]);
              itemType := copy(itemType, 2, length(itemType));
              itemType := (uppercase(typeEdit) + itemType);
              itemType := trim(itemType);
              profit := getProfit(itemType, 'http://runescape.wikia.com/wiki/Calculator:Herblore/Herbs');
            end;

            print('HerbMenu is here');

            productionScreen.clickStart;

            print('waiting for StatusMenu');

            SRL_Events[EVENT_ANTIBAN] := nil;
            if not tabBackpack.waitSlotPixelChange(3, gaussRangeInt(10000, 20000)) then
            begin
              SRL_Events[EVENT_ANTIBAN] := @antiban;
              exit;
            end;

            SRL_Events[EVENT_ANTIBAN] := @antiban;

            wait(gaussRangeInt(0, 1500));

            timeout.start;

            if not tabBackpack.waitSlotPixelChange(28, gaussRangeInt(25000, 45000)) then
              exit;

            print('last slot changed');
            itemCount := itemCount + 28;
          end;
        'Pots':
          begin
            antiB := 3000;
            mouseB := 6000;

            getMousePOS(x, y);
            if slot = 0 then
              slot := 1;
            if not pointInBox(point(x, y), tabBackpack.getSlotBox(11)) and not pointInBox(point(x, y), tabBackpack.getSlotBox(12)) then
            begin
              case random(10) of
                0..7: slot := 11;
                8..9: slot := 12;
              end;
            end;
            tabBackpack.mouseSlot(slot, MOUSE_LEFT);
            wait(gaussRangeInt(0, 100));

            case random(10) of
              0..7: slot := 16;
              8..9: slot := 17;
            end;

            tabBackpack.mouseSlot(slot, MOUSE_LEFT);
            wait(gaussRangeInt(0, 200));

            t.start;
            time := gaussRangeInt(6000, 12000);
            repeat
              if productionScreen.isOpen then
                break;
              wait(gaussRangeInt(0, 500));
              if (not isLoggedIn) Or (t.getTime > time) then
                exit;
            until productionScreen.IsOpen;

            wait(gaussRangeInt(0, 400));

            if itemType = '' then
            begin
              itemType:= productionScreen.getSelectedBoxText;
              profit := getProfit(itemType, 'http://runescape.wikia.com/wiki/Calculator:Herblore/Unfinished_potions');
            end;

            productionScreen.clickStart;

            if not tabBackpack.waitForShift(randomRange(2000, 4000)) then
              exit;

            wait(gaussRangeInt(0, 1500));

            timeout.start;

            t.start;
            time := gaussRangeInt(25000, 45000);
            repeat
              wait(gaussRangeInt(0, 900));
              antiBan;
              if (not isLoggedIn) or (t.getTime > time) then
                exit;
            until not (tabBackpack.IsItemInSlot(28));

            itemCount := itemCount + 14;
          end;
        else
        begin
          writeln('CleanOrPots type wrong, shutting down');
          terminateScript;
        end;
      end;
      result := true;
    end;

    procedure setup;
    begin
      clearDebug;
      disableSRLLog := true;
      autoUpdateMe;

      initPlayerForm(); // initiate your settings
      runPlayerForm();  // run the form

      // use this so the script doesn't continue if the user exits out of the form
      if (not playerForm.isScriptReady) then
        terminatescript;

      declareplayers();

      smartShowConsole := false;

      if not debug then
        disableSRLDebug := true else
        disableSRLDebug := false;

      smartEnableDrawing := true;
      SRL_Events[EVENT_ANTIBAN] := @antiban;
      setupSRL;

      if not isLoggedIn then
      begin
        if not players[currentPlayer].login then
          terminateScript;

        writeln('Just loggedin, waiting a bit');
        wait(randomRange(6000, 10000));
      end;

      clearDebug;

      mainScreen.setAngle(MS_ANGLE_HIGH);
      findNormalrandoms;

      timeout.start;
      stackCheck := 1;

      bir := 13;      // ***random minutes to add/subtract from how long until we break***
      bfr := 7;       // ***random minutes to add/subjtract from break duraction***

      W := (players[currentPlayer].integers[0] * 60000);
      X := (players[currentPlayer].integers[1] * 60000);
      Y := randomRange(-BIR * 60000, BIR * 60000);
      Z := randomRange(-BFR * 60000, BFR * 60000);

      if conversationBox.continue(true, true) then
        wait(randomRange(3000, 2000));


      statsTimer.start();
      startingXP := chatBox.getXPBar;

      findNormalrandoms;

      print('slots: ' + toStr(slots));
    end;

    procedure mainloop;
    var
      i: integer;
    begin
      if not isLoggedIn then
      begin
        wait(5000);
        writeln('Attempting to log back in');
        disableSRLDebug := false;
        repeat
          try
            players[currentPlayer].login;
            inc(i);
          except
          end;
          if (i = 7) then
          begin
            i := 0;
            players.next(false);
          end;
        until isLoggedIn;

        disableSRLDebug := true;
        mainScreen.setAngle(MS_ANGLE_HIGH);
        minimap.setAngle(MM_DIRECTION_EAST);
      end;

      if banking then
      begin
        findNormalrandoms;
        if makeItems then
        begin
          progressReport;
          findNormalrandoms;
        end;
      end;

      if timeout.getTime > 200000 then
      begin
        writeln('Problem Occurred, Relogging');
        players[currentPlayer].Logout;

      end;

      if timeout.getTime > 300000 then
      begin
        writeln('nothing has happened for too long, shutting down!- took a screenshot, send pic to ashaman (in the logs folder)');
        if debug then
          saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
        terminateScript;
      end;

      if players[currentPlayer].Booleans[0] then
        breakHandler(players[currentPlayer].integers[0], players[currentPlayer].integers[1], bir, bfr);
    end;

    begin
      setup;
      while (players.getActive() > 0) do
        mainloop;
    end.
    Nice work, I'll give it a go later!

  10. #985
    Join Date
    Sep 2014
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Get this error:

    -- TRSBankscreen.__open()
    -- TRSBankScreen.__open(): Didn't find enough bank color 0

    Any ideas?

  11. #986
    Join Date
    Jul 2007
    Posts
    83
    Mentioned
    1 Post(s)
    Quoted
    39 Post(s)

    Default

    Opens up bank but fails when to quickload preset, so it stays on bank screen doing nothing.

    Other scripts seem to be doing the same thing. Fails to click the preset button.
    Last edited by scar_operater; 12-04-2016 at 07:21 AM.

  12. #987
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    269
    Mentioned
    2 Post(s)
    Quoted
    141 Post(s)

    Default

    Quote Originally Posted by scar_operater View Post
    Opens up bank but fails when to quickload preset, so it stays on bank screen doing nothing.

    Other scripts seem to be doing the same thing. Fails to click the preset button.
    When I have had this problem it is because the "subscribe" button is in the way. If you are a member then that wouldn't be the issue. But, if you are experiencing issues with multiple scripts then I would guess it's your layout. The scripts aren't recognizing your bank screen. I would reset you layout as if it's a new account, just to make sure the bank screen is correct.

    If any of that makes sense?

  13. #988
    Join Date
    Jul 2007
    Posts
    83
    Mentioned
    1 Post(s)
    Quoted
    39 Post(s)

    Default

    Quote Originally Posted by IROC-Z View Post
    When I have had this problem it is because the "subscribe" button is in the way. If you are a member then that wouldn't be the issue. But, if you are experiencing issues with multiple scripts then I would guess it's your layout. The scripts aren't recognizing your bank screen. I would reset you layout as if it's a new account, just to make sure the bank screen is correct.

    If any of that makes sense?
    I should've edited post I fiddled around with the subsribe button and pushed away from the bank screen

  14. #989
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    269
    Mentioned
    2 Post(s)
    Quoted
    141 Post(s)

    Default

    Quote Originally Posted by scar_operater View Post
    I should've edited post I fiddled around with the subsribe button and pushed away from the bank screen
    Sweet! Glad you got it working!

  15. #990
    Join Date
    Sep 2014
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Get this error:

    -- TRSBankscreen.__open()
    -- TRSBankScreen.__open(): Didn't find enough bank color 0

    Any ideas?

  16. #991
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    269
    Mentioned
    2 Post(s)
    Quoted
    141 Post(s)

    Default

    Quote Originally Posted by prof1crl View Post
    Get this error:

    -- TRSBankscreen.__open()
    -- TRSBankScreen.__open(): Didn't find enough bank color 0

    Any ideas?
    Double check you have your interface setup correctly. That is usually the best place to start. Even if you think it is correct starting over resetting it from the start sometimes changes things you didn't notice.

    Also, posting a screenie of where it gets stuck might help too.

  17. #992
    Join Date
    Mar 2014
    Location
    East Coast, USA
    Posts
    291
    Mentioned
    10 Post(s)
    Quoted
    148 Post(s)

    Default

    Quote Originally Posted by recs7168 View Post
    Hi, I added a failsafe for the two fails I mentioned above. Also, removed the update function since it's not working. I tried playing with the player form but I don't really understand how it works, if anyone could link me to some resources that'd be great

    Simba Code:
    program AshamanHerblore;
      {$DEFINE SMART}
      {$DEFINE FAILSAFE}
      {$I SRL-6/SRL.Simba}
      {$i srl-6/lib/misc/srlplayerform.simba}

    var
      itemCount, xp, slot, startingXP, itemsPH, xph, bir, bfr, stacks, stackCheck, slots: integer;
      itemType, typeEdit: string;
      timeout, currentBTime: TTimeMarker;
      W, X, Y, Z, realBTime, breakRounds, totalbreaks, antiB, mouseB, profit, totalProfit: integer;
      debug, normalBank: Boolean;
      newValues, oldValues: array [0..2] of integer;
      statsTimer: TTimeMarker;

    const
      SCRIPT_VERSION = '2.6';

    procedure declareplayers();
    var
      i,j: integer;
    begin
      players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager
      currentPlayer := 0;                                           // player to use first

      // set player attributes based on the settings from the form
      for i := 0 to high(players) do
        with players[i] do
        begin
          // convert the integers
          integers[0] := strToInt(playerForm.players[i].settings[1]);  //minutes until break
          integers[1] := strToInt(playerForm.players[i].settings[2]);  //minutes to break

          for j := 0 to high(playerForm.comboBoxItems[1]) do
            if (playerForm.players[i].settings[11] = playerForm.comboBoxItems[1][j]) then
              integers[2] := j;                                                  //bankinglocation

          Stacks := strToInt(playerForm.players[i].settings[4]);  //number of stacks
          World :=  strToInt(playerForm.players[i].settings[3]);                    //world
          ismember:=true;

          if (playerForm.players[i].settings[12] = 'Normal') then
            normalBank := true;

          if not normalBank then
            for j := 0 to high(playerForm.comboBoxItems[2]) do                            //quickload
              if (playerForm.players[i].settings[12] = playerForm.comboBoxItems[2][j]) then
                integers[4] := j+2;

          // booleans
          booleans[0] := strToBool(playerForm.players[i].settings[6]);   //takebreaks
          booleans[1] := strToBool(playerForm.players[i].settings[7]);   //switchworlds
          FindMod := strToBool(playerForm.players[i].settings[8]);      //mods
          debug := strToBool(playerForm.players[i].settings[9]);     //debug

          // any other data types you've decided to use
          strings[0] := playerForm.players[i].settings[0]; //quickkey
          strings[1] := playerForm.players[i].settings[10]; //cleanorpots

          if (not normalbank) and (strings[1] = 'Pots') then
            slots := 14 else
            slots := 28;

          if (playerForm.players[i].settings[5] = '') then
          begin
            writeln('No UserAgent detected. Opening up webpage to get userAgent');
            openWebPage('http://whatsmyuseragent.com/');
            writeln('Copy your useragent text and paste it into the form');
            writeln('Restart script');
            terminateScript;
          end else
            smartUserAgent := playerForm.players[i].settings[5]; //useragent

          print('slots: ' + toStr(slots));
        end;
    end;

    // initiates the SRL player form (you aren't restricted to the procedure name; it can be whatever you want)
    procedure initPlayerForm();
    begin
      with playerForm do
      begin
        name := 'AshamanHerblore v'+toStr(SCRIPT_VERSION); // the title of the SPF, usually the name of your script
        scriptHelpThread := '';           // a link to a help thread, if set to '' will link to my setup guide
        scriptSettingsPath := '';         // where you want the settings file to be saved; saved in script's path by default

        editBoxLabels := ['QuickKey', 'Minutes until break', '# of Minutes to break', 'World', '#ofStacks', 'Client UserAgent']; // edit boxes are created for each array element
        editBoxDefaults := [ '0', '600', '15','0', '1', ''];                                             // optional default values for each edit box; array length must equal editBoxLabel length
        editBoxHints := ['if cleaning herbs, which key do you have the herb set to in the action bar?',
        'How many minutes do you want to run the script before you break?',
        'How many minutes do you want to break for?',
        'Which world do you want to login to? 0 is random',
        'How many stacks of herbs do you want to mix?',
        'If you don''t know this, a popup will walk you through it after you hit start'];

        checkBoxLabels := ['Take breaks', 'Switch Worlds (After break)', 'Logout if Mod is near', 'Debug'];        // same as editBoxLabels but for check boxes
        checkBoxDefaults := ['True','True','True', 'False'];
        checkBoxHints := ['Do you want to take breaks?',
        'Do you want to switch worlds after you break?',
        'Do you want to logout if a jmod is detected near you?',
        'Do you want to run in debug mode? It prints out more debug and onscreen debug if there are issues'];

        comboBoxLabels := ['CleanOrPots','Location','QuickLoad'];                                                // same as editBoxLabels but for combo boxes (drop down boxes)
        comboBoxDefaults := ['Clean','NPC_BLUE','Normal'];
        comboBoxHints := ['Are you cleaning herbs or mixing pots?',
        'Which banking location are you using?',
        'Do you want to use the Preset buttons for banking? Select which one'];

        // this needs to be done for every element in the comboBoxLabels array
        setLength(comboBoxItems, length(comboBoxLabels));
        comboBoxItems[0] := ['Clean', 'Pots'];       // all the options available for the first combo box
        comboBoxItems[1] := ['NPC_BLUE', 'NPC_GREY', 'NPC_GREEN', 'NPC_DRAYNOR', 'BANK_BOOTH', 'CHEST_SW', 'CHEST_SHANTAY', 'CHEST_DUEL', 'CHEST_CW', 'CHEST_GROTTO', 'CHEST_LUMBRIDGE', 'TABLE_BURTHORPE', 'BANK_GE', 'PRIFDDINAS'];       // all the options available for the first combo box
        comboBoxItems[2] := ['Normal', 'PRESET_1', 'PRESET_2'];
      end;
    end;

    procedure debugSPFSettings();
    var
      i: integer;
    begin
      writeln('');
      writeln('Player file: ', playerForm.playerFile);

      for i := 0 to high(players) do
      begin
        writeln('QuickKey:          ', players[i].strings[0]);
        writeln('Minutes until break:            ', players[i].integers[0]);
        writeln('# of Minutes to break: ', players[i].integers[1]);
        writeln('Take breaks:        ', players[i].booleans[0]);
        writeln('Switch Worlds (After break):        ', players[i].booleans[1]);
        writeln('Logout if Mod is near:        ', players[i].findmod);
        writeln('CleanOrPots:        ', players[i].strings[1]);
        writeln('Location:        ', players[i].integers[2]);
        writeln('');
      end;
    end;

    {*******************************************************************************
    function AutoupdateMe;
    By: Shuttleu
    Edited By: Ashaman88
    Description: Autoupdates Script.
    *******************************************************************************}

    procedure autoUpdateMe;
    var
      Neifile: integer;
      OnlineVersion, NewScript, NeiFeilNennen: String;
    begin
        WriteLn('You have the latest version of the script!');
    end;

    procedure findNormalrandoms;
    begin
      exitTreasure();
      claimTicket();
    end;

    procedure antiban;
    var
      i: integer;
    begin
      i := random(600);
      case i of
        1: boredHuman(false);
        2..7:
          begin
            hoverSkill(Skill_Herblore);
            wait(gaussRangeInt(1000, 2000));
          end;
        8..50: mouseMovingObject;
        51..100: sleepAndMoveMouse(randomRange(100, mouseB));
        101..400:
          begin
            mouseOffClient(4);
            wait(randomRange(2000, mouseB));
          end;
        501..600: wait(randomRange(1000, 2000));

      end;
      wait(gaussRangeInt(0, antiB));
    end;

    { Calculated stats before sending to server by the Mayor}    // Removed since my server is expired ~TM 10/aug/15
    {
    procedure calculateStats();
    var
      i: integer;
        calcValues: Array [0..2] of integer;
    begin
      calcValues := [round(getTimeRunning() / 60000), ItemCount, XP];

        for i := 0 to high(NewValues) do
        begin
          newValues[i] := calcValues[i] - oldValues[i];
          oldValues[i] := calcValues[i];
        end;
    end;
    }

    { Sends stats to server by the Mayor}
    {
    function sendStats(): boolean;
    var
      c, i: integer;
        statvars: Array [0..2] of string;
    begin
      statvars := ['Time', 'Items', 'XP'];
      c := initializeHTTPClient(false);

        for i := 0 to high(statvars) do
          addPostvariable(c, statvars[i], intToStr(newValues[i]));

      result := pos('true', lowercase(postHTTPPageEx(c, 'http://srlmayor.com/mayorstats/asha/AshaStats.php'))) <> 0;
      freeHTTPClient(c);
      if result then
        calculateStats();
    end;
    }

    procedure progressReport;
    var
      ttb, profitPH: integer;
      method: String;
    begin
      clearDebug;

      ttb := (((W) + (Y) + breakRounds) - getTimeRunning);

      xp := (chatBox.getXPBar - startingXP);
      xph := round(xp * (3600.0 / (getTimeRunning / 1000.0)));

      totalProfit := (itemCount * profit);
      profitPH := round((totalProfit * (3600.0 / (getTimeRunning / 1000.0))));

      itemsPH := round((itemCount * (3600.0 / (getTimeRunning / 1000.0))));

      case players[currentPlayer].strings[1] of
        'Clean': method := 'Cleaned';
        'Pots':  method := 'Made';
      end;

      writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
      writeln('|                  AshamanHerblore v'+padR(toStr(SCRIPT_VERSION), 24), '|');
      writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
      writeln(padR('| Running For: '+ timeRunning, 60)+'|');
      writeln(padR('| '+ itemType + '''s ' + method + ': ' + groupDigits(itemCount, ','), 37) + padR(method + '/H: ' + groupDigits(itemsPH, ','), 23) + '|');
      writeln(padR('| Exp Earned: ' + groupDigits(xp, ','), 37) + padR('Exp/Hour: ' + groupDigits(xph, ','), 23) + '|');
      writeln(padR('| Profit: ' + groupDigits(profit,','), 37) + padR('Profit/Hour: ' + groupDigits(profitPH,','), 23) + '|');
      writeln('|___________________________________________________________|');

      disguise(itemType + '''s ' + method + ': ' + groupDigits(itemCount, ','));

      if players[currentPlayer].booleans[0] then
        writeln('Time until break: '+ msToTime(ttb, Time_Bare));
      {
      if statsTimer.getTime() > 300000 then
          if sendStats() then
              statsTimer.start() else
              writeLn('Failed to send stats');
      }

    end;

    function getProfit(herb, page: string): integer; // credit to euphemism
    var
      potString, potProfit: string;
      options: TReplaceFlags;
    begin
      options := [rfReplaceAll, rfIgnoreCase];
      potString := replace(herb, ' ', '_', options);
      potString := between('<a href="/wiki/' + potString + '"', '</tr>', getPage(page));

      potProfit := between('*', '<', potString);
      potProfit := replace(potProfit, ',', '', []);

      result := strToIntDef(potProfit, -1);
      writeln('Profit per ' + herb + ': '+toStr(result));
    end;

    function breakHandler(breakIn, breakFor, randbreakIn, randbreakFor: integer): Boolean;
    var
      H,M,S: integer;
    begin
      if not isLoggedIn then
        exit;

      if (getTimeRunning < ((W) + (Y) + breakRounds)) then
        exit Else
        if (getTimeRunning > ((W) + (Y) + breakRounds)) then
        begin
          RealBTime := Round((X+Z)/60000);
          writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.');
          players[currentPlayer].Logout;
          currentBTime.Reset;
          currentBTime.start;
          repeat
            wait(21000);
            ConvertTime((X+Z)-currentBTime.getTime,H,M,S);
            writeln('breaktime left: '+IntToStr(H)+':'+IntToStr(M)+':'+IntToStr(S));
          until(currentBTime.getTime>(X+Z));
          writeln('Logging in.');
          if players[currentPlayer].booleans[1] then
            players[currentPlayer].world := 0;
          players[currentPlayer].login;
          wait(4000);
          timeout.start;
          Result := isLoggedIn;
          minimap.setAngle(MM_DIRECTION_EAST);
          mainScreen.setAngle(MS_ANGLE_HIGH);
          IncEx(breakRounds, (W) + (X));
          Inc(Totalbreaks);
          writeln('The next break will occur in about ' + IntToStr(breakIn) + ' minutes.');
          W := (breakIn * 60000);
          X := (breakFor * 60000);
          Y := randomRange(-BIR * 60000, BIR * 60000);
          Z := randomRange(-BFR * 60000, BFR * 60000);
        end;
    end;

    function banking: boolean;
    var
      t: TTimeMarker;
      time: integer;
    begin
      if not isLoggedIn then
        exit;
      t.start;
      SRL_Events[EVENT_ANTIBAN] := nil;
      time := gaussRangeInt(15000, 24000);
      repeat
        wait(random(100));
        if bankscreen.open(players[currentPlayer].integers[2]) then
          break else
          begin
            minimap.setAngle(MM_DIRECTION_NORTH);
            mainScreen.setAngle(MS_ANGLE_HIGH);
          end;
        if (t.getTime > time) or (not isLoggedIn) then
          exit;
      until (bankScreen.isOpen);

      SRL_Events[EVENT_ANTIBAN] := @antiban;



      if normalBank then
        if bankScreen.GetPackCount > 0 then
          bankScreen.QuickDeposit(QUICK_DEPOSIT_INVENTORY);

      case players[currentPlayer].strings[1] of
        'Clean':
        begin
          t.start;
          time := gaussRangeInt(8000, 12000);
          repeat
            if normalBank then
            begin
              if bankScreen.withdraw(10, WITHDRAW_AMOUNT_ALL, ['']) then
                break;
            end else
              if bankScreen.clickButton(players[currentPlayer].integers[4]) then
                break;
            if (t.getTime > time) or (not isLoggedIn) then
              exit;
            wait(gaussRangeInt(0, 1500));
          until false;
        end;

        'Pots':
        begin
          t.start;
          time := gaussRangeInt(8000, 12000);
          repeat
            if normalBank then
            begin
              if bankScreen.withdraw(10, 14, ['']) then
                break;
            end else
              if bankScreen.clickButton(players[currentPlayer].integers[4]) then
                break;
            if (t.getTime > time) or (not isLoggedIn) then
              exit;
            wait(gaussRangeInt(0, 1500));
          until false;

          if normalBank then
          begin
            t.start;
            time := gaussRangeInt(8000, 12000);
            repeat
              if bankScreen.withdraw(9, 14, ['']) then
                break;
              if (t.getTime > time) Or (not isLoggedIn) then
                exit;
              wait(gaussRangeInt(0, 1500));
            until false;
          end;
        end;
      end;

      if normalBank then
        bankScreen.close else
      begin
        t.start;
        time := gaussRangeInt(4000, 8000);

        repeat
          if not bankScreen.__find() then
            break;
          if (t.getTime > time) Or (not isLoggedIn) then
            exit;
          wait(gaussRangeInt(0, 200));
        until false;
      end;

      if players[currentPlayer].strings[1] = 'Pots' then
      begin
        case random(10) of
          0..7: slot := 11;
          8..9: slot := 12;
        end;

        tabBackpack.mouseSlot(slot, MOUSE_MOVE);
      end;

      wait(gaussRangeInt(0, 100));

      t.start;
      repeat
        if (tabBackpack.isItemInSlot(slots)) then
          break;
        wait(gaussRangeInt(0, 100));
        if (t.getTime > 8000) then
        begin
          if (stacks > 1) And (stackCheck < stacks) then
          begin
            inc(stackCheck);
            exit;
          end;
          writeln('Failed withdrawing, shutting down - took a screenshot, send pic to ashaman (in the logs folder)');
          if debug then
            saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
          players[currentPlayer].logout;
          terminateScript;
        end;
        if not isLoggedIn then
          exit;
      until (tabBackpack.isItemInSlot(slots));


      if chatbox.findTextOnLines(['could not be'], [0]) then
        if countColorTolerance(66033, chatbox.lineBoxes[0], 10) > 100 then
        begin
          writeln('Failed withdrawing, shutting down - took a screenshot, send pic to ashaman (in the scripts folder)');
          if debug then
            saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
          players[currentPlayer].logout;
          terminateScript;
        end;

      if players[currentPlayer].strings[1] = 'Clean' then
        wait(gaussRangeInt(400, 800));

      result := true;
    end;

    function makeItems: boolean;
    var
      time,X,Y, i: integer;
      T: TTimeMarker;
    begin
      if not isLoggedIn then
        exit;

      case players[currentPlayer].strings[1] of
        'Clean':
          begin
            antiB := randomRange(0, 500);
            mouseB := randomRange(0, 3000);

            for i := 0 to 3 do
            begin
              wait(gaussRangeInt(0, 200));
              print('Sending quickkey to open menu');

              sendKeys(players[currentPlayer].strings[0], 60 + random(60), 60 + random(60));
              wait(gaussRangeInt(0, 100));

              print('waiting for production or tool menu');

              t.start;
              time := gaussRangeInt(4000, 7000);
              repeat
                wait(gaussRangeInt(0, 100));

                if t.getTime > time then
                  break;
              until productionscreen.isOpen or toolscreen.isOpen;

              if productionscreen.isOpen or toolscreen.isOpen then
                break;
            end;

            wait(gaussRangeInt(0, 200));

            if itemType = '' then
            begin
              itemType := productionScreen.getSelectedBoxText;
              itemType := copy(itemType, 7, length(itemType));
              typeEdit := toStr(itemType[1]);
              itemType := copy(itemType, 2, length(itemType));
              itemType := (uppercase(typeEdit) + itemType);
              itemType := trim(itemType);
              profit := getProfit(itemType, 'http://runescape.wikia.com/wiki/Calculator:Herblore/Herbs');
            end;

            print('HerbMenu is here');

            productionScreen.clickStart;

            print('waiting for StatusMenu');

            SRL_Events[EVENT_ANTIBAN] := nil;
            if not tabBackpack.waitSlotPixelChange(3, gaussRangeInt(10000, 20000)) then
            begin
              SRL_Events[EVENT_ANTIBAN] := @antiban;
              exit;
            end;

            SRL_Events[EVENT_ANTIBAN] := @antiban;

            wait(gaussRangeInt(0, 1500));

            timeout.start;

            if not tabBackpack.waitSlotPixelChange(28, gaussRangeInt(25000, 45000)) then
              exit;

            print('last slot changed');
            itemCount := itemCount + 28;
          end;
        'Pots':
          begin
            antiB := 3000;
            mouseB := 6000;

            getMousePOS(x, y);
            if slot = 0 then
              slot := 1;
            if not pointInBox(point(x, y), tabBackpack.getSlotBox(11)) and not pointInBox(point(x, y), tabBackpack.getSlotBox(12)) then
            begin
              case random(10) of
                0..7: slot := 11;
                8..9: slot := 12;
              end;
            end;
            tabBackpack.mouseSlot(slot, MOUSE_LEFT);
            wait(gaussRangeInt(0, 100));

            case random(10) of
              0..7: slot := 16;
              8..9: slot := 17;
            end;

            tabBackpack.mouseSlot(slot, MOUSE_LEFT);
            wait(gaussRangeInt(0, 200));

            t.start;
            time := gaussRangeInt(6000, 12000);
            repeat
              if productionScreen.isOpen then
                break;
              wait(gaussRangeInt(0, 500));
              if (not isLoggedIn) Or (t.getTime > time) then
                exit;
            until productionScreen.IsOpen;

            wait(gaussRangeInt(0, 400));

            if itemType = '' then
            begin
              itemType:= productionScreen.getSelectedBoxText;
              profit := getProfit(itemType, 'http://runescape.wikia.com/wiki/Calculator:Herblore/Unfinished_potions');
            end;

            productionScreen.clickStart;

            if not tabBackpack.waitForShift(randomRange(2000, 4000)) then
              exit;

            wait(gaussRangeInt(0, 1500));

            timeout.start;

            t.start;
            time := gaussRangeInt(25000, 45000);
            repeat
              wait(gaussRangeInt(0, 900));
              antiBan;
              if (not isLoggedIn) or (t.getTime > time) then
                exit;
            until not (tabBackpack.IsItemInSlot(28));

            itemCount := itemCount + 14;
          end;
        else
        begin
          writeln('CleanOrPots type wrong, shutting down');
          terminateScript;
        end;
      end;
      result := true;
    end;

    procedure setup;
    begin
      clearDebug;
      disableSRLLog := true;
      autoUpdateMe;

      initPlayerForm(); // initiate your settings
      runPlayerForm();  // run the form

      // use this so the script doesn't continue if the user exits out of the form
      if (not playerForm.isScriptReady) then
        terminatescript;

      declareplayers();

      smartShowConsole := false;

      if not debug then
        disableSRLDebug := true else
        disableSRLDebug := false;

      smartEnableDrawing := true;
      SRL_Events[EVENT_ANTIBAN] := @antiban;
      setupSRL;

      if not isLoggedIn then
      begin
        if not players[currentPlayer].login then
          terminateScript;

        writeln('Just loggedin, waiting a bit');
        wait(randomRange(6000, 10000));
      end;

      clearDebug;

      mainScreen.setAngle(MS_ANGLE_HIGH);
      findNormalrandoms;

      timeout.start;
      stackCheck := 1;

      bir := 13;      // ***random minutes to add/subtract from how long until we break***
      bfr := 7;       // ***random minutes to add/subjtract from break duraction***

      W := (players[currentPlayer].integers[0] * 60000);
      X := (players[currentPlayer].integers[1] * 60000);
      Y := randomRange(-BIR * 60000, BIR * 60000);
      Z := randomRange(-BFR * 60000, BFR * 60000);

      if conversationBox.continue(true, true) then
        wait(randomRange(3000, 2000));


      statsTimer.start();
      startingXP := chatBox.getXPBar;

      findNormalrandoms;

      print('slots: ' + toStr(slots));
    end;

    procedure mainloop;
    var
      i: integer;
    begin
      if not isLoggedIn then
      begin
        wait(5000);
        writeln('Attempting to log back in');
        disableSRLDebug := false;
        repeat
          try
            players[currentPlayer].login;
            inc(i);
          except
          end;
          if (i = 7) then
          begin
            i := 0;
            players.next(false);
          end;
        until isLoggedIn;

        disableSRLDebug := true;
        mainScreen.setAngle(MS_ANGLE_HIGH);
        minimap.setAngle(MM_DIRECTION_EAST);
      end;

      if banking then
      begin
        findNormalrandoms;
        if makeItems then
        begin
          progressReport;
          findNormalrandoms;
        end;
      end;

      if timeout.getTime > 200000 then
      begin
        writeln('Problem Occurred, Relogging');
        players[currentPlayer].Logout;

      end;

      if timeout.getTime > 300000 then
      begin
        writeln('nothing has happened for too long, shutting down!- took a screenshot, send pic to ashaman (in the logs folder)');
        if debug then
          saveScreenshot(scriptPath + timeRunning() + '_' + 'HerbFail.png');
        terminateScript;
      end;

      if players[currentPlayer].Booleans[0] then
        breakHandler(players[currentPlayer].integers[0], players[currentPlayer].integers[1], bir, bfr);
    end;

    begin
      setup;
      while (players.getActive() > 0) do
        mainloop;
    end.
    Thank you for this. I just loaded it up and I am getting (initially) something like this:

    |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
    | AshamanHerblore v2.6 |
    |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
    | Running For: 2 Minutes and 53 Seconds |
    | Iantadyme's Cleaned: 196 Cleaned/H: 4,067 |
    | Exp Earned: 0 Exp/Hour: 0 |
    | Profit: -1 Profit/Hour: -4,067 |
    |_________________________________________________ __________|

  18. #993
    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Anyone has a good working version? The one posted above works but seems too slow when clicking to bank after doing pots or cleaning.

  19. #994
    Join Date
    Dec 2016
    Posts
    39
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Working

  20. #995
    Join Date
    Apr 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Not at all currently, I wouldn't be getting close to 2300 pots/hr if I was.
    Just that I'm planning to run it on multiple clients.
    Do you have a copy of the edited code to speed up the pots/hr? Unedited script w/ scroll of cleansing sits at 200-275/hr =/

  21. #996
    Join Date
    Aug 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default error with load

    I am trying to get this to run but i keep getting this message when trying to run.
    /images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
    </style>
    m/><span id=logo aria-label=Google></span></a>
    <p><b>404.</b> <ins>That’s an error.</ins>
    <p>The requested URL <code>/git/Version.txt</code> was not found on this server. <ins>That’s all we know.</ins>
    .simba!!
    Successfully executed.

  22. #997
    Join Date
    Jan 2018
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thank you! Works very well and has helped me net a small little profit <3

Page 40 of 40 FirstFirst ... 30383940

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
  •