diff --git a/src/startup.lua b/src/startup.lua new file mode 100644 index 0000000..0011728 --- /dev/null +++ b/src/startup.lua @@ -0,0 +1,21 @@ +-- 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