MudkipTheEpic

Turtle Rampage!

Dec 25th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. while true do
  2. local s = 1
  3. if turtle.getFuelLevel() < 20 then
  4. while true do
  5. turtle.select(s)
  6. turtle.refuel(1)
  7. if turtle.getFuelLevel() > 20 then
  8. break
  9. end
  10. if s == 16 then
  11. s = 1
  12. else
  13. s = s+1
  14. end
  15. end
  16. end
  17. s = 1
  18. turtle.select(1)
  19. print("RAMPAGGEEEE!!!!!!")
  20. if turtle.detect() == true then
  21. turtle.dig()
  22. end
  23. if turtle.detectUp() == true then
  24. turtle.digUp()
  25. end
  26. if turtle.detectDown() == true then
  27. turtle.digDown()
  28. end
  29. num = math.random(1,7)
  30. num = math.ceil(num)
  31. if num == 2 then
  32. turtle.forward()
  33. elseif num == 3 then
  34. turtle.turnLeft()
  35. turtle.turnLeft()
  36. turtle.forward()
  37. elseif num == 4 then
  38. turtle.up()
  39. elseif num == 5 then
  40. turtle.down()
  41. elseif num == 6 then
  42. turtle.turnLeft()
  43. if turtle.detect() == true then
  44. turtle.dig()
  45. end
  46. turtle.forward()
  47. elseif num == 7 then
  48. turtle.turnRight()
  49. if turtle.detect() == true then
  50. turtle.dig()
  51. end
  52. turtle.forward()
  53. end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment