Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 07-18-2013, 10:46 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
I suspect you are using a timeout loop. Sleep will stop a timeout loop if a fuction is triggered from an outside function of the loop. Might be able to save some lines if simply add an adding number and either a if-else block, for loop, or a switch statement.

PHP Code:
function onCreated()
{

  
this.chatText = { "Blah0""Blah1""Blah2"}; // For second method

}

function 
onTimeout()
{

  
this.++;
  
//Then either
  
if ( this.== 0Blah0;
  else if ( 
this.== 0Blah1;
  else 
Blah2;
  
// or
  
for ( temp.0temp.3temp.++;)
  {
    
this.chat this.chatTexttemp.i];
    
sleep0.15); // assuming your time out is 0.05
  
}
  
// or finaly
  
switch ( this.i)
  {
    case 
0Blah0; break;
    case 
1Blah1; break;
    case 
2Blah2; break;
  }
  
  

  
setTimer0.05);


Just remember for these method you will have to add the extra sleep( 0.15); within those to extend the waiting for the time out. Which using the sleep in the timeout might be detrimental in what you are trying to do. Using scheduleEvent, catchEvent, or waitfor as Emera demonstrated would be best without breaking or delaying the timeout.
__________________
Deep into the Darkness peering...
Reply With Quote
 


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 05:10 AM.


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