April 15, 20187 yr So I am currently trying to create an event that runs all the time I created a class that extends 'Event' I created an instance of the class, initialized it and then called the execute method with the object. As you can see here: event = new MyEventClass(); event.exchangeContext(bot); event.setAsync(); execute(event); this piece of code is called in the 'onStart()' method of the script. the execute method of the event consists of the following code: @Override public int execute() throws InterruptedException { log("checking for threat"); if (hasThreat()) { log("has threat. Hopping!"); interruptAnyActions(); hopToNonPVPWorld(); } return random(100, 200); } I am calling the 'event.getStatus()' method in my 'onLoop()' method which outputs the following: [INFO][Bot #1][04/15 08:13:55 PM]: QUEUED [INFO][Bot #1][04/15 08:13:56 PM]: QUEUED [INFO][Bot #1][04/15 08:13:58 PM]: QUEUED [INFO][Bot #1][04/15 08:13:59 PM]: QUEUED [INFO][Bot #1][04/15 08:14:00 PM]: QUEUED [INFO][Bot #1][04/15 08:14:01 PM]: QUEUED So somehow, the execution doesn't start but I have no idea why. My custom login event also basically uses the same 'settings' but works flawlessly. It's just that this event doesn't want to work.
April 16, 20187 yr Sounds like the EventExecutor is busy running other events that are never completing. Your custom loginhandler maybe?
April 16, 20187 yr Author The event had the exact same behavior before I even added the loginhandler. Furthermore, it also gets called before the login handler but still never gets executed.
April 16, 20187 yr 1 hour ago, goldKeeper said: The event had the exact same behavior before I even added the loginhandler. Furthermore, it also gets called before the login handler but still never gets executed. Try running the client in debug mode to see if any errors are thrown in onStart as you submit the event. Also, there's no need to call exchangeContext. This is done internally by the EventExecutor
April 16, 20187 yr Author worked around it with a thread that runs all the time. Whenever i come across this again I will try what you just said though.
Create an account or sign in to comment