goldKeeper Posted April 15, 2018 Share Posted April 15, 2018 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. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted April 16, 2018 Share Posted April 16, 2018 Sounds like the EventExecutor is busy running other events that are never completing. Your custom loginhandler maybe? Quote Link to comment Share on other sites More sharing options...
goldKeeper Posted April 16, 2018 Author Share Posted April 16, 2018 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. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted April 16, 2018 Share Posted April 16, 2018 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 Quote Link to comment Share on other sites More sharing options...
goldKeeper Posted April 16, 2018 Author Share Posted April 16, 2018 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. Quote Link to comment Share on other sites More sharing options...