···11---[[
22- Jericho's time script -- https://github.com/Jericho1060
33- Display IRL time in game
44- https://github.com/Jericho1060/DualUniverse/blob/master/TimeScript/IRLHourScript.lua
55-]]--
66-77-88-summer_time = false --export
99-1010-function getTimeTable(time)
1111- local additionnal_hour = 0
1212- if summer_time then additionnal_hour = 1 end
1313- local T = math.floor(time) % (3600*24)
1414- return {math.floor(T/3600+additionnal_hour)%24, math.floor(T%3600/60), math.floor(T%60)}
1515-end
1616-1717-function getTimeString(time)
1818- local timeTable = getTimeTable(time)
1919- return string.format("%02d:%02d:%02d",timeTable[1],timeTable[2],timeTable[3])
2020-end
2121-2222-2323---[[
2424- USAGE
2525- Copy the full script in Library > Start
2626-2727- local timeTable = getTimeTable(system.getTime()) -- return a table with 3 values : {hour, minutes, seconds}
2828- local timeString = getTimeString(system.getTime()) -- return a formated string : "HH:mm:ss"
2929-3030- you can add a timer every seconds to display the time
3131-]]--
-26
tools/console text colors.lua
···11---[[
22- Jericho's system.print() extension -- https://github.com/Jericho1060
33- Display content in lua chat channel with colors
44- Source : https://github.com/Jericho1060/DualUniverse/blob/master/tools/console%20text%20colors.lua
55-]]
66-system.printColor = function(message, color) system.print('<span style="color:' .. color .. ';">' .. message .. '</span>') end
77-system.printPrimary = function(message) system.printColor(message, "#007bff") end
88-system.printSecondary = function(message) system.printColor(message, "#6c757d") end
99-system.printSuccess = function (message) system.printColor(message, "#28a745") end
1010-system.printDanger = function (message) system.printColor(message, "#dc3545") end
1111-system.printWarning = function (message) system.printColor(message, "#ffc107") end
1212-system.printInfo = function (message) system.printColor(message, "#17a2b8") end
1313-1414---[[
1515- USAGE
1616- if you want some standard bootstrap colors you can use these methods
1717- system.printPrimary("test Primary")
1818- system.printSecondary("test Secondary")
1919- system.printSuccess("test Success")
2020- system.printDanger("test Danger")
2121- system.printWarning("test Warning")
2222- system.printInfo("test Info")
2323-2424- if you want to use a custom color :
2525- system.printColor("test color", "red") --eg for red, you can also use any HTML Hex color code
2626-]]