Advertisement
carrots084

adr

Jul 27th, 2014
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. --[[
  2. People I want to thank:
  3. theoriginalbit for helping me with general code errors and variable declarations
  4. Alissa: helping me with bunches of code, not even just this program
  5. ]]--
  6. --os.pullEvent() os.pullEventRaw()
  7.  
  8. term.clear()
  9. local selector = 0
  10. local selecting = 0
  11. local secrets = 0
  12. --Centering Text
  13. print("Centering text")
  14. local function centerText(text)
  15. local x,y = term.getSize()
  16. local x2,y2 = term.getCursorPos()
  17. term.setCursorPos(math.ceil((x/2) - (text:len() / 2)), y2)
  18. print(text)
  19. end
  20. function yN()
  21. local n = 1
  22. while true do
  23. local x,y = term.getCursorPos()
  24. term.clearLine()
  25. if(n== 1) then centerText(">Start Game< Secrets ") else centerText(" Start Game >Secrets<") end
  26. term.setCursorPos(x, y)
  27. a, b = os.pullEvent()
  28. while a ~="key" do a, b=os.pullEvent() end
  29. if b == 203 and n == 2 then n= 1 end
  30. if b == 205 and n == 1 then n = 2 end
  31. if b == 28 then print("") break end
  32. end
  33. if n == 1 then selector = 1 end
  34. if n == 2 then selector = 2 end
  35. return false
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement