Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This program will wait for the "rednet_message" event with the set computer id and emit redstone to the left.
- term.clear()
- term.setCursorPos(1,1)
- local pd, param1, param2 = os.pullEvent()
- function cowon()
- rs.setOutput("left", false)
- end
- function cowoff()
- rs.setOutput("left", true)
- end
- if pd == "rednet_message" and param1 == 173 and param2 == "cowon" then
- print("Message received to turn on cow spawner.")
- print("Cow spawner is on.")
- cown()
- elseif pd == "rednet_message" and param1 == 173 and param2 == "cowoff" then
- print("Message received to turn off cow spawner.")
- print("Cow spawner is off.")
- cowoff()
- end
- term.clear()
- shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement