Jump to content

Event stuck in QUEUED


goldKeeper

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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