Advertisement
Guest User

Police

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