Advertisement
dyl421421

Rednet Spawner Control

Feb 28th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This program will wait for the "rednet_message" event with the set computer id and emit redstone to the left.
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. local pd, param1, param2 = os.pullEvent()
  5. function cowon()
  6.   rs.setOutput("left", false)
  7. end
  8. function cowoff()
  9.   rs.setOutput("left", true)
  10. end
  11. if pd == "rednet_message" and param1 == 173 and param2 == "cowon" then
  12.   print("Message received to turn on cow spawner.")
  13.   print("Cow spawner is on.")
  14.   cown()
  15. elseif pd == "rednet_message" and param1 == 173 and param2 == "cowoff" then
  16.   print("Message received to turn off cow spawner.")
  17.   print("Cow spawner is off.")
  18.   cowoff()
  19. end
  20. term.clear()
  21. shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement