ravneravn

purifier

Nov 18th, 2013
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. f = peripheral.wrap("front")
  2.  
  3. function pullSerum()
  4. turtle.select(1)
  5. turtle.suck()
  6. turtle.dropUp()
  7. end
  8.  
  9. function getPower()
  10. power = tonumber(f.getEnergyStored())
  11. if power < 49950.0 then
  12. while power < 49950.0 do
  13. power = tonumber(f.getEnergyStored())
  14. print(power)
  15. sleep(5)
  16. end
  17. pullSerum()
  18. end
  19. end
  20.  
  21. function getSignal()
  22. event, sid, mes, dis = os.pullEvent("rednet_message")
  23. if mes == "serum" then
  24. sleep(180)
  25. pullSerum()
  26. end
  27. end
  28.  
  29.  
  30. sleep(1)
  31. rednet.open("right")
  32. rednet.broadcast("id")
  33.  
  34. while true do
  35. --power = f.getEnergyStored()
  36. --print(power)
  37. --sleep(2)
  38. --getPower()
  39.  
  40. getSignal()
  41. end
RAW Paste Data