Results 1 to 4 of 4

Thread: Essence Power Miner - error with playerform

  1. #1
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default Essence Power Miner - error with playerform

    Script powermines essense - 17k xp - 20k xp per hour starting at level 1. Much faster for the lower levels than mining copper/tin. It uses isplayeranimating to see if the player is mining or not, this sensitivity can be adjusted depending on what cape you are wearing.

    Problems I'm having:
    1) It was working fine but I'm getting an error in the playerform in the declareplayers procedure in this line of code:
    minutesToRun := StrToInt(playerForm.players[currentPlayer].settings[0]) * 60000;

    The error:
    Error: "True" is an invalid integer at line 46
    I'm declaring it at the top as an integer so why is it even a true false at all?
    If I comment these playerform lines out it works fine.

    2) The progress report just spams in the debug box, its very annoying to look at. How can I make it just update after every full inventory when it drops using the action bar?

    3) I'd like to add stopping after the user selects how many they want to mine, any suggestions on this?

    Code:
    program nvEssence;
    
    //{$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    {$i SRL-6/LIB/MISC/SRLPLAYERFORM.simba}
    
    {==============================================================
     \ Setup:                                                     /
     / 1) Add your player to player manager.                      \
     \ 2) Set player up in front of the essence rock.             /
     / 3) Click Run, make sure you stop it yourself when done.    \
     \ 4) If clicking rock too often, change camera angle         /
     /    if not fixed, adjust sensitivity in clickRock procedure \
     \ 5) Enjoy.                                                  /
      ============================================================}
    var
      {PlayerForm Variables}
      minutesToRun : integer;
    
    
    var
      loadsDone, antiBans: integer;
      antiBanB : boolean;
    
    
    procedure initPlayerForm();
    begin
      with playerForm do
      begin
        name                := 'nv Essence v3.1';
        scriptHelpThread    := '';
        scriptSettingsPath  := '';
    
        checkBoxLabels      := ['Antiban'];
        checkBoxDefaults    := ['True'];
        checkBoxHints       := ['Want to use antibans?'];
    
      end;
    end;
    
    procedure declarePlayers();
    begin
      players.setup(playerForm.players);
      currentPlayer := 0;
    
      minutesToRun     := StrToInt(playerForm.players[currentPlayer].settings[0]) * 60000;
      antiBanB         := StrToBool(playerForm.players[currentPlayer].settings[1]);
    
    end;
    
    {Antiban}
    procedure antiBan(randomNumber: Integer);
    var
      i: Integer;
    
    begin
      if not isLoggedIn() then
        exit;
    
      i := random(randomNumber);
      if i < 62 then
      begin
        inc(antiBans);
        case i of
          0 .. 9: mouseMovingObject();
          10..20: sleepAndMoveMouse(500);
          21..30: sleepAndMoveMouse(randomRange(500, 2000));
          31..39: begin
                    mouseOffClient(random(4));
                    wait(randomRange(8000, 5000));
                  end;
          40..41: begin
                    mouseOffClient(random(4));
                    wait(randomRange(5000, 10000));
                  end;
          42..55: pickUpMouse();
          56..57: begin
                    mouseOffClient(random(4));
                    wait(randomRange(20000, 30000));
                  end;
             end;
      end;
    end;
    
    {Proggy}
    procedure progressReport();
    var
      oreMined, xpPerHour: integer;
    begin
      oreMined := LoadsDone * 28;
      xpPerHour := round(((oreMined * 5) * 60)  / (getTimeRunning() / 60000));
    
      writeLn('========================================================');
      writeLn('NV ESSENCE POWERMINER');
      writeLn('Time Running: ' + timeRunning);
      writeLn('Ores Mined: ' + intToStr(oreMined));
      writeLn('XP Per Hour: ' + intToStr(xpPerHour));
      writeLn('Loads Done: ' + intToStr(loadsDone));
      writeLn('========================================================');
    end;
    
    {Clicks the rock based on whether player is moving or not, can adjust sensitivity}
    procedure clickRock();
    var
      x, y: integer;
    begin
      if (not (mainScreen.isPlayerAnimating(70))) then
      begin
      wait(randomRange(100, 200));
      mainscreen.findObject(x, y, 8881809, 3, ['ine'], MOUSE_LEFT);
      mouse(x, y, 150, 150, MOUSE_MOVE);
      end;
    end;
    
    {Action Bar Key 114 is F3}
    procedure dropping();
    var
      x, y: integer;
    begin
    begin
      if (tabBackpack.isItemInSlot(25)) then
        begin
          wait(randomRange(1000,1200));
          if conversationBox.continue(32, 500) then
          begin
            writeLn('We Clicked The Box Baby');
            KeyDown(114);
            wait(randomRange(5000,5250));
            KeyUp(114);
            wait(randomRange(5150,5200));
            mainscreen.findObject(x, y, 8881809, 3, ['ine'], MOUSE_LEFT);
            inc(loadsDone);
          end else
            begin
              KeyDown(114);
              wait(randomRange(5000,5250));
              KeyUp(114);
              wait(randomRange(5150,5200));
              inc(loadsDone);
            end;
         end;
        end;
    end;
    
    {Main Loop}
    begin
      clearDebug();
    
      initPlayerForm();
      runPlayerForm();
    
       if not playerForm.isScriptReady then
        Exit;
    
        setupSRL();
        declarePlayers();
    
        if not isLoggedIn() then
      begin
        players[currentPlayer].login();
        exitTreasure();
        closePopup();
      end;
      begin
        mainScreen.setAngle(MS_ANGLE_HIGH);
        minimap.setAngle(MM_DIRECTION_NORTH);
      end;
    
          repeat
            clickRock();
            dropping();
            progressReport();
            antiBan(3000);
          until false;
    
    end.

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    1. You're getting that error because
    Simba Code:
    playerForm.players[currentPlayer].settings[0]
    points to
    Simba Code:
    checkBoxDefaults    := ['True'];
    which is how the SPF works.

    If you had checkBoxDefaults := ['69', 'True']; then .settings[0] would be 69 and .settings[1] would be True.

    Once you fix that error, you'll probably get another one on the line right under it because .settings[1] doesn't exist, the way you have it now.

    2. Call progressReport(); only once at the end of your dropping procedure, instead of every loop like you're doing currently.

    3. Every loop, run a conditional:
    Simba Code:
    if (oresMined >= oresToMine) then terminateScript();
    (not sure if this is what you mean, your question is worded a bit strange)
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    1. You're getting that error because
    Simba Code:
    playerForm.players[currentPlayer].settings[0]
    points to
    Simba Code:
    checkBoxDefaults    := ['True'];
    which is how the SPF works.

    If you had checkBoxDefaults := ['69', 'True']; then .settings[0] would be 69 and .settings[1] would be True.


    Once you fix that error, you'll probably get another one on the line right under it because .settings[1] doesn't exist, the way you have it now.

    2. Call progressReport(); only once at the end of your dropping procedure, instead of every loop like you're doing currently.

    3. Every loop, run a conditional:
    Simba Code:
    if (oresMined >= oresToMine) then terminateScript();
    (not sure if this is what you mean, your question is worded a bit strange)
    Perfect reply, I get it now. Thank you. I'll implement these changes.

  4. #4
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    You could do it like my competition script where I just held down an actionbar key to drop whilst it was mining
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

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
  •