trainworld_computercraft/computer/20/startup.lua
2025-06-01 02:23:34 +02:00

59 lines
1.2 KiB
Lua

require("display")
require("menu")
-- fakeread = require("fakeread")
-- robot = peripheral.wrap("animatronic_1")
parallel.waitForAny(menu_gui, display_loop)
return
--[[
display_update_interval = 4
--return
function start_screen()
term.clear()
term.setCursorPos(1, 1)
term.setCursorBlink(true)
print("Welcome to Spudsy's!")
fakeread.hide_input(false)
fakeread.reset_buffer()
fakeread.set_completion(menu_autocomplete)
end
start_screen()
display_timer_id = os.startTimer(display_update_interval)
while true do
local etype, edata = os.pullEventRaw()
if etype == "timer" then
if edata == display_timer_id then
update_display()
display_timer_id = os.startTimer(display_update_interval)
end
elseif etype == "terminate" then
fakeread.hide_input(true)
fakeread.reset_buffer()
fakeread.set_completion(nil)
write("\ninput password to exit: ")
local password
repeat
etype, edata = os.pullEventRaw()
password = fakeread.do_event(etype, edata)
until password
if password == "password" then
print()
break
else
print("\nwrong password")
sleep(2)
start_screen()
end
else
typed = fakeread.do_event(etype, edata)
if typed then
print("")
end
end
end
]]