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
  • Newbie Scripter SOS - Motherlode Miner


    Smokeyjay

    Recommended Posts

    Posted

    What's up guys I'm still fairly new to RuneScape scripting. I've been working around with a couple of simple scripts: woodcutter, winemaker, fishing, etc. These are simple and easy nothing really to them. Now I'm working on a MotherLode Miner to get me 100 golden nuggets so I can start grinding the Blast Furnace for $$$. I was wondering if any of you guys could help a brotha out with recommendations to make my script smoother. Currently, I don't have a banking aspect of the script and deposit option. Any suggestions would be appreciated, thanks. 

    if (!getInventory().isFull() && mineArea.contains(getLocalPlayer())) {
            	if(getLocalPlayer().isAnimating()) {
            		//do nothing
            	} else if(getGameObjects().getTopObjectOnTile(tile1).getID() == 26661) {
            		myORE.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile1).getID() != 26661, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile2).getID() == 26662) {
            		myORE2.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile2).getID() != 26662, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile3).getID() == 26663) {
            		myORE3.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile3).getID() != 26663, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile4).getID() == 26664) {
            		myORE4.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile4).getID() != 26664, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile5).getID() == 26664) {
            		myORE5.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile5).getID() != 26664, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile6).getID() == 26662) {
            		myORE6.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile6).getID() != 26662, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile7).getID() == 26662) {
            		myORE7.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile7).getID() != 26662, Calculations.random(10000, 20000));
            	} else if(getGameObjects().getTopObjectOnTile(tile8).getID() == 26664) {
            		myORE8.interact("Mine");
            		sleepUntil( () -> getGameObjects().getTopObjectOnTile(tile8).getID() != 26662, Calculations.random(10000, 20000));
            	}
            } else if(!mineArea.contains(getLocalPlayer()) && !getInventory().isFull()) {
            	LocalPath<Tile> Dest = getWalking().getAStarPathFinder().calculate(getLocalPlayer().getTile(),
        				mineTile);
            	getWalking().getAStarPathFinder().addObstacle(new DestructableObstacle("Rockfall", "Mine",
        				new Tile(3727, 5682, 0), new Tile(3727, 5682, 0), new Tile(3727, 5683, 0)));
            	getWalking().getAStarPathFinder().addObstacle(new DestructableObstacle("Rockfall", "Mine",
        				new Tile(3732, 5680, 0), new Tile(3732, 5680, 0), new Tile(3733, 5680, 0)));
            	getWalking().getAStarPathFinder().addObstacle(new DestructableObstacle("Rockfall", "Mine",
        				new Tile(3730, 5683, 0), new Tile(3730, 5683, 0), new Tile(3731, 5683, 0)));
            	if (getGameObjects()
        				.closest(r -> r != null && r.getName().equalsIgnoreCase("Rockfall") && r.distance() < 2) != null
        				&& !getMap().canReach(pathTile)) {
        			if (getGameObjects().closest(r -> r != null && r.getName().equalsIgnoreCase("Rockfall"))
        					.interact()) {
        				sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(2000, 3000));
        				sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(2000, 3000));
        			}
        		}
        		getWalking().walk(Dest.next());
        		sleepUntil(() -> getWalking().getDestinationDistance() < 3, Calculations.random(2800, 3500));
    		}else {
            	LocalPath<Tile> Dest = getWalking().getAStarPathFinder().calculate(getLocalPlayer().getTile(),
        				pathTile);
        		getWalking().getAStarPathFinder().addObstacle(new DestructableObstacle("Rockfall", "Mine",
        				new Tile(3730, 5683, 0), new Tile(3730, 5683, 0), new Tile(3731, 5683, 0)));
        		getWalking().getAStarPathFinder().addObstacle(new DestructableObstacle("Rockfall", "Mine",
        				new Tile(3732, 5680, 0), new Tile(3732, 5680, 0), new Tile(3733, 5680, 0)));
        		getWalking().getAStarPathFinder().addObstacle(new DestructableObstacle("Rockfall", "Mine",
        				new Tile(3727, 5682, 0), new Tile(3727, 5682, 0), new Tile(3727, 5683, 0)));
        		if (getGameObjects()
        				.closest(r -> r != null && r.getName().equalsIgnoreCase("Rockfall") && r.distance() < 2) != null
        				&& !getMap().canReach(pathTile)) {
        			if (getGameObjects().closest(r -> r != null && r.getName().equalsIgnoreCase("Rockfall"))
        					.interact()) {
        				sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(2000, 3000));
        				sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(2000, 3000));
        			}
        		}
        		getWalking().walk(Dest.next());
        		sleepUntil(() -> getWalking().getDestinationDistance() < 3, Calculations.random(2800, 3500));
            }
            sleepUntil( () -> !getLocalPlayer().isAnimating(), Calculations.random(2000, 10000));
            return 500;
        }

     

    Posted
    7 minutes ago, Nuclear Nezz said:

    What are those 8 different if statements for

    Can’t figure out how to read the veins with different IDs. I’ve been trying to find out how to use the color but I can’t find any information on it.

    Posted

    I've never done a motherload mine script, so I don't know the challenges involved. But, from what I can see, I'd try creating a list of the gameobjects and have a for loop go through them rather than hard coding each one in.

    Posted
    24 minutes ago, morten1ela said:

    I've never done a motherload mine script, so I don't know the challenges involved. But, from what I can see, I'd try creating a list of the gameobjects and have a for loop go through them rather than hard coding each one in.

    my problem is that if I do a loop I have different IDs for each Ore vein. Not quite sure how to loop multiple IDs to each specific tile.

    Posted
    1 hour ago, Nuclear Nezz said:

    What are those 8 different if statements for

    Fixed it :D

    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.