overte-lubosz/script-archive/example/messages/messagesTestSend.js
2016-04-26 11:18:22 -07:00

18 lines
No EOL
359 B
JavaScript

var messageIndex = 1;
var messageRate = 500;
function sendMessage(){
print('SENDING MESSAGE')
Messages.sendMessage('messageTest',messageIndex)
messageIndex++;
}
function cleanup(){
Script.clearInterval(messageInterval);
}
var messageInterval = Script.setInterval(function(){
sendMessage();
},messageRate);
Script.scriptEnding.connect(cleanup);