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

[Lua] [Question] Adding actions to Liraal's Menu

Started by Brodur, 29 July 2012 - 05:46 PM
Brodur #1
Posted 29 July 2012 - 07:46 PM
So, I made lirral's menu function on a computer and had another program use it, but now I'm wondering, how do I actually make the menu run things? here is what I tried, but if it worked I wouldn't be posting here :ph34r:/>/>


local options={
"Launch VaulTec",
"Continue to CraftOS 1.3"
}
local n=CUI(options)
print(n)
if n=1 then
sleep(0.1)
shell.run "vault"
else
shell.run "shell"
end

So, I tried adding an if else to see if that would work but no cigar, any suggestions?

- Here is the link to Irral's topic: http://www.computerc...gh-menu-making/
sjele #2
Posted 29 July 2012 - 07:52 PM
shell.run is used like this :

shell.run ("programname")  -- Change programname to the porgram name
Lyqyd #3
Posted 29 July 2012 - 10:34 PM
You did include the CUI function in your code someplace, correct? If it can't find the function, it can't call it.