Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- emptyInvCount = 0
- local side = "left"
- 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
- while true do
- local emptyInv = true
- for slot=1, 16, 1 do
- turtle.select(slot)
- if turtle.getItemCount() > 0 then
- emptyInv = false
- local name = split(string.upper(turtle.getItemDetail()["name"]), ":")[2]
- local mod = split(string.upper(turtle.getItemDetail()["name"]), ":")[1]
- if string.find(name, "ORE") then
- if string.find(name, "FERROUS") or string.find(name, "URAN") or string.find(mod, "PROJRED|CORE") or string.find(mod, "THAUMCRAFT") then
- print("'"..name.."' by "..mod.." was found")
- turtle.dropUp()
- else
- print("'"..name.."' by "..mod.." was found")
- turtle.drop()
- end
- else
- turtle.dropUp()
- end
- end
- sleep(0.2)
- end
- rednet.open(side)
- local rID = rednet.lookup("QIMP", "QI_Monitor")
- if rID then
- if emptyInv then
- rednet.send(rID, "qi:InvEmpty", "QIMP")
- else
- rednet.send(rID, "qi:InvOK", "QIMP")
- end
- else
- print("WARNING: Could not resolve hostname QI_Monitor")
- end
- rednet.close(side)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement