Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables --
- local tJunkItems = {
- "minecraft:potion",
- "minecraft:leather_boots",
- "minecraft:dirt",
- "minecraft:tripwire_hook",
- "minecraft:rotten_flesh"
- }
- local sItemOutput = "front"
- local sJunkOutput = "bottom"
- local tSideMapping = {
- front = "drop",
- bottom = "dropDown",
- top = "dropUp"
- }
- -- Variables --
- -- Functions --
- local function sort()
- local tItem = turtle.getItemDetail()
- if not tItem then
- return
- end
- for _, v in pairs(tJunkItems) do
- if tItem.name == v then
- turtle[tSideMapping[sJunkOutput]]()
- return
- end
- end
- turtle[tSideMapping[sItemOutput]]()
- end
- -- Functions --
- -- Main Program --
- local e
- while true do
- e = {os.pullEvent()}
- if e[1] == "char" and e[2]:lower() == "q" then
- break
- elseif e[1] == "turtle_inventory" then
- sort()
- end
- end
- -- Main Program --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement