Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local events = {}
- local inspects = {}
- local scans = 0
- local w,h = term.getSize()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.green)
- print("Scan: ")
- term.setTextColor(colors.red)
- print("Inspect: ")
- term.setTextColor(colors.blue)
- print("Event: ")
- term.setTextColor(colors.gray)
- while true do
- events = {os.pullEvent()}
- if events[1] == "mouse_click" and events[4] == 2 and events[3] < 7 then
- term.setCursorPos(10,2)
- inspects = {turtle.inspect()}
- write(tostring(inspects[1]).." ")
- if inspects[1] then
- write(inspects[2].name.." "..inspects[2].metadata)
- local x,y = term.getCursorPos()
- write(string.rep(" ",w-x))
- end
- end
- if events[1] == "mouse_click" and events[4] == 1 and events[3] < 5 then
- term.setCursorPos(7,1)
- scans = turtle.getItemDetail()
- if scans then
- write(scans.name.." "..scans.damage.." "..scans.count)
- local x,y = term.getCursorPos()
- write(string.rep(" ",w-x))
- end
- end
- if events[1] == "char" and tonumber(events[2])~=nil and tonumber(events[2])~=0 then
- turtle.select(tonumber(events[2]))
- local data = turtle.getItemDetail()
- term.setCursorPos(7,1)
- if data then
- write(data.name.." "..data.damage.." "..data.count)
- local x,y = term.getCursorPos()
- write(string.rep(" ",w-x))
- end
- else
- term.setCursorPos(7,1)
- print("No item in selected slot")
- end
- term.setCursorPos(1,4)
- for i=1,#events do
- write(events[i])
- local x,y = term.getCursorPos()
- write(string.rep(" ",w-x))
- write("\n")
- end
- for i=1,4 do
- term.setCursorPos(1,#events+i+3)
- write(string.rep(" ",w))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement