Advertisement
Guest User

startup

a guest
Jul 29th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. oldclock = os.clock()
  2. mon = peripheral.wrap("top")
  3. term.clear()
  4. mon.clear()
  5. while turtle.getItemCount(9) < 64 do
  6. turtle.select(1)
  7. if turtle.detect() then
  8. turtle.dig()
  9. end
  10. sleep(0.0001)
  11. total = 0
  12. for i = 1, 9 do
  13. total = turtle.getItemCount(i) + total
  14. end
  15. mon.clear()
  16. mon.setCursorPos(1, 1)
  17. term.clear()
  18. term.setCursorPos(1, 1)
  19. term.redirect(mon)
  20. print("Status: Generating cobble")
  21. print("Total cobble: " .. total)
  22. print("Time elapsed: " .. (math.ceil(os.clock() - oldclock)) .. " seconds")
  23. aspeed = math.ceil((total/(math.ceil(os.clock() - oldclock)))*600)
  24. speed = aspeed/10
  25. print("Speed: " .. speed .. " cobble/min")
  26. term.restore()
  27. print("Status: Generating cobble")
  28. print("Total cobble: " .. total)
  29. print("Time elapsed: " .. (math.ceil(os.clock() - oldclock)))
  30. aspeed = math.ceil((total/(math.ceil(os.clock() - oldclock)))*600)
  31. speed = aspeed/10
  32. print("Speed: " ..  speed .. " cobble/min")
  33. end
  34. mon.setCursorPos(1, 1)
  35. mon.clearLine()
  36. mon.write("Status: Full!")
  37. mon.setCursorPos(1, 4)
  38. mon.write("Please empty and reboot the turtle")
  39. term.setCursorPos(1, 1)
  40. term.clear()
  41. write("Status: Full!")
  42. term.setCursorPos(1, 4)
  43. write("Please empty and reboot the turtle")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement