Advertisement
Guest User

startup

a guest
Aug 1st, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local modem = peripheral.wrap("top")
  2. modem.open(1)
  3.   event = os.pullEvent()
  4. while true do
  5. local event, modemSide, senderChannel,
  6.   replyChannel, message, senderDistance = os.pullEvent("modem_message")
  7.   if event == "modem_message" then
  8.     if message:find("Pozar") then
  9.       rs.setOutput("left", true)
  10.     else
  11.       if message:find("TR1") then
  12.         if redstone.getInput("left") == true then
  13.           rs.setOutput("left", false)
  14.         else
  15.           rs.setOutput("left", true)
  16.         end
  17.     end
  18.   end
  19.   if redstone.getInput("left") == true then
  20.     modem.transmit(3, 1, "TR1_OFF")
  21.   else
  22.     modem.transmit(3, 1, "TR1_ON")
  23.   end
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement