Thread: Repeating chat?
View Single Post
  #12  
Old 06-07-2012, 07:47 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
You may also be interested in making this a bit more flexible using arrays.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
// Create an array with a value for each message desired
  
this.messages = {
    
"message one!",
    
"message two!",
    
"message three!",
    
"message four!"
  
};

  
// Initiate the timeout loop
  
onTimeout();
}

function 
onTimeout() {
  
// Loop through each item in this.messages array
  // for (var : array) will loop through 'array' and execute the code for each value
  
for (temp.this.messages) {
    
player.chat temp.i;
    
sleep(3);
  }
  
// Restart the loop
  
setTimer(3);

With such an approach all you'd have to do is add more messages to the array to create a larger loop.
Reply With Quote