This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
jmuirhead's profile picture

Looking for at least a 5 options GUI menu for startup

Started by jmuirhead, 23 July 2012 - 10:22 PM
jmuirhead #1
Posted 24 July 2012 - 12:22 AM
I have a tekkit server and i want a GUI in the center screen but i dont know how to make one please help me im looking for one with at lease 5 options please help.
jmuirhead #2
Posted 24 July 2012 - 12:39 AM
hers what i got so far on my own but i cant figure out what wrong with it

sid = 0

function clear()
ter.cleat()
term.setCursorPos(1,1)
end

function menu(id, text)
if sid == id then
write"> "
else
write"*"
end
print(text)
end

while true do
clear()
menu(0, "reboot")
menu(1,"shutdown")
event,key = os.pullEvent("key")
if key == 200 then
if sid > 0 then
sid = sid - 1
end
elseif key == 208 then
if sid < 1 then
sid = sid + 1
end
elseif key == 28 then
if sid == 0 then
os.reboot()
elseif sid == 1 then
os.shutdown
end
end
end
flaminsnowman99 #3
Posted 24 July 2012 - 02:53 AM
while true do
term.clear()
term.setCursorPos(1,1)
print("Welcome to my menu")
print("Option 1")
print("Option 2")
print("Option 3")
print("Option 4")
print("Option 5")
e, p = os.pullEvent()
if e == "char" then
if p == "1" then
--do something
elseif p == "2" then
--do something
elseif p == "3" then
--do something
elseif p == "4" then
--do something
elseif p == "5" then
--do something
end
end
end