Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Inizializza Rednet sul lato inferiore del computer
- rednet.open("bottom")
- -- Funzione per gestire i messaggi ricevuti
- function handleMessages()
- while true do
- local senderId, message = rednet.receive()
- if message == "lasciando piano 1" then
- print("muovo giu")
- redstone.setBundledOutput("back", colors.yellow)
- elseif message == "lasciando piano 2" then
- print("muovo su")
- redstone.setBundledOutput("back", colors.lime)
- elseif message == "stop" then
- print("stop")
- local currentOutput = redstone.getBundledOutput("back")
- if currentOutput ~= 0 then
- redstone.setBundledOutput("back", 0)
- sleep(0.3)
- redstone.setBundledOutput("back", currentOutput)
- sleep(0.3)
- redstone.setBundledOutput("back", 0)
- end
- end
- end
- end
- -- Avvia la gestione dei messaggi
- handleMessages()
Advertisement
Add Comment
Please, Sign In to add comment