sacred brids 1 Posted July 8, 2017 Could someone guide me in the right direction of how to set a cluster area and only mine the 3 ores I choose in my script? Also to get the nearest deposit box and deposit all?
pharaoh 135 Posted July 8, 2017 make an area define the 3 ores interact only if ore is in area make an area for depo box webwalk to area interact with box deposit all walk back to mine area
sacred brids 1 Author Posted July 8, 2017 make an area define the 3 ores interact only if ore is in area make an area for depo box webwalk to area interact with box deposit all walk back to mine area Thank you so much. So basically I should just make all of these individual states and all interact with each other depending on the status of the state it is in?
pharaoh 135 Posted July 8, 2017 Thank you so much. So basically I should just make all of these individual states and all interact with each other depending on the status of the state it is in? https://dreambot.org/forums/index.php/topic/628-scripting-tutorial-in-depth-no-prior-knowledge-needed-where-to-get-started-by-apaec/ case mine / case walk / case bank etc
gumibearscuz 0 Posted July 12, 2017 Pseudo-coded but here Could someone guide me in the right direction of how to set a cluster area and only mine the 3 ores I choose in my script? Define an area to search for rocks in: Area miningArea = getLocalPlayer().getTile().getArea(10); or Area miningArea = new Tile(x, y).getArea(10); or Area miningArea = new Area( new Tile(x1, y1), new Tile(x2, y2) ); (check javadocs to learn more about these things, but honestly if you understand what an Area is and the most basic API calls then it should be obvious) then filter the rocks to ensure it is a valid rock and is within our area GameObject rock = getGameObjects().getClosest(new Filter<GameObject>() { @override boolean match(GameObject obj) { return obj != null && obj.exists() && miningArea.contains(obj.getTile()); } } Also to get the nearest deposit box and deposit all? //try to open the bank and if we do, deposit everything if (getBank().openBank()) { getBank().depositAll(); getBank.close(); } else { // otherwise we need to walk closer to the bank to be able to open it getWalking().walk(getBank().getClosestBank().getTile().getRandomArea(5)); } there is a lot more that can be done but these are the basics.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.