Advertisement
DumperJumper

Untitled

May 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 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 string.find(name, "FERROUS") then
  21. print("'"..name.."' by "..mod.." was found")
  22. turtle.dropUp()
  23. else
  24. print("'"..name.."' by "..mod.." was found")
  25. turtle.drop()
  26. end
  27. else
  28. turtle.dropUp()
  29. end
  30. end
  31. sleep(0.2)
  32. end
  33. sleep(0.5)
  34. end
  35.  
  36. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement