Posted 10 April 2012 - 10:20 PM
i'm having trubble with a GUI menu when i try to run the help program it will not run and its there in the dir but it will not run it it just dos nothing but yet the shutdown and reboot works can eny 1 help
sid = 0
function menu(id, text)
if sid == id then
write(">>")
else
write(" ")
end
print(text)
end
while true do
term.clear()
term.setCursorPos(1,1)
shell.run("id")
term.setCursorPos(34,1)
write("iCube v0.1_alpha")
term.setCursorPos(14,6)
write("+——————–+")
term.setCursorPos(14,7)
write("|")
menu(0,"Download Center |")
term.setCursorPos(14,8)
write("|")
menu(1,"Programs |")
term.setCursorPos(14,9)
write("|")
menu(2,"Restart |")
term.setCursorPos(14,10)
write("|")
menu(3,"Shutdown |")
term.setCursorPos(14,11)
write("|")
menu(4,"Help |")
term.setCursorPos(14,12)
write("+——————–+")
event, key = os.pullEvent("key")
if key == 200 and sid > 0 then sid = sid - 1
elseif key == 208 and sid < 4 then sid = sid + 1
elseif key == 28 then
if sid == 0 then shell.run("ICO/root/downloadc")
elseif sid == 1 then shell.run("ICO/root/programs")
elseif sid == 2 then os.reboot()
elseif sid == 3 then os.shutdown()
elseif sid == 4 then shell.run("ICO/root/help")
end
end
end
sid = 0
function menu(id, text)
if sid == id then
write(">>")
else
write(" ")
end
print(text)
end
while true do
term.clear()
term.setCursorPos(1,1)
shell.run("id")
term.setCursorPos(34,1)
write("iCube v0.1_alpha")
term.setCursorPos(14,6)
write("+——————–+")
term.setCursorPos(14,7)
write("|")
menu(0,"Download Center |")
term.setCursorPos(14,8)
write("|")
menu(1,"Programs |")
term.setCursorPos(14,9)
write("|")
menu(2,"Restart |")
term.setCursorPos(14,10)
write("|")
menu(3,"Shutdown |")
term.setCursorPos(14,11)
write("|")
menu(4,"Help |")
term.setCursorPos(14,12)
write("+——————–+")
event, key = os.pullEvent("key")
if key == 200 and sid > 0 then sid = sid - 1
elseif key == 208 and sid < 4 then sid = sid + 1
elseif key == 28 then
if sid == 0 then shell.run("ICO/root/downloadc")
elseif sid == 1 then shell.run("ICO/root/programs")
elseif sid == 2 then os.reboot()
elseif sid == 3 then os.shutdown()
elseif sid == 4 then shell.run("ICO/root/help")
end
end
end