guusvanwalstijn

computercraft checks if player is online(true redstone)

Mar 7th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function menu()
  2.  
  3. monitor.setBackgroundColour((colours.lime))
  4. monitor.clear()
  5. monitor.setCursorPos(20,5)
  6.  
  7. if redstone.getInput("right", true) then -- rechts = bartna
  8. right = "Online"
  9. else
  10. right = "Offline"
  11. end
  12. if redstone.getInput("back", true) then -- achterkant = 123kac
  13. back = "Online"
  14. else
  15. back = "Offline"
  16. end
  17. if redstone.getInput("front", true) then -- voorkant = alexmaster50
  18. front = "Online"
  19. else
  20. front = "Offline"
  21. end
  22. if redstone.getInput("left", true) then -- left = ewart4fun
  23. left = "Online"
  24. else
  25. left = "Offline"
  26. end
  27. if redstone.getInput("bottom", true) then -- onderkant ik(guusje4525)
  28. bottom = "Online"
  29. else
  30. bottom = "Offline"
  31. end
  32.  
  33. monitor.write(" Player Bartna = " .. right)
  34. monitor.setCursorPos(20,8)
  35. monitor.write(" Player 123kac = " .. back)
  36. monitor.setCursorPos(20,11)
  37. monitor.write(" Player Alexmaster50 = " .. front)
  38. monitor.setCursorPos(20,14)
  39. monitor.write(" Player Ewart4fun = " .. left)
  40. monitor.setCursorPos(20,17)
  41. monitor.write(" Player Guusje4525 = " .. bottom)
  42. end
  43.  
  44.  
  45. monitor = peripheral.wrap("monitor_1")
  46.  
  47. monitor.clear()
  48.  
  49. monitor.setCursorPos(1,1)
  50.  
  51. monitor.setBackgroundColour((colours.blue))
  52.  
  53. menu()
  54.  
  55. monitor.setBackgroundColour((colours.lime))
  56.  
  57. function aardappel()
  58. menu()
  59. sleep(3)
  60. aardappel()
  61. end
  62.  
  63. aardappel()
  64. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment