Jump to content

Event stuck in QUEUED


Recommended Posts

Posted

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.

Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...