How do I add a wait time to a plugin?

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
L4M3573R
Human
Human
Posts: 37
Joined: 24 Apr 2008, 16:15

How do I add a wait time to a plugin?

#1 Post by L4M3573R »

I don't know anything about the plugins(not that I haven't tried to use them...just I don't understand it). How would I add a wait time before the plugin initializes? I'm trying to add a 15 second wait time to cmdOnLogin before it does the commands.

flashdbest
Plain Yogurt
Plain Yogurt
Posts: 61
Joined: 12 Nov 2012, 09:22
Noob?: Yes

Re: How do I add a wait time to a plugin?

#2 Post by flashdbest »

sleep(15);

L4M3573R
Human
Human
Posts: 37
Joined: 24 Apr 2008, 16:15

Re: How do I add a wait time to a plugin?

#3 Post by L4M3573R »

Where on the plugin do I put it? I tried placing it in a few places and it made Openkore freeze for 15 seconds before the login.
Also would I be able to change it from on login to on login and respawn?

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: How do I add a wait time to a plugin?

#4 Post by EternalHarvest »

sleep() is not a good idea because it would stop everything.

Spawning Task::Timeout with your function should do, like in Actor::setStatus.

L4M3573R
Human
Human
Posts: 37
Joined: 24 Apr 2008, 16:15

Re: How do I add a wait time to a plugin?

#5 Post by L4M3573R »

Sure....nevermind I don't need the help....aparently you get warnings for asking for help.

Locked