Advertisement
DumperJumper

Untitled

May 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. function split(inputstr, sep)
  2. if sep == nil then
  3. sep = "%s"
  4. end
  5. local t={} ; i=1
  6. for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  7. t[i] = str
  8. i = i + 1
  9. end
  10. return t
  11. end
  12.  
  13. for i=0, 100, 1 do
  14. for slot=1, 16, 1 do
  15. turtle.select(slot)
  16. if turtle.getItemCount() > 0 then
  17. local name = split(string.upper(turtle.getItemDetail()["name"]), ":")[1]
  18. local mod = split(string.upper(turtle.getItemDetail()["name"]), ":")[0]
  19. if string.find(name, "ORE") then
  20. if not string.find(name, "FERROUS") then
  21. print("'"..name.."' by "..mod.." was found")
  22. turtle.drop()
  23. else
  24. turtle.dropUp()
  25. end
  26. else
  27. turtle.dropUp()
  28. end
  29. end
  30. sleep(0.2)
  31. end
  32. sleep(0.5)
  33. end
  34.  
  35. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement