Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Computer-ID: "..os.getComputerID())
- --print("Computer-Label: "..os.getComputerLabel())
- print(" ")
- print("Where is the platform: ")
- print("0: Bedrock")
- print("1: AE-System")
- print("2: Exit to surface")
- print(" ")
- local pcurrlvl = io.read()
- print(" ")
- print("Movementdirection: ")
- print("1: up")
- print("0: down")
- print(" ")
- local mdir = io.read()
- term.clear()
- term.setCursorPos(1,1)
- print("colour 1, Clock")
- print("colour 2, Directionchanger")
- print("colour 4, Gatecontrol")
- print(" ")
- print("colour 8, floor 0, Bedrock, ID: 35")
- print("colour 16, floor 1, AE-System, ID:34")
- print("colour 32, floor 2, Exit to surface, ID:28")
- local prequlvl
- local color
- local modemside = "right"
- rednet.open(modemside)
- while true do
- senderid, msg, protocol = rednet.receive()
- if senderid == 35 then
- prequlvl = 0
- color = 8
- elseif senderid == 34 then
- prequlvl = 1
- color = 16
- elseif senderid == 28 then
- prequlvl = 2
- color = 32
- end
- if (pcurrlvl < prequlvl) and (mdir ~= 1) then
- redstone.setBundledOutput(modemside, 2, true)
- sleep(0.2)
- redstone.setBundledOutput(modemside, 2, false)
- mdir = 1
- elseif (pcurrlvl > prequlvl) and (mdir ~= 0) then
- redstone.setBundledOutput(modemside, 2, true)
- sleep(0.2)
- redstone.setBundledOutput(modemside, 2, false)
- mdir = 0
- end
- -- Moving the platform to requesting floor and arrival check
- if (redstone.getBundledInput(modemside, color, true) == false) and (pcurrlvl ~= prequlvl) then
- local nextpulse = true
- while nextpulse == true do
- redstone.setBundledOutput(modemside, 1, true)
- if redstone.getBundledInput(modemside, color, true) == true then
- nextpulse = false
- end
- sleep(0.2)
- redstone.setBundledOutput(modemside, 1, false)
- end
- end
- -- Moving the platform to destination floor and arrival check
- if
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement