Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local choice
- local sList = {colors.blue, colors.green, colors.red, colors.white}
- function centerText(text)
- local x,buf1 = term.getSize()
- local buf2,y = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y)
- print(text)
- end
- function choose()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.lightBlue)
- centerText("Cambridge Corp. Spawner Controller")
- print("")
- centerText("Chose your spawner")
- print("1: Zombie Pigman")
- print("2: Creeper")
- print("3: Skeleton")
- print("4: Slime")
- print("5: Chicken")
- print("6: Cow")
- print("7: Sheep")
- choice = read()
- choice = tonumber(choice)
- end
- function run()
- term.clear()
- term.setCursorPos(1,1)
- redstone.setBundledOutput("back", sList[choice])
- centerText("Starting spawner...")
- print("Press any key to stop the spawner!")
- read()
- redstone.setBundledOutput("back",0)
- end
- while true do
- choose()
- if (choice <= table.getn(sList)) and choice > 0 then
- run()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment