Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version = 20230602.1700
- menu = require "lib.menu"
- --[[
- https://pastebin.com/Tb52qX9z
- ]]
- local function getTest()
- local line, test, age, height, likesLua = 1, "", 0, 0, false
- line = menu.clear()
- --getString(prompt, withTitle, minValue, maxValue, row, fg, bg)
- test, line = menu.getString("Type your name ", true, 2, 10, line, colors.green, colors.black)
- line = line + 1
- --age, line = menu.getInteger("Type a number 5 to 99 default 50", 5, 99, line, colors.yellow, colors.black, 50)
- age, line = menu.getInteger("Type a number 5 to 99 default 50", 5, 99, nil, colors.pink, nil, 50)
- menu.colourPrint("You chose ".. age..", line="..line, colors.red, colors.black)
- age, line = menu.getInteger({"Type your age","Between 5 and 99 "}, 5, 99, line, colors.yellow, colors.black)
- line = line + 1
- height, line = menu.getFloat("Type your height", 0.5, 2.1, line, colors.cyan, colors.black)
- line = line + 1
- likesLua, line = menu.getBool("Do you like Lua?(y/n)", line, colors.blue, colors.black)
- line = line + 1
- end
- local function menuTest()
- local choice, modifier = 0, ""
- line = menu.clear()
- options = {"white", "red", "blue", "green", "yellow", "cyan", "magenta", "purple", "pink"}
- --choice, modifier = menu.new("Choose your colour", options)
- local pp =
- {
- prompt = colors.yellow,
- itemColours = {colors.white, colors.red, colors.blue, colors.green, colors.yellow, colors.cyan, colors.magenta, colors.purple, colors.pink},
- menuPrompt = colors.lime
- }
- --[[local pp =
- {
- prompt = colors.green,
- itemColours = {colors.white, colors.red, ... one for each item},
- menuPrompt = colors.yellow
- }
- choice, modifier = menu.menu or menu.new("Choose your option", options, pp)]]
- choice, modifier = menu.menu("Choose your colour", options, pp)
- if choice ~= nil then
- local colour = colors[options[choice]]
- menu.colourPrint("You chose ".. options[choice], colour, colors.black)
- else
- print("you chose "..modifier)
- end
- end
- local function colourDisplay()
- line = menu.clear()
- --print(text, fg, bg, width) write(text, fg, bg, width)
- menu.colourPrint("red on black", colors.red, colors.black)
- menu.colourPrint("purple on black", colors.purple, colors.black)
- menu.colourPrint("magenta on black", colors.magenta, colors.black)
- menu.colourPrint("pink on black", colors.pink, colors.black)
- menu.colourPrint("green on black", colors.green, colors.black)
- menu.colourPrint("lime on black", colors.lime, colors.black)
- menu.colourPrint("yellow on black", colors.yellow, colors.black)
- menu.colourPrint("orange on black", colors.orange, colors.black)
- menu.colourPrint("brown on black", colors.brown, colors.black)
- menu.colourPrint("blue on black", colors.blue, colors.black)
- menu.colourPrint("cyan on black", colors.cyan, colors.black)
- menu.colourPrint("lightBlue on black ENTER",colors.lightBlue, colors.black)
- read()
- line = menu.clear()
- menu.colourPrint("white on black", colors.white, colors.black)
- menu.colourPrint("lightGray on black", colors.lightGray, colors.black)
- menu.colourPrint("gray on black", colors.gray, colors.black)
- menu.colourPrint("black on white", colors.black, colors.white)
- menu.colourPrint("black on lightGray", colors.black, colors.lightGray)
- menu.colourPrint("black on gray ENTER",colors.black, colors.gray)
- read()
- line = menu.clear()
- menu.colourPrint("black on red", colors.black, colors.red)
- menu.colourPrint("black on purple", colors.black, colors.purple)
- menu.colourPrint("black on magenta", colors.black, colors.magenta)
- menu.colourPrint("black on pink", colors.black, colors.pink)
- menu.colourPrint("black on green", colors.black, colors.green)
- menu.colourPrint("black on lime", colors.black, colors.lime)
- menu.colourPrint("black on yellow", colors.black, colors.yellow)
- menu.colourPrint("black on orange", colors.black, colors.orange)
- menu.colourPrint("black on brown", colors.black, colors.brown)
- menu.colourPrint("black on blue", colors.black, colors.blue)
- menu.colourPrint("black on cyan", colors.black, colors.cyan)
- menu.colourPrint("black on lightBlue ENTER",colors.black, colors.lightBlue)
- read()
- line = menu.clear()
- end
- local function printText()
- line = menu.clear()
- --[[
- local text = '~brown~Thank ~red~you ~brown~for playing this adventure'
- line = menu.colourPrint(line, text, true, true)
- local textTable = {'~pink~and for ~blue~testing the ~lime~colours','~red~Coded by Inksaver','~green~If you did not make it this time','~yellow~Please try again!'}
- for _,text in ipairs(textTable) do
- line = menu.colourPrint(line, text, true, true)
- end]]
- text = [[ ~lightGray~MINING:~white~
- Can be used in over-world or nether.
- Create a pre-formatted 33 x 33 blocks
- mine at chosen level.~brown~
- Ladders and stairs up/down~blue~
- Bubble lift and safe drop to water.~lightGray~
- Strip resources from abandoned mines.~yellow~
- Faster version of 33x33 mine pattern
- using corridor and rectangle functions.~gray~
- Mine bottom layer to bedrock not worth
- the time and fuel.
- ]]
- line = menu.colourText(line, text, true)
- term.setCursorPos(1, line + 1)
- read()
- text = [[
- FORESTRY:
- Fell Tree can be used in Nether as well
- for cutting any size tree / branches
- Create a simple 16 single tree farm
- or 4 double size (Dark oak or any type)
- suitable for turtle harvesting.
- Automatic treefarm can be created and
- managed with dedicated automatic turtle.
- Natural forest can be harvested and
- replanted. (Must be walled off)
- ]]
- line = menu.clear()
- line = menu.colourText(line, text, true)
- term.setCursorPos(1, line+1)
- end
- local function main()
- --printText()
- --read()
- getTest()
- read()
- menuTest()
- read()
- colourDisplay()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement