Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2008, 09:00 AM
narcberry
Sarnak
 
Join Date: Mar 2005
Location: Idaho, USA
Posts: 94
Default quest::delay(time)

I need a quest delay mechanism. Here is what I've learned:

quest::pause() does not work how I need, I'm unsure what it is for, probably for movement and waypoints.

perls built in sleep() function doesn't work when invoked by eqemu, I'm unsure why that is.

using the quest timers works, but I lose my reference to the pc that invoked the quest for some reason.


I've found 2 solutions in my searching, both years old. Scorpius2K customized their server to add a delay function, but it wasn't added into the eqemu source, and I have no idea what they did. The other was a while loop that iterated some million times to get a 10 second delay. I'm not a real fan of that solution.

If anyone has any ideas, or corrections to what I have encountered let me know. If I'm being retarded, I hope you wouldn't hesitate to tell me.
__________________
Thanks for answering my questions.
My Website
Reply With Quote
  #2  
Old 01-30-2008, 01:56 PM
Theeper
Discordant
 
Join Date: May 2004
Posts: 290
Default

I am not sure of exactly what you need, but I use quest::settimer() and haven't noticed any problems with it losing track of the invoking PC.

Here is how I have used it in a couple custom scripts that seem to work fine for me on a 1085 build.

Code:
sub EVENT_SPAWN 
{
      quest::settimer("my_timer", 10);
}

sub EVENT_SAY 
{
	if ($text =~ /my timer/i) 
	{
	quest::say("Starting 10 sec timer for $name.");
	quest::settimer("my_timer", 10);
	}
}

sub EVENT_TIMER 
{
	if($timer eq "my_timer") 
	{
	quest::say("time is up for $name");
	quest::stoptimer("my_timer");
	}
}
Reply With Quote
  #3  
Old 01-31-2008, 03:08 AM
narcberry
Sarnak
 
Join Date: Mar 2005
Location: Idaho, USA
Posts: 94
Default

In the event, I was trying to do a quest::movepc without success.

I now use
Code:
sub delay{
   $delayOver = (time + @_[0]);
   while (time < $delayOver){}
   1;
}
and call with
Code:
delay(seconds);
yeah, that is a while loop. yeah, it's icky. yeah, it's my permanent solution.
__________________
Thanks for answering my questions.
My Website
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:58 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3