Posted 11 June 2016 - 04:56 AM
Hey everyone, I just want to say that I made this program at 4 AM, half asleep, please tell me if I missed something if there is anything to be more efficient etc. I'm not very good at explaining things so, if you have any trouble understanding, please say! I know the pain when making a new program on computercraft and you need a quick menu, well here's the solution! I know that there are probably hundreds of programs out there, just like mine, but I thought that I should post it in-case it was any use to anyone on here.
Explanation:
To use the menu, you can use the up and down arrowkeys, hit enter to select.
If you select the first option, the function will return 1 (number), if you select option 2, it will return 2 and so on. The function takes 2 arguments, string and a table, title and the options, there will be examples below for you to see. You could load this script as an API or just paste it at the top of your code, up to you.
Download:
http://pastebin.com/EJfeq8Dp - OR - pastebin get EJfeq8Dp listmaker
Screenshots and examples:
this is an example program, using mainMenu("This is an example!!\nMultiple lines work too!\nSee!\n", {"A","B","C","D","E","You can have as many options as you wish!"}) try it yourself!
Any hints or suggestions? PM me! Thanks for reading!
Explanation:
To use the menu, you can use the up and down arrowkeys, hit enter to select.
If you select the first option, the function will return 1 (number), if you select option 2, it will return 2 and so on. The function takes 2 arguments, string and a table, title and the options, there will be examples below for you to see. You could load this script as an API or just paste it at the top of your code, up to you.
Download:
http://pastebin.com/EJfeq8Dp - OR - pastebin get EJfeq8Dp listmaker
Screenshots and examples:
this is an example program, using mainMenu("This is an example!!\nMultiple lines work too!\nSee!\n", {"A","B","C","D","E","You can have as many options as you wish!"}) try it yourself!
Any hints or suggestions? PM me! Thanks for reading!
Edited on 11 June 2016 - 07:03 PM