Results 1 to 5 of 5

Thread: [First Script] Iron Power Miner

  1. #1
    Join Date
    Jan 2015
    Posts
    78
    Mentioned
    0 Post(s)
    Quoted
    48 Post(s)

    Default [First Script][RS3] Iron Power Miner


    Credits:
    The Mayor - Looked at his script for his detection method
    Code:
    Program Iron_Power_Miner;
    {$Define SMART}
    {$I SRL-6/SRL.Simba}
    const
      MIN_PIXEL_SHIFT = 100;// Minimum player pixel shift while mining (only adjust if necessary)
      MINE_TIMER = 5000;   // Max time to wait for rocks (only adjust if necessary)
    var
      oreDTM := DTMFromString('mlwAAAHicY2dgYOhhYmCoAeIOIJ4CxDOBuB+I24A4n5GBoQCI64C4AojzgDgZiFOB2FhODKibCSvmYsANGPFgKAAAg/AHfg==');
    
    Procedure declarePlayers();
    Begin
      setLength(players, 1);
        With players[0] Do
          Begin
            loginName := '';    //UserName
            password  := '';    //Password
            isActive  := True;  //Leave true
            isMember  := False; //Is user a Member?
          End;
      currentPlayer := 0;
    End;
    
    Function isPlayerMining(minimumShift: Integer): Boolean;
    var
      playerShift: Integer;
    Begin
      playerShift := getPixelShiftAverage(mainscreen.playerBox, 150, 700);
      result := playerShift > minimumShift;
      ClearDebug;
      writeLn('Status: Mining Iron');
    End;
    
    Function waitWhileMining(minimumShift, maximumTime: Integer): Boolean;
    var
      invCount: Integer;
      oreTimer: TTimeMarker;
    Begin
      invCount := tabBackpack.count();
      oreTimer.start();
      wait(randomRange(500, 1500));
      mouseOffClient(OFF_CLIENT_RANDOM);
    
      Repeat
        If tabBackpack.count() <> invCount Then
          Begin
            exit(true);
          End;
      Until (Not isPlayerMining(minimumShift)) Or (oreTimer.getTime() > maximumTime);
    End;
    
    Procedure mineRock();
    var
      X, Y: Integer;
    Begin
        If mainScreen.findObject(X, Y, 2242428, 13, ['ron ore rocks']) Then
          Begin
            ClearDebug;
            writeLn('Status: Clicking Iron');
              if waitWhileMining(MIN_PIXEL_SHIFT,  MINE_TIMER + random(1000)) then
                Begin
    
                End;
          End;
    End;
    
    Procedure dropOre();
    var
      x, y, i, dtmCount: Integer;
    Begin
      If findDTM(oreDTM, x, y, tabBackPack.getBounds()) Then
        Begin
          ClearDebug;
          dtmCount := tabBackpack.countDTM(oreDTM);
          writeLn('Status: Dropping ' + toStr(dtmCount));
            For i := 1 To dtmCount Do
              Repeat
                sendKeys('1', randomRange(60, 120), randomRange(60, 120));
                wait(randomRange(100, 200));
              Until (tabBackPack.countDTM(oreDTM) = 0); // Spam 1 until there is no more ore?
        End;
    End;
    
    Procedure setupPlayer();
    Begin
      exitTreasure();
      mainScreen.setAngle(MS_ANGLE_HIGH);
      minimap.setAngle(MM_DIRECTION_NORTH);
      dropOre();
    End;
    
    Begin
      disableSRLDebug := True;
      setupSRL();
      declarePlayers();
        Repeat
          If Not isLoggedIn() Then
          Begin
            players[currentPlayer].login();
            setupPlayer();
          End;
      setupPlayer();
            Repeat
              mineRock();
            Until(tabBackPack.isfull);
          dropOre();
        Until(false);
       FreeDTM(oreDTM);
    End.

    Upcoming Plans:
    More advanced antiban
    Last edited by Battousai; 02-12-2015 at 10:24 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    PM'ed you.
    Solar from RiD.

  3. #3
    Join Date
    Dec 2011
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    you have some sensitive information in your script edit it


    edit1: make sure to free DTM at end of script



    it's clear by the includes this is for RS3 but some might not recognize so you should specify that


    You may add the script as an attachment in advanced posting as well
    Attached Files Attached Files

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Quick tip: in loops such as
    Simba Code:
    For i := 1 To (tabBackpack.countDTM(oreDTM)) Do

    You're better off doing this:
    Simba Code:
    h := tabBackpack.countDTM(oreDTM); //declare this variable of course
    For i := 1 To h do

    Else, every iteration, that countDTM function is called, which is quite ineffecient. Same goes for that Repeat...Until
    Otherwise, Antiban is indeed a great idea! Keep at it, try and build in failsafes so you don't get stuck in any part of your code which might get you caught.
    Ce ne sont que des gueux


  5. #5
    Join Date
    Jan 2015
    Posts
    78
    Mentioned
    0 Post(s)
    Quoted
    48 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    PM'ed you.
    Quote Originally Posted by Myke View Post
    you have some sensitive information in your script edit it
    edit1: make sure to free DTM at end of script
    it's clear by the includes this is for RS3 but some might not recognize so you should specify that
    You may add the script as an attachment in advanced posting as well
    Yeah i failed hard by leaving that in there, Went back to test some other stuff and completely forgot to remove it this time :P But its corrected now.

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
  •