Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- geo = peripheral.wrap("back")
- function getNameFormatted(block, amount)
- local ns,id = string.match(block,"([%a%d_]+):([%a%d_]+)")
- return string.format("%dx %s",amount,id)
- end
- function draw()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- term.write("CHUNK ANALYZER")
- local list = geo.chunkAnalyze()
- if list==nil then
- term.setTextColor(colors.red)
- term.setCursorPos(1,3)
- term.write("SCANNING ON COOLDOWN!")
- return
- end
- local line = 3
- for block,count in pairs(list) do
- term.setCursorPos(1,line)
- term.write(getNameFormatted(block,count))
- line = line+1
- end
- end
- while true do
- local _,k = os.pullEvent("char")
- if k=="r" then
- draw()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement