cc-haxe/src/startup.lua

22 lines
490 B
Lua
Raw Normal View History

2023-07-27 18:15:41 +00:00
-- Check for startup enable flag
if redstone.getInput("top") then
local fd = fs.open("/haxe.lua", "r")
local haxe = fd.readAll()
fd.close()
local make = dofile("rom/modules/main/cc/require.lua").make
local env = {}
env.require, env.package = make(env, "/")
env = setmetatable(env, { __index = _G })
local f,err = load(haxe,"Haxe",nil,env)
if err then
print("Error loading Haxe: " .. err)
else
f()
os.reboot()
end
end