27 lines
528 B
JavaScript
27 lines
528 B
JavaScript
// ########################################
|
|
// ########## MAIN ##########
|
|
// ########################################
|
|
|
|
|
|
const system = require("System");
|
|
|
|
module.exports.loop = function () {
|
|
if(!global.compiled) onRecompile();
|
|
else if (!global.started) onRestart();
|
|
else onTick();
|
|
}
|
|
|
|
function onRecompile(){
|
|
system.setup();
|
|
console.log("Script recompiled...");
|
|
global.compiled = true;
|
|
}
|
|
|
|
function onRestart(){
|
|
system.begin();
|
|
global.started = true;
|
|
}
|
|
|
|
function onTick(){
|
|
system.tick();
|
|
} |