Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is my code for Auto-Spawner I am building
- --verison of spawner
- ----This is the function to center text
- slc = 0
- local w, h = term.getSize()
- --function to centertext
- local function cenText(text,y)
- term.setCursorPos(w/2-#text/2,y)
- term.write(text)
- end
- local input = read()
- local function setup()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function verison()
- term.setTextColor(colors.yellow)
- cenText("Auto-Spawner Verison 1.0",1)
- end
- menuOptions = {
- [1]= {text = "(1)Zombie"},
- [2]= {text = "(2)Blaze"},
- [3]= {text = "(3)Skelton"},
- [4]= {text = "(4)Sheep"},
- [5]= {text = "(5)Reset"},
- }
- local function mainMenu()
- setup()
- verison()
- term.setCursorPos(1,5)
- term.setTextColor(colors.white)
- for i,v in ipairs(menuOptions) do
- i = 1, #menuOptions
- print(v.text)
- end
- term.setCursorPos(1,11)
- term.setTextColor(colors.yellow)
- print("Please input the number that you want to spawn:")
- term.setTextColor(colors.white)
- end
- local function mainMenu()
- setup()
- verison()
- term.setCursorPos(1,5)
- term.setTextColor(colors.white)
- for i,v in ipairs(menuOptions) do
- i = 1, #menuOptions
- print(v.text)
- end
- term.setCursorPos(1,11)
- term.setTextColor(colors.yellow)
- print("Please input the number that you want to spawn:")
- term.setTextColor(colors.white)
- end
- local function slc1()
- if slc == 1 then
- redstone.setBundledOutput("back",colors.orange, true)
- sleep(.1)
- redstone.setBundledOutput("back",colors.orange, false)
- end
- setup()
- verison()
- cenText("Zombies are selected!",5)
- cenText("Reset",11)
- term.setTextColor(colors.white)
- term.setCursorPos(1,12)
- read()
- if input == ("yes") then
- slc = 0
- end
- end
- local function selection()
- if input == ("1") then
- slc = 1
- slc1()
- elseif input ==("2")then
- elseif input ==("3") then
- elseif input ==("4") then
- elseif input ==("5") then
- sleep(.5)
- setup()
- verison()
- mainMenu()
- else
- sleep(.5)
- setup()
- verison()
- mainMenu()
- end
- end
- while slc = 0 do
- mainMenu()
- selection()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement