Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Make sure you have Java installed
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Neffarion

    Scripter++
    • Content Count

      1536
    • Joined

    • Last visited

    • Days Won

      6

    Neffarion last won the day on January 24

    Neffarion had the most liked content!

    About Neffarion

    Contributor

    Contact Methods

    • Website URL
      https://www.neffware.com
    • Discord
      Neffarion#0001

    Profile Information

    • Gender
      Male
    • Location
       Europe

    Recent Profile Visitors

    7115 profile views
    1. Your welcome Yes, its cleaner and simply moves some of that "irrelevant" code from the event listener logic to the wrapper
    2. Yes You should try to do it as I did in the example in the main post, that way you can do only scan -> compare -> sleep (the first time it runs it won't trigger anything but that isn't really relevant as it is runs often, and you are probably not needing it at that point so early) For your problem I wouldn't personally use a listener as you can just save the npc when you attack and check for movement while you wait for it to kill it
    3. Okay so you have some things you have done wrong, firstly you don't need a wrapper for this at all, passing an NPC to the listener methods is enough Secondly, you shouldn't filter the NPC's name here, that is done within the script when your npcFight gets called afterwards (think of the listener as being independent of your script) Make sure you null check the npc's and npc list List<Tile> startingTile = new ArrayList<>(); List<NPC> npcs = NPCs.all(g -> g != null && g.getName().equals(npcStringName)); if(npcs != null){ for (NPC n : npcs) { starting
    4. thats most likely your event listener logic that is returning a null list, show us the code also if you want an npc listener you should probably just pass a single npc
    5. You can just create it on the AbstractScript itself for example for simplicity Alright, well this is very simple but for example, if you are waiting for a specific item to be bought you can make something like public class Script extends AbstractScript implements GrandExchangeListener { private final int wantedItemID = 3333; private boolean itemBought = false; @Override public void onStart() { ListenerManager.getInstance().addListener(new GrandExchangeEvent(this)); } @Override public int onLoop() { if(this.itemBought){ // collec
    6. There's no current way to do this, I might add it soon Not planning on adding this right now sorry
    7. The onLoop is independent of the listener methods. If you want to use the npc list on the onloop then you need to have a global variable that holds the values you want, update it on that new listener method and use it on the onLoop
    8. No. You are passing a null check into the filter of GameObjects.closest() If there are no gameobjects that respect that filter then the result of Edge will be null. So you need to check if Edge is null afterwards: if (House.contains(getLocalPlayer()) && Edge != null && Edge.interact("Edgeville")) { sleepUntil(() -> Edgeville.contains(Client.getLocalPlayer()), Calculations.random(5000,8000)); }
    9. Make sure you null check "Edge" because it will be null if it has not loaded the gameobject yet (or it isnt nearby)
    10. Its ChatListener now instead of AdvancedMessageListener
    11. You are probably behind some kind of firewall
    12. You can go to the script store, search the script and click on "Try" to get a free trial
    13. I have sent update, please wait a day for it to be approved. Let me know afterwards if it happens again
    ×
    ×
    • Create New...