Jump to content

N O Special

Trade With Caution
  • Posts

    17
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by N O Special

  1. I agree, Web would be ideal, i think i wrote that before the web even came out. So yeah it doesn't calculate the path heuristics.
  2. http://osbot.org/forum/topic/90019-getnearestbank/
  3. VERTICAL_DROP's type needed to be an array of Integer objects and not the primitive type why? They are just indexes. Why did you need to make it into an array list also? dropAll should return a boolean, that is outside of the for loop. Maybe something like use a counter and ++ it every loop iteration, then return Inventory.getCount == 28 - counter. I assume that would work, never tried it though.
  4. This is a downloadable script, so how do we download it?
  5. These really shouldn't be voids, you should return boolean's to know if the method actually executed successfully. Also its not the best programming practice to statically create all the widgets like that, they should only be initalized when needed, keeping the scope as small as possible. Which will help the garbage collector and improve efficiency. One more thing, The GrandExchange stores alot of the information in Settings, for example the current quantity, price, and amount of the offer you're placing. Which is a better way and less memory intensive afaik, instead of reading the widget text.
  6. Couldn't seem to find a method to get nearest bank, and all the Banks were constants... So i threw them into an enum class and made a method to get nearest bank: public enum WebBank { DRAYNOR(Banks.DRAYNOR), AL_KHARID(Banks.AL_KHARID), LUMBRIDGE(Banks.LUMBRIDGE_UPPER), FALADOR_EAST(Banks.FALADOR_EAST), FALADOR_WEST(Banks.FALADOR_WEST), VARROCK_EAST(Banks.FALADOR_EAST), VARROCK_WEST(Banks.VARROCK_WEST), SEERS(Banks.CAMELOT), CATHERBY(Banks.CATHERBY), EDGEVILLE(Banks.EDGEVILLE), YANILLE(Banks.YANILLE), GNOME_STRONGHOLD(Banks.GNOME_STRONGHOLD), ARDOUNGE_NORTH(Banks.ARDOUGNE_NORTH), ARDOUNE_SOUTH(Banks.ARDOUGNE_SOUTH), CASTLE_WARS(Banks.CASTLE_WARS), DUEL_ARENA(Banks.DUEL_ARENA), PEST_CONTROL(Banks.PEST_CONTROL), CANIFIS(Banks.CANIFIS), TZHAAR(Banks.TZHAAR); private final Area area; WebBank(Area area) { this.area = area; } public static WebBank getNearest(Script script) { WebBank bank = null; int distance = Integer.MAX_VALUE; for (WebBank b : WebBank.values()) { final int bDistance = b.area.getRandomPosition().distance(script.myPosition()); if (bDistance < distance) { distance = bDistance; bank = b; } } return bank; } public Position getRandomPosition() { return area.getRandomPosition(); } public Area getArea() { return area; } } have fun
×
×
  • Create New...