Advertisement
natie3

MiningControl

Oct 31st, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. modem = peripheral.wrap("top")
  2. modem.open(1)
  3.  
  4. while true do
  5.   e, _, _, _, m = os.pullEvent("modem_message")
  6.   print(m)
  7.   if m == "turn_on" then
  8.     rs.setOutput("right", true)
  9.     modem.transmit(2,1, "on")
  10.   elseif m == "turn_off" then
  11.     rs.setOutput("right", false)
  12.     modem.transmit(2,1, "off")
  13.   end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement