Smokeyjay 0 Share Posted March 29, 2020 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; } Link to comment Share on other sites More sharing options...
Nuclear Nezz 1969 Share Posted March 29, 2020 What are those 8 different if statements for Link to comment Share on other sites More sharing options...
Smokeyjay 0 Author Share Posted March 29, 2020 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. Link to comment Share on other sites More sharing options...
morten1ela 0 Share Posted March 29, 2020 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. Link to comment Share on other sites More sharing options...
Smokeyjay 0 Author Share Posted March 29, 2020 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. Link to comment Share on other sites More sharing options...
Smokeyjay 0 Author Share Posted March 29, 2020 1 hour ago, Nuclear Nezz said: What are those 8 different if statements for Fixed it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now