Jump to content

Swizzbeat

Members
  • Posts

    7986
  • Joined

  • Last visited

  • Days Won

    58
  • Feedback

    100%

Everything posted by Swizzbeat

  1. The only times I've ever used "injection" (if you even want to call it that) has been setting instance variables to my own modified classes. I'm still pretty new to programming in general, thanks for clearing that up for me
  2. I have no life, nor friends, nor loved ones. You misspelled sA (what you meant to type) in the Node constructor argument. Right now you're just assigning the instance variable sA a reference to itself which is, of course, null.
  3. return sA.client.getLocalNPCs().contains("Banker"); Not sure if you meant this or not, but you're checking if a list of NPC objects contains a String. As for the NPE, show us your abstract Node class.
  4. You can't have injection without reflection lol. OP looks good
  5. Swizzbeat

    Herb Data

    StringBuilder takes a String argument.
  6. Swizzbeat

    Herb Data

    Well they're not really comparable as they do completely separate things. I'm just saying it's more efficient to use a StringBuilder object when doing multiple operations on a String rather than modify it and litter the stack with unneeded variables. Also, why didn't you just make a String variable to store the name of the enum instead of calling the #name() method twice?
  7. Swizzbeat

    Herb Data

    The code I posted returns the same exact String and is more efficient. You're calling the #name() method twice as well as creating additional String objects while mine only uses only a single StringBuilder. Strings are immutable, which means any operation on them creates an entirely new String instance (leaving the other to be garbage collected).
  8. Now look at developers section/tracker.
  9. It was easy to create a flawless script back in the days because the bot itself took care of most of the work for the scripter. Now it's entirely possible to design a fully functioning script however there is a lot more work required to make it perfect.
  10. Wait I thought you had to be OSD for stakers?
  11. Why loop through every interface when there's a more efficient way? Besides, you don't have a "Click here to continue" option when selecting a response.
  12. Swizzbeat

    Herb Data

    There's no reason to have an empty default constructor, and your toString could be a lot cleaner and efficient: @Override public String toString() { final StringBuilder sb = new StringBuilder(super.toString()); return sb.charAt(0) + sb.substring(1).toLowerCase().replace("_", " "); }
  13. Dunno, I forget the exact formula for getting menu destinations.
  14. final Inventory inven = client.getInventory(); for (final Item item : inven.getItems()) { if (item != null && Arrays.asList(item.getDefinition().getActions()).contains("Drop")) { inven.interactWithId(item.getId(), "Drop"); } } Wrote in 5 seconds without IDE.
  15. It's probably throwing an exception since you're invoking #isVisible() on a null instance. Create an RS2Interface object like so: final RS2Interface parent = client.getInterface(469); and do a null check on it before doing any type of interaction/method.
  16. Where is @Peter? And yes he is ex-staff. Legit staff, not cba.
  17. 150+ iterations per script loop. Oh my fucking lel. OT goodluck but I'm 99% sure there's going to be an official OSBot rule added limiting the amount of SSF advertisements
  18. Could you maybe have an option to just reload local scripts? It's annoying having to wait 10 seconds while it connects to the server while I only want to test something out.
  19. Did you post this elsewhere on the site? If not I guess someone else modified it for OS as well, because I have the OS version on my comp.
  20. This is Enfilade's from p****bot.
  21. Swizzbeat

    Requesting Sig

    Nick Took me about an hour to decide on the perfect color so I hope it wasn't for nothing
×
×
  • Create New...