Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Miner not mining in specified area?


    Mike5674

    Recommended Posts

    Hey all,

    I'm new here, and brand new to scripting. I already made a simple script to smith me steel bars in edgeville with a coal bag, and now I am working on a motherlode miner.

    I only want to mine in my favorite area in the mine. There's 2 sets of 3 "Ore vein", and I only want to mine these 6 veins. When my character finishes mining the first 3, he doesn't move to the next 3.

    If i move my character manually close to the other set of Ore vein, it continues as normal until they run out, or my inventory is full.

    I though about a miner that would trigger once !getLocalPlayer().isAnimating() then tell the bot to move to the middle near both sets once it reaches 0.... However I couldn't find anything anywhere telling me how to do this in plain english. 

     

    Any help would be much appreciated!

     

    				GameObject ore = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Ore vein"));				
    			
    				if (mine.contains(ore) && !getInventory().isFull()) {
    						ore.interact("Mine");
    						int countOre = getInventory().count("Pay-dirt");
    						sleepUntil(() -> getInventory().count("Pay-dirt") > countOre, 10000);
    						return (600);	
    				}
    				

     

    Link to comment
    Share on other sites

    I found a small fix. Very inefficient, but it's sort of working for now. Help would still be welcomed!
     

    			case MINE:
    				
    				GameObject ore = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Ore vein"));				
    				
    				if (mine.contains(ore) && !getInventory().isFull()) {
    						ore.interact("Mine");
    						int countOre = getInventory().count("Pay-dirt");
    						sleepUntil(() -> getInventory().count("Pay-dirt") > countOre, 10000);
    						return(600);
    				}
    				
    				if (!center.contains(getLocalPlayer())) {
    					sleep(20000);
    					getWalking().walkExact(center.getCenter());
    					return(2000);
    				}
    
    				break;

    I added that second bit. I defined a center then told it to move there after 20 seconds.. sort of.. It puts it to sleep so it misses a few veins sometimes.

    Link to comment
    Share on other sites

    On 9/24/2018 at 7:17 AM, Stormscythe said:

    Does the Debug Console provide any errors when the script is "freezing" and not moving on?

    No it does not. The script seems to be running fine, I am unsure what the issue is. But after watching it work when it returns to the center position it looks like it can only see the half of the ore on the side the character is on, or both if standing in the center. I am sure it's just something to do with my method of interacting with the ore. I finally "finished" it though! So im pretty happy about it, being my first real script and all. Learned A LOT.

    Link to comment
    Share on other sites

    On 9/27/2018 at 2:18 AM, Stormscythe said:

    A good thing is to check if the object is on screen, and if not, rotate the camera to it.

    I'm garbage at responding lol. Yea that is going to be one of the next things I implement is a semi fixed camera position. I find I have to manually adjust to prevent the bot from mining on the other side of the wall. Been making great strides in this bot though. Even took some time from it and will be back at it soon fixing some minor bugs and adding Paint and maybe a GUI too once I learn how.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.