Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • 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/Crypto gold? You can purchase vouchers from other users
  • Implementing listeners


    Scorpius

    Recommended Posts

    Why do you need to put a listener on a task node? What're you trying to accomplish?

    I'm putting many different scripts into 1 big, I thought about making the controller as a TaskScript and the scripts as TaskNodes.

    I overcame that issue by implementing listeners on the TaskScript and created a new abstract class that extends TaskNode, then I created a variable (that has the abstract class as its type) inside the TaskScript that holds the required (As selected by user from a GUI) TaskNode... Then simply whenever a listener fires I'd call a method from the "AbstractClass" variable that I am overriding inside the actual TaskNode... This way I'm avoiding creating different variables for each TaskNode and detecting which one to use.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.