.
This commit is contained in:
parent
e05b9bff5d
commit
987d6b6d3f
@ -45,8 +45,8 @@ function submit(text)
|
|||||||
setup_variables()
|
setup_variables()
|
||||||
|
|
||||||
document.log.caret = -1
|
document.log.caret = -1
|
||||||
local status, result = pcall(function() return console.execute(text) end)
|
local status, result = pcall(console.execute, text)
|
||||||
if result ~= nil then
|
if result then
|
||||||
console.log(result)
|
console.log(result)
|
||||||
end
|
end
|
||||||
document.prompt.text = ""
|
document.prompt.text = ""
|
||||||
|
|||||||
@ -69,6 +69,21 @@ console.add_command(
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local function FormattedTime(seconds, format ) -- from gmod
|
||||||
|
if not seconds then seconds = 0 end
|
||||||
|
|
||||||
|
local hours = math.floor(seconds / 3600)
|
||||||
|
local minutes = math.floor((seconds / 60) % 60)
|
||||||
|
local millisecs = (seconds - math.floor(seconds)) * 100
|
||||||
|
seconds = math.floor(seconds % 60)
|
||||||
|
|
||||||
|
if format then
|
||||||
|
return string.format(format, minutes, seconds, millisecs)
|
||||||
|
else
|
||||||
|
return {h = hours, m = minutes, s = seconds, ms = millisecs}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
console.add_command(
|
console.add_command(
|
||||||
"time.uptime",
|
"time.uptime",
|
||||||
"Get time elapsed since the engine started",
|
"Get time elapsed since the engine started",
|
||||||
@ -76,7 +91,7 @@ console.add_command(
|
|||||||
local uptime = time.uptime()
|
local uptime = time.uptime()
|
||||||
local formatted_uptime = ""
|
local formatted_uptime = ""
|
||||||
|
|
||||||
local t = string.FormattedTime(uptime)
|
local t = FormattedTime(uptime)
|
||||||
|
|
||||||
formatted_uptime = t.h .. "h " .. t.m .. "m " .. t.s .. "s"
|
formatted_uptime = t.h .. "h " .. t.m .. "m " .. t.s .. "s"
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ function parse_path(path)
|
|||||||
end
|
end
|
||||||
|
|
||||||
package = {
|
package = {
|
||||||
loaded = {}
|
loaded={}
|
||||||
}
|
}
|
||||||
local __cached_scripts = {}
|
local __cached_scripts = {}
|
||||||
|
|
||||||
@ -285,13 +285,7 @@ entities.get_all = function(uids)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
------------------ sekta helpers
|
math.randomseed(time.uptime()*1536227939)
|
||||||
|
|
||||||
require("core:internal/math")
|
|
||||||
require("core:internal/string")
|
|
||||||
require("core:internal/table")
|
|
||||||
|
|
||||||
math.randomseed(time.uptime() * 1536227939)
|
|
||||||
|
|
||||||
-- --------- Deprecated functions ------ --
|
-- --------- Deprecated functions ------ --
|
||||||
block_index = block.index
|
block_index = block.index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user