Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-21-2012, 03:26 AM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Alternative to sleep()

I was wondering if there was an alternative to the sleep() function.

If I'm not mistaken, sleep pretty much just pauses the functions of the script.

DoThis;
DoThat;
sleep(1); <-- pauses for one second
DoSomethingElse;

I know it's a dumb question but I'm running into problems in my movement using sleep so I need another code that pauses a line in script.
Reply With Quote
  #2  
Old 12-21-2012, 03:51 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Post your code? The only thing I can think of is that you're not taking into account that sleep drops player scope (i.e. you can't reference the player via "player" after sleep or waitfor).
__________________
Reply With Quote
  #3  
Old 12-21-2012, 04:56 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Try this.
PHP Code:
temp.time 4//The time in seconds to "sleep".
waitfor(this"nothing"time); 
Doing this will pause at the current code block but I think will still continue to execute any scheduleevents or timeouts.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
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 +2. The time now is 12:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.