Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("front")
- modem.open(12)
- term.clear()
- term.setCursorPos(1,1)
- print("Working...")
- while true do
- event, side, chan, reply, message, dist = os.pullEvent("modem_message")
- if (message["m"] == "go") then
- time = tonumber(message["pt"])
- done = false
- while time > 0 do
- rs.setOutput("right", true)
- sleep(1)
- time = time - 1
- rs.setOutput("right", false)
- rs.setOutput("left", true)
- sleep(1)
- time = time - 1
- rs.setOutput("left", false)
- if (time < 30) and not done then
- modem.transmit(13, 0, "30")
- done = true
- end
- end
- rs.setOutput("left", false)
- rs.setOutput("right", false)
- sleep(5)
- rs.setBundledOutput("top", colors.lightBlue)
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.lightBlue, colors.orange))
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.lightBlue, colors.orange, colors.lime))
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.lightBlue, colors.orange, colors.lime, colors.lightGray))
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.lightBlue, colors.orange, colors.lime, colors.lightGray, colors.purple))
- sleep(1)
- rs.setBundledOutput("top", colors.subtract(colors.lightBlue, colors.orange, colors.lime, colors.lightGray, colors.purple) - colors.lightBlue)
- rs.setOutput("bottom", true)
- stop = false
- while not stop do
- event2, side2, chan2, reply2, message2, dist2 = os.pullEvent("modem_message")
- if (message2 == "f") then
- x = 46
- rs.setBundledOutput("top", colors.combine(colors.lightBlue, colors.orange, colors.lime, colors.lightGray, colors.purple))
- while x > 0 do
- rs.setOutput("bottom", false)
- sleep(1)
- x = x - 1
- rs.setOutput("bottom", true)
- sleep(1)
- x = x - 1
- end
- stop = true
- rrs.setBundledOutput("top", colors.subtract(colors.lightBlue, colors.orange, colors.lime, colors.lightGray, colors.purple) - colors.lightBlue)
- elseif (message2 == "yellow") then
- shell.run("yellow")
- end
- end
- else
- print("Bad message!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement