Jump to content

FrostBug

Scripter III
  • Posts

    3967
  • Joined

  • Last visited

  • Days Won

    5
  • Feedback

    100%

Everything posted by FrostBug

  1. The default instances of Bank, Inventory, Equipment etc. will never be null, so you don't need to nullcheck them. "getInventory()" versus "inventory" is a matter of personal preference/convention. getInventory merely returns the inventory instance. It is the exact same thing.
  2. It would have worked even if it was an interface. But yeah, any method defined in the superclass can be invoked on the subclass instances, even if the static type is the superclass.
  3. Perhaps the walking distance threshhold is messing with you. There's a default distance threshhold in the localwalker (idr what it is exactly) at which it wont try walking to the destination if you're within that accepted distance (6 tiles for example) To see if this is the problem, try manually lowering the distance threshhold. Eg. WalkingEvent wEvt = new WalkingEvent(bankPos); wEvt.setMinDistanceThreshhold(0); execute(wExt); In any case, it's not related to your paint
  4. getItemInSlot simply returns an Item instance. Item does not contain any information about which slot it was retrieved from. So when you try to interact with that item, it will simply use the first one it finds. What you need to use is the overload of interact that takes a slot id as parameter eg. getInventory().interact(14, "Use");
  5. You're passing null to the invokeLater method, since initSettings returns null as a runnable. Just create a new runnable that invokes initSettings. eg. public void onStart() { EventQueue.invokeLater(() -> initSettings()); } ^ using a lambda expression, so make sure you're on source 8
  6. D med helms should be fine once more.
  7. Just use ItemContainer in the method signature. eg. public int getOreCount(ItemContainer container, int... ids) { return container.getAmount(ids); } and use it like so: int invCoal = getOreCount(inventory, 453, 454); int bankIron = getOreCount(bank, 440, 441); the methods getAmount, getItems, contains etc. etc. are defined in the superclass, however if overridden in the subclass, invoking the method will still work even if your reference has the superclass as static type. In other words, these are the same: getInventory().getAmount(id); ((ItemContainer)getInventory()).getAmount(id);
  8. The getItems method is declared in the ItemContainer superclass. There's no need for generics Generics are generally bad for performance (unless the compiler sees that it's silly and removes it), so try avoiding them where they're redundant
  9. That indentation gave me cancer Also, why are you using generics in that method? It's entirely redundant from what I can tell. Anyway; the problem is probably that you need to nullcheck the items here: for (Item i : Items) { if (i.getId() == 440 || i.getId() == 441) Regardless, using getInventory().getAmount(440, 441); would be quite a bit cleaner
  10. The class must be public in order for the Script Executor to access the default constructor. Add the public keyword to the class signature
  11. Yes, if you do that, you will be overriding the onStart method from the Script class. This overridden method will be invoked by the script executor on script start.
  12. Not sure where you've gotten this from; but onStart(Runnable runnable) isn't defined in script, and doesn't seem to be called at all. So your init stuff is never executed. That's a problem; tho I don't really know why the exception indicates the lack of a parameter-less constructor
  13. Show us the stacktrace Are you certain that your itemContainer instance isn't null?
  14. FrostBug

    Hotkeys

    A useful tool if you need quick reactions or whatnot.
  15. Be sure to reset your camera zoom to default before starting the script Reason for stopping is stated in the script log and client console.
  16. So uh, there's a problem with using Dragon med helm right now it seems. If you're experiencing problems, use a different helm until I get this resolved
  17. It's down there.. But it's probably not gonna be soon, since I'm busy with work for the time being.
  18. As I've said twice before. If someone lends me an account that has them, I will check out if its doable within reasonable effort. The route isn't faster or better than routes that utilize minigame teleport and CW/tabs, so I see no urgent need for this
  19. Been doing test runs on both mirror and standard for about 3 hours now.. no problems yet.
  20. Are you using client version 2.3.101? The bug with not responding to enemy attackers was fixed in 2.3.101
  21. Are these bugs occuring in mirror mode only? I'll be on to do some tests in about 2 hours
  22. Pein u r noob

  23. Updated to avoid worlds that you do not have the total level to use
  24. The signature for the interact method you're trying to use is: public boolean interact(java.lang.String action, java.lang.String... names) Which means that what you're doing is trying to select the action "Tinderbox" on the item "Use" Swap these around and you should be good.
×
×
  • Create New...