Jump to content

HunterRS

Scripter I
  • Posts

    479
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by HunterRS

  1. Nice work, no need get the bank booth as an object, use getBank().open() instead. Also add some verifications, instead of: if (bank.isOpen()) { bank.depositAll(); } Do something like: if (bank.isOpen()) { if(bank.depositAll()) { //Here you should sleep untill inventory is empty } } Do stuff like this throughout your code. Also, in the confitional sleep in the bank method you use: return bank.isOpen() && getInventory().isEmpty(); When sleeping after just opening the bank, seperate this to just bank.isOpen() and then later verify the inventory is empty. The way it is now I am pretty sure it will always sleep on the first time you one the bank.
  2. hunter#8066
  3. Only with a private script/farm manager
  4. It does sometimes missclick, what I do is simply recall it untill you reach the correct position.
  5. Try using this with a random pos in the wanted area: private static boolean walkExact(Script script, Position position) { WalkingEvent event = new WalkingEvent(position); event.setMinDistanceThreshold(0); return script.execute(event).hasFinished(); }
  6. Filter<Item> prayerPotFilter = item -> item.getName().contains("Prayer potion("); . . . . if (getInventory().contains(prayerPotFilter)) { log("We have a prayer potion"); } This should work, play around with filters and the API, super usefull stuff.
  7. Try looking into filters too: Filter<NPC> goblinFilter = npc -> npc.getName().equalsIgnoreCase("Goblin") && myPlayer().getArea(1).contains(npc) && !npc.isHitBarVisible() && npc.isAttackable() && !npc.isUnderAttack() && npc.isVisible(); . . . . NPC goblin = getNpcs().closest(goblinFilter); Using them will result in cleaner code. EDIT: Don't just copy and paste this, i just threw a couple of methods of the top of my head.
  8. You want to get the current level of a specific skill, look at getDynamic or getStatic depending on your exact need.
  9. Just some little quick advice on top of what dozza wrote, Reusing code is a great thing, my advice though when rewriting a script is to maximazie your learning by only using your old code as a guide line for areas, method etc. Have your code open on one side and on the other start the rewrite, we have all done this at one point when we said "who is the fucking dumbass who wrote this, ohh wait me", in my opinion this is the goal of rewriting a script because you can improve a lot when learning from your old mistakes. Just my opinion. Great improvement on the script though, keep it up. (Also it does a apply a bit less if your goal isn't to improve but to get a working product as fast as possible)
×
×
  • Create New...