pbjfreire 1 Share Posted April 3, 2020 Hello i started scripting today and decided to write an iron mining script. public class main extends AbstractScript { public int onLoop() { if (getInventory().isFull()) if (getBank().isOpen()) { getBank().depositAllExcept("bronze pickaxe"); }else getBank().open(BankLocation.getNearest()); else { GameObject rock = getGameObjects("Rocks"); if(rock !=null){ rock.interact("Mine"); } } return 1000;} } It is giving me errors but I dont understand whats wrong- Error 1- Error:(12, 42) java: method getNearest in enum org.dreambot.api.methods.container.impl.bank.BankLocation cannot be applied to given types; required: org.dreambot.api.wrappers.interactive.Entity found: no arguments reason: actual and formal argument lists differ in length Error 2- Error:(14, 31) java: method getGameObjects in class org.dreambot.api.methods.MethodContext cannot be applied to given types; required: no arguments found: java.lang.String reason: actual and formal argument lists differ in length Thank you for the help Link to comment Share on other sites More sharing options...
pbjfreire 1 Author Share Posted April 3, 2020 I fixed the first error by using the openClosest command instead. The second error still persists however. Link to comment Share on other sites More sharing options...
Shy 14 Share Posted April 3, 2020 (edited) GameObject rock = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Rocks") && gameObject.hasAction("Mine")); Edited April 3, 2020 by Shy Link to comment Share on other sites More sharing options...
pbjfreire 1 Author Share Posted April 3, 2020 Quote GameObject rock = getGameObjects().closest(rock - > rock != null && rock.getName.equals("Rocks") && rock.hasAction("Mine")); import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.Category; import org.dreambot.api.wrappers.interactive.GameObject; @ScriptManifest(author = "pedro", name = "Miner", version = 1.0, description = "miner", category = Category.MINING) public class main extends AbstractScript { public void onStart() { log("made by pedro"); } @Override public int onLoop() { if (getInventory().isFull()) if (getBank().isOpen()) { getBank().depositAllExcept("bronze pickaxe"); } else getBank().openClosest(); else { GameObject rock = getGameObjects().closest("Rocks"); if (rock != null) { rock.interact("Mine"); } ; } return Calculations.random(500, 600); } } I ended up getting the script to look like this, but when i put it in the dreambot folder it doesnt show up in the client. Also thank you @Shy Link to comment Share on other sites More sharing options...
Shy 14 Share Posted April 3, 2020 Are you sure you are putting the jar in the right folder (Dreambot > Scripts) and are you looking in the right tab in Dreambot (Local Scripts). I copied your code and it shows in Dreambot for me. Also, If you have any other scripts in that folder remove them and see if it still doesn't show because if one script is messed up it will cause all scripts to not show. Link to comment Share on other sites More sharing options...
pbjfreire 1 Author Share Posted April 3, 2020 perhaps im compiling the script wrong? My jar file is going into: C:\Users\35193\DreamBot\Scripts here is a screenshot of what im doing http://prntscr.com/rsgvq2 Link to comment Share on other sites More sharing options...
Shy 14 Share Posted April 3, 2020 I think you need to click the plus button right above the jar file( should say Add Copy of when you hover over it) in that screenshot and then click Module Output and add your Module to the jar file. Link to comment Share on other sites More sharing options...
pbjfreire 1 Author Share Posted April 3, 2020 it worked thanks a lot Shy! Shy 1 Link to comment Share on other sites More sharing options...
pbjfreire 1 Author Share Posted April 4, 2020 import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.Category; import org.dreambot.api.wrappers.interactive.GameObject; @ScriptManifest(author = "pedro", name = "Miner", version = 1.0, description = "miner", category = Category.MINING) public class main extends AbstractScript { public void onStart() { log("made by pedro"); } @Override public int onLoop() { if (getInventory().isFull()) if (getBank().isOpen()) { getBank().depositAllExcept("black pickaxe"); final Area VARROCK = new Area(3174, 3366, 3176, 3368); { getWalking().walk(VARROCK.getCenter()); sleep(Calculations.random(3000, 4000)); } while(!VARROCK.contains(getLocalPlayer())); } else getBank().openClosest(); else { GameObject rock = getGameObjects().closest(11365); if (rock != null) { rock.interact("Mine"); } ; } return Calculations.random(500, 600); } } I tried experimenting with trying to get back to the mining spot after banking, however because the tile is out of reach the bot gets stuck and cant move after a certain point. Thanks for the help. -Pedro 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