Created
July 29, 2015 14:13
-
-
Save CansecoDev/69c53e28b208645fd0aa to your computer and use it in GitHub Desktop.
TShock JIST script made to work in combination with STime to set real time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setSTime(t) { | |
tshock_exec(tshock_server(), "/stime " + t); | |
} | |
function addZero(i) { | |
if (i < 10) { | |
i = "0" + i; | |
} | |
return i; | |
} | |
function getRealtime() { | |
var d = new Date(); | |
var h = addZero(d.getHours()); | |
var m = addZero(d.getMinutes()); | |
var t = h + ":" + m; | |
return t; | |
} | |
jist_task_queue(0, 0, 1, function() { | |
var xt = getRealtime(); | |
setSTime(xt); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment