25 lines
470 B
JavaScript
25 lines
470 B
JavaScript
(function(){
|
|
|
|
var self=this;
|
|
var messageRate = 500;
|
|
|
|
function sendMessage(){
|
|
var d = new Date();
|
|
var n = d.getTime();
|
|
print("SENDER"+n);
|
|
Messages.sendMessage('domainTime',n)
|
|
}
|
|
|
|
this.preload = function(entityID) {
|
|
print("PRELOAD SENDER");
|
|
self.messageInterval = Script.setInterval(function(){
|
|
sendMessage();
|
|
},messageRate);
|
|
};
|
|
|
|
this.unload = function(){
|
|
Script.scriptEnding.connect(self.messageInterval);
|
|
};
|
|
|
|
}
|
|
);
|