Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. --This is my code for Auto-Spawner I am building
  2.  
  3. --verison of spawner
  4.  
  5.  
  6. ----This is the function to center text
  7.  
  8.  
  9. local w, h = term.getSize()
  10.  
  11. --function to centertext
  12.  
  13. local function cenText(text,y)
  14.     term.setCursorPos(w/2-#text/2,y)
  15.     term.write(text)
  16. end
  17.  
  18. local function setup()
  19.     term.clear()
  20.     term.setCursorPos(1,1)
  21. end
  22. local function verison()
  23. term.setTextColor(colors.yellow)
  24. cenText("Auto-Spawner Verison 1.0",1)
  25. end
  26.  
  27.  
  28.  
  29. menuOptions = {
  30.     [1]= {text = "Zombie"},
  31.     [2]= {text = "Blaze"},
  32.     [3]= {text = "Skelton"},
  33.     [4]= {text = "Sheep"},
  34.     [5]= {text = "Reset"},
  35. }
  36.  
  37.  
  38. local function mainMenu()
  39.     setup()
  40.     verison()
  41.     term.setCursorPos(1,5)
  42.     term.setTextColor(colors.white)
  43.         for i,v in ipairs(menuOptions) do
  44.             i = 1, #menuOptions
  45.             print(menuOptions[i].i.v.text)
  46.         end
  47. end
  48.  
  49.  
  50.  
  51. mainMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement