Guest User

Aypolice

a guest
Oct 27th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. slotWaypoint = 1
  2. slotCharbon = 2
  3. slotTapeDrive = 3
  4. slotCassette = 4
  5. slotCoffre = 5
  6.  
  7.  
  8. function police()
  9. turtle.forward()
  10. turtle.select(slotWaypoint)
  11. if not turtle.compareDown() then
  12. turtle.select(slotCoffre)
  13. if turtle.compareDown() then
  14. plein()
  15. else
  16. turtle.back()
  17. turtle.turnRight()
  18. end
  19. end
  20. p = peripheral.wrap("left")
  21. entites = p.getNearbyEnt(10)
  22.  
  23. for k,v in pairs(entites) do
  24. if v.type == "Player" and v.username ~= "aypierre" and v.username ~= "As2piK" then
  25. alerte()
  26. break
  27. end
  28. end
  29. end
  30.  
  31. function alerte()
  32. turtle.select(slotTapeDrive)
  33. turtle.place()
  34. q = peripheral.wrap("front")
  35. turtle.select(slotCassette)
  36. turtle.drop(1)
  37. q.seek(-9999999)
  38. q.play()
  39. os.sleep(4)
  40. q.stop()
  41. turtle.suck()
  42. turtle.select(slotTapeDrive)
  43. turtle.dig()
  44. end
  45.  
  46. function plein()
  47. if turtle.getFuelLevel() < 500 then
  48. turtle.select(slotCharbon)
  49. turtle.suckDown()
  50. turtle.refuel()
  51. end
  52. end
Add Comment
Please, Sign In to add comment