Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- white = colors.white
- orange = colors.orange
- magenta = colors.magenta
- lBlue = colors.lightBlue
- yellow = colors.yellow
- lime = colors.lime
- pink = colors.pink
- grey = colors.gray
- lGrey = colors.lightGray
- cyan = colors.cyan
- purple = colors.purple
- blue = color.blue
- brown = colors.brown
- green = colors.green
- red = colors.red
- black = colors.black
- --[[ Local Variables ]]--
- local w, h = term.getSize()
- local selectedItem = 1
- local running = true
- howMany = read()
- --[[ Choice Methods ]]--
- function hassle()
- term.clear()
- term.setCursorPos(w/2,3)
- print("How Many Materials Would you like?")
- term.setCursorPos(w/2, h/2)
- end
- function pulseChoice(itm, value)
- for i = 1, value do
- sleep(0.5)
- rs.setBundledOutput("back", itm)
- sleep(0.2)
- rs.setBundledOutput("back", 0)
- end
- function Iron()
- hassle()
- write("Iron: ")
- pulseChoice(lime, howMany )
- os.reboot()
- end
- function rIron()
- hassle()
- write("Refined Iron: ")
- pulseChoice(white, howMany )
- os.reboot()
- end
- function Coal()
- hassle()
- write("Coal: ")
- pulseChoice(orange, howMany)
- os.reboot()
- end
- function rStone()
- hassle()
- write("Redstone: ")
- pulseChoice(magenta, howMany)
- os.reboot()
- end
- function woodLog()
- hassle()
- write("Oak Logs: ")
- pulseChoice(lBlue, howMany)
- os.reboot()
- end
- function woodPlank()
- hassle()
- write("Wooden Planks: ")
- pulseChoice(yellow, howMany)
- os.reboot()
- end
- function dMond()
- hassle()
- write("Diamond: ")
- pulseChoice(pink, howMany)
- os.reboot()
- end
- function Copper()
- hassle()
- write("Copper: ")
- pulseChoice(grey, howMany)
- os.reboot()
- end
- function Tin()
- hassle()
- write("Tin: ")
- pulseChoice(lGrey, howMany)
- os.reboot()
- end
- function Gold()
- hassle()
- write("Gold: ")
- pulseChoice(cyan, howMany)
- os.rebot()
- end
- function cStone()
- hassle()
- write("Cobblestone: ")
- pulseChoice(purple, howMany)
- os.reboot()
- end
- function sStone()
- hassle()
- write("Stone: ")
- pulseChoice(blue, howMany)
- os.reboot()
- end
- function cBricks()
- hassle()
- write("Bricks: ")
- pulseChoice(brown, howMany)
- os.reboot()
- end
- function rMatter()
- hassle()
- write("Red Matter: ")
- pulseChoice(green, howMany)
- os.reboot()
- end
- function dMatter()
- hassle()
- write("Dark Matter: ")
- pulseChoice(red, howMany)
- os.reboot()
- end
- function circuit()
- hassle()
- write("Circuit: ")
- pulseChoice(black, howMany)
- os.reboot()
- end
- --[[ Choice Definitions ]]--
- mainChoice = {
- [1] = { text = "Iron", handler = Iron() }
- [2] = { text = "Refined Iron", handler = rIron() }
- [3] = { text = "Coal", handler = Coal() }
- [4] = { text = "Redstone", handler = rStone() }
- [5] = { text = "Oak Logs", handler = woodLog() }
- [6] = { text = "Oak Planks", handler = woodPlank() }
- [7] = { text = "Diamond", handler = dMond() }
- [8] = { text = "Copper", handler = Copper() }
- [9] = { text = "Tin", handler = Tin() }
- [10] = { text = "Gold", handler = Gold() }
- [11] = { text = "Cobblestone", handler = cStone() }
- [12] = { text = "Smooth Stone", handler = sStone() }
- [13] = { text = "Bricks", handler = cBricks() }
- [14] = { text = "Red Matter", handler = rMatter() }
- [15] = { text = "Dark Matter", handler = dMatter() }
- [16] = { text = "Circuits", handler = circuit() }
- }
- --[[ Menu Print]]--
- function printMenu(menu)
- for x = 1, #menu do
- if x == selectedItem then
- print(">> ".. menu[x].text)
- else
- print(" ".. menu[x].text)
- end
- end
- end
- --[[Handler Method]]--
- function onKeyPressed(key, menu)
- if key == keys.enter then
- onItemSelected(menu)
- elseif key == keys.up then
- if selectedItem > 1 then
- selectedItem = selectedItem - 1
- end
- elseif key == keys.down then
- if selectedItem > #menu then
- selectedItem = selectedItem + 1
- end
- end
- end
- function onItemSelected(menu)
- menu[selectedItem].handler()
- end
- --[[Main Method]]--
- function main()
- while running do
- term.clear()
- term.setCursorPos(1,1)
- printMenu(mainChoice)
- event, key = os.pullevent("key")
- onKeyPressed(key,mainChoice)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment