Posted 27 May 2017 - 03:25 PM
Hi,
I have used a menu tutorial and it worked. Now I want to extend it.
Original table
And now i want to extend it.
At the end of the script I get a selector variable
So if I choose Menu Option 4 the selector is 4. I want to use this selector now to read the command value "/toggledownfall" and first print it out for testing. Later I will use this at a command computer to execute a command.
How do I do this?
I have used a menu tutorial and it worked. Now I want to extend it.
Original table
local menu_options = { --This is our menu table. It contains basic data about the menu
[1] = {text="Menu Option 1", color=colors.blue},
[2] = {text="Menu Option 2", color=colors.orange},
[3] = {text="Menu Option 3", color=colors.cyan},
[4] = {text="Menu Option 4", color=colors.orange},
}
And now i want to extend it.
local menu_options = { --This is our menu table. It contains basic data about the menu
[1] = {text="Menu Option 1", color=colors.blue, command="/summon ...."},
[2] = {text="Menu Option 2", color=colors.orange, command="/say Blubb"},
[3] = {text="Menu Option 3", color=colors.cyan, command="/tp....."},
[4] = {text="Menu Option 4", color=colors.orange, command="/toggledownfall"},
[5] = {text="Menu Option 5", color=colors.orange, command="another command"},
[6] = {text="Menu Option 6", color=colors.orange, command="another command"},
[7] = {text="Menu Option 7", color=colors.orange, command="another command"},
[8] = {text="Menu Option 8", color=colors.orange, command="another command"},
[9] = {text="Menu Option 9", color=colors.orange, command="another command"},
[10] = {text="Menu Option 10", color=colors.orange, command="another command"}
}
At the end of the script I get a selector variable
term.write("Selected: "..selector)
So if I choose Menu Option 4 the selector is 4. I want to use this selector now to read the command value "/toggledownfall" and first print it out for testing. Later I will use this at a command computer to execute a command.
How do I do this?