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

menu

Started by zedmekis, 26 June 2012 - 08:29 AM
zedmekis #1
Posted 26 June 2012 - 10:29 AM
Hi I know I'm new on the forum, but I've tried to find the code I'm looking for without any result.
To make it shot, I'm trying to make a multi-menu with a return to main menu possibilities.



--mai menu
term.setCursorPos(16,1)
print ("Menu ")
term.setCursorPos(1,5)
print ("choice 1: 1")
print ("")
print ("choice 2   : 2")
print ("")
print ("choice 3 : 3")
print ("")
print ("choice : 4")
print ("")
write ("choice : ")
local choice  = read ()
if choice == "1"

then
action
aciton
aciton
[b]automatic return to main menu[/b]


The problem is, I'm trying to make a "return" to the main menu after all my action's done, But I just don't find anything to do that.
So, if anyone has an Idea please let my know.

thx
eddieo #2
Posted 26 June 2012 - 11:35 AM
check this link it will help

http://www.computercraft.info/forums2/index.php?/topic/2116-user-friendly-menu/
Exerro #3
Posted 26 June 2012 - 05:10 PM
put while true do at the start and end at the end and It will keep looping to the start
zedmekis #4
Posted 27 June 2012 - 12:59 AM
thx a lot both of you now my program work great