Guest User

startup

a guest
Jun 26th, 2014
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. p = peripheral.wrap("right")
  2. m = peripheral.wrap("top")
  3. local whiteList = {}
  4. local blackList = {}
  5. m.clear()
  6. --whiteList["Player1"] = true
  7. blackList["KingMinecrafter"] = true
  8. blackList["Falmaze"] = true
  9. blackList["hayboy2001"] = true
  10. blackList["ryguy6011"] = true
  11. blackList["cody1904"] = true
  12. blackList["SkeliWar"] = true
  13. blackList["Stravides"] = true
  14. blackList["maxcel23"] = true
  15. blackList["Hermann_Klink"] = true
  16. blackList["ChJees"] = true
  17. blackList["Zelophed"] = true
  18.  
  19. function centerText(text)
  20. m.setTextScale(1,9)
  21. x,y = m.getSize()
  22. x1,y1 = m.getCursorPos()
  23. m.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
  24. m.write(text)
  25. end
  26.  
  27. function black(playerName)
  28. m.clear()
  29. y2 = 3
  30. m.setTextColor(1)
  31. m.setCursorPos(1, 3)
  32. m.setCursorPos(1, 5)
  33. m.setTextColor(16384)
  34. centerText(" "..playerName.." ")
  35. m.setCursorPos(1, 7)
  36. m.setTextColor(1)
  37. centerText("Has entered the area")
  38. rs.setBundledOutput("back", colors.lime)
  39. sleep(2)
  40. end
  41.  
  42. function white(playerName)
  43. m.clear()
  44. y2 = 3
  45. m.setCursorPos(1, 2)
  46. centerText("Welcome Back")
  47. m.setCursorPos(1, 3)
  48. m.setTextColor(32)
  49. centerText(" " ..playerName.. " ")
  50. rs.setBundledOutput("back", 0)
  51. sleep(2)
  52. rs.setBundledOutput("back", colors.lime)
  53. sleep(1)
  54. end
  55.  
  56.  
  57. function nobody(playerName)
  58. m.clear()
  59. y2 = 3
  60. m.setCursorPos(1, y2)
  61. centerText("Unrecognised player: "..playerName.." Please leave")
  62. end
  63.  
  64. function reset()
  65. rs.setBundledOutput("back", 0)
  66. end
  67.  
  68. while true do
  69. sleep(1)
  70. players = p.getPlayerNames()
  71. for num,name in pairs(players) do
  72.  
  73. if whiteList[name] then
  74. white(name)
  75.  
  76. elseif blackList[name] then
  77. black(name)
  78.  
  79. else
  80. print("System does not recognize player: "..name.."")
  81. nobody(name)
  82. rs.setBundledOutput("back",0)
  83. end
  84. rs.setBundledOutput("back", 0)
  85. end
  86. end
Advertisement
Add Comment
Please, Sign In to add comment