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

Using a Menu to display information

Started by Maccyjam, 15 April 2012 - 03:37 PM
Maccyjam #1
Posted 15 April 2012 - 05:37 PM
Hey,
I've been following the Yes/No Menu tutorial found at http://www.computercraft.info/forums2/index.php?/topic/744-a-quick-guide-through-menu-making/.
It's a great tutorial but I'm unsure where to go from now. How will I display (different) information depending on the selection that the user makes?
Sorry for the nooby question :)/>/>
Thanks in advance,
Kolpa #2
Posted 15 April 2012 - 07:40 PM
Hey,
I've been following the Yes/No Menu tutorial found at http://www.computerc...gh-menu-making/.
It's a great tutorial but I'm unsure where to go from now. How will I display (different) information depending on the selection that the user makes?
Sorry for the nooby question :)/>/>
Thanks in advance,

u call the function in an if dialoge and print in response like this (assuming ur using the same names:) )

local a = yN()
if a == true then
print("u choose yes")
else
print("u choose no")
end
Maccyjam #3
Posted 15 April 2012 - 08:08 PM
Thanks for that, it works great! :)/>/>
I don't suppose you know how to make the menu repeat after the information has been printed rather than exiting out of the program?
Kolpa #4
Posted 15 April 2012 - 08:10 PM
Thanks for that, it works great! :)/>/>
I don't suppose you know how to make the menu repeat after the information has been printed rather than exiting out of the program?

well quite i do :)/>/>

just do it in a loop like this:
while true do
local a = yN()
if a == true then
print("u choose yes")
else
print("u choose no")
end
end

and ziinnngg u have a infinite loop of the menu
Maccyjam #5
Posted 15 April 2012 - 08:27 PM
That's perfect, thanks again!
A final (I Hope) question, is it possible to colour text? I'm thinking it isn't, but I've seen screenshots with some text in green so was curious.
Kolpa #6
Posted 15 April 2012 - 08:49 PM
That's perfect, thanks again!
A final (I Hope) question, is it possible to colour text? I'm thinking it isn't, but I've seen screenshots with some text in green so was curious.
well it is using the minecraft font i think so if u color that it shoud color the cmd :)/>/>
Maccyjam #7
Posted 15 April 2012 - 09:25 PM
Ah, okay, awesome.
Thanks so much for your help! :)/>/>