Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split(inputstr, sep)
- if sep == nil then
- sep = "%s"
- end
- local t={} ; i=1
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- t[i] = str
- i = i + 1
- end
- return t
- end
- for i=0, 100, 1 do
- for slot=1, 16, 1 do
- turtle.select(slot)
- if turtle.getItemCount() > 0 then
- local name = split(string.upper(turtle.getItemDetail()["name"]), ":")[1]
- local mod = split(string.upper(turtle.getItemDetail()["name"]), ":")[0]
- if string.find(name, "ORE") then
- if not string.find(name, "FERROUS") then
- print("'"..name.."' by "..mod.." was found")
- turtle.drop()
- else
- turtle.dropUp()
- end
- else
- turtle.dropUp()
- end
- end
- sleep(0.2)
- end
- sleep(0.5)
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement