View Single Post
  #5  
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