luckdemon

AutoSpawnerControlReceiver

Jul 4th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. Turtle that receives wireless signals from sender
  3. and deposits/withdraws safari nets from auto-spawner (minefactory reloaded)
  4. --]]
  5.  
  6. local function clear()
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9. end
  10.  
  11. clear()
  12.  
  13. print("Auto Spawner Control")
  14. print("by: Luckdemon")
  15. rednet.open("right")
  16. sleep(1)
  17. function main()
  18. while true do
  19.     clear()
  20.     print("Waiting for command")
  21.     local id, msg, dist = rednet.receive()
  22.     if msg == true then
  23.         print("on")
  24.         redstone.setOutput("front", true)
  25.     elseif msg == false then
  26.         print("off")
  27.         redstone.setOutput("front", false)
  28.     else
  29.         print(msg)
  30.     turtle.suck()
  31.     turtle.select(msg)
  32.     turtle.drop()
  33.     sleep(0.5)
  34.     end
  35. end
  36. end
  37.  
  38. main()
Advertisement
Add Comment
Please, Sign In to add comment