Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slot = {
- "input", --1
- "bow",
- "unbreaking_1", --3
- "unbreaking_2", --4
- "unbreaking_3", --5
- "punch_1"," --6
- "power_1", --7
- "power_2", --8
- "power_3", --9
- }
- local function output(str,line)
- term.setCursorPos(1,line)
- term.clearLine()
- term.write(str)
- end
- local function compare()
- turtle.select(1)
- local s
- for s=2,#slot do
- if turtle.compareTo(s) then
- return slot[s]
- end
- end
- return false
- end
- term.setCursorPos(1,1)
- term.clear()
- print(string.format("#%d %s",
- os.getComputerID(),
- os.getComputerLabel()))
- local t = os.startTimer(.2)
- while true do
- local e,p = os.pullEvent()
- if e=="turtle_inventory" then
- output("Manage inventory",2)
- local test = compare()
- output("manage inventory: "..(test and test or "unknown"))
- if not test then
- --unusual enchant
- elseif test=="bow" then
- --casual bow
- else
- --usual enchant
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment