Advertisement
Guest User

startup

a guest
May 26th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. modem = peripheral.wrap("top")
  2. modem.open(2)
  3. seed = peripheral.wrap("bottom")
  4. redstone.setBundledOutput("front",0)
  5. while true do
  6.  
  7. os.sleep(5)
  8. modem.transmit(1,2,"growth")
  9.  
  10.  
  11. local event, modemSide, senderChannel,
  12.   replyChannel, message, senderDistance = os.pullEvent("modem_message")
  13.  
  14. seedLeft = message  
  15. print(seedLeft)
  16.  
  17.  
  18. modem.transmit(3,2,"growth")  
  19.  
  20. local event, modemSide, senderChannel,
  21.   replyChannel, message, senderDistance = os.pullEvent("modem_message")
  22.  
  23. seedRight = message
  24.   print(seedRight)
  25.  
  26. os.sleep(5)
  27. if seed.hasPlant("SOUTH") then
  28.   print("Plant Removal Tick")
  29.   redstone.setBundledOutput("front",colors.brown)
  30.   os.sleep(1)
  31.   redstone.setBundledOutput("front",0)
  32.   modem.transmit(3,2,"analyse")
  33. local event, modemSide, senderChannel, replyChannel,
  34.   message, senderDistance = os.pullEvent("modem_message")
  35.   print(message)
  36.  
  37.       elseif seedRight == 100 and seedLeft == 100 and not seed.isCrossCrop("SOUTH") then
  38.   print("true")
  39.         rs.setOutput("front",true)
  40.     redstone.setOutput("front",true)
  41.     redstone.setBundledOutput("front",colors.green)
  42.    os.sleep(1)
  43.      redstone.setBundledOutput("front",0)
  44.    
  45.      end
  46.    
  47.  
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement