Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. print("Computer-ID: "..os.getComputerID())
  2. --print("Computer-Label: "..os.getComputerLabel())
  3. print(" ")
  4. print("Where is the platform: ")
  5. print("0: Bedrock")
  6. print("1: AE-System")
  7. print("2: Exit to surface")
  8. print(" ")
  9. local pcurrlvl = io.read()
  10. print(" ")
  11. print("Movementdirection: ")
  12. print("1: up")
  13. print("0: down")
  14. print(" ")
  15. local mdir = io.read()
  16. term.clear()
  17. term.setCursorPos(1,1)
  18. print("colour 1, Clock")
  19. print("colour 2, Directionchanger")
  20. print("colour 4, Gatecontrol")
  21. print(" ")
  22. print("colour 8, floor 0, Bedrock, ID: 35")
  23. print("colour 16, floor 1, AE-System, ID:34")
  24. print("colour 32, floor 2, Exit to surface, ID:28")
  25.  
  26. local prequlvl
  27. local color
  28. local modemside = "right"
  29.  
  30. rednet.open(modemside)
  31.  
  32. while true do
  33. senderid, msg, protocol = rednet.receive()
  34.  
  35. if senderid == 35 then
  36. prequlvl = 0
  37. color = 8
  38. elseif senderid == 34 then
  39. prequlvl = 1
  40. color = 16
  41. elseif senderid == 28 then
  42. prequlvl = 2
  43. color = 32
  44. end
  45.  
  46. if (pcurrlvl < prequlvl) and (mdir ~= 1) then
  47. redstone.setBundledOutput(modemside, 2, true)
  48. sleep(0.2)
  49. redstone.setBundledOutput(modemside, 2, false)
  50. mdir = 1
  51. elseif (pcurrlvl > prequlvl) and (mdir ~= 0) then
  52. redstone.setBundledOutput(modemside, 2, true)
  53. sleep(0.2)
  54. redstone.setBundledOutput(modemside, 2, false)
  55. mdir = 0
  56. end
  57.  
  58. -- Moving the platform to requesting floor and arrival check
  59.  
  60. if (redstone.getBundledInput(modemside, color, true) == false) and (pcurrlvl ~= prequlvl) then
  61. local nextpulse = true
  62.  
  63. while nextpulse == true do
  64. redstone.setBundledOutput(modemside, 1, true)
  65. if redstone.getBundledInput(modemside, color, true) == true then
  66. nextpulse = false
  67. end
  68. sleep(0.2)
  69. redstone.setBundledOutput(modemside, 1, false)
  70. end
  71. end
  72.  
  73. -- Moving the platform to destination floor and arrival check
  74.  
  75. if
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement