Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("left")
- local ae = peripheral.wrap("back")
- local items = {
- cobble = {4, 0, colors.gray},
- stone = {1, 0, colors.lightGray},
- sbricks = {980, 0, colors.lightGray},
- sand = {12, 0, colors.yellow},
- glass = {20, 0, colors.white},
- obsdian = {49, 0, colors.purple},
- iron = {265, 0 , colors.lightGray},
- redst = {331, 0, colors.red},
- gold = {266, 0, colors.yellow},
- diam = {264, 0, colors.cyan},
- quartz = {5758, 8, colors.lightBlue},
- uranium = {18006, 0 , colors.lime},
- tin = {8883, 64 , colors.white},
- copper = {8883, 63 , colors.orange},
- }
- function draw(t)
- mon = peripheral.wrap("left")
- mon.setTextScale(0.5)
- term.setCursorPos(1,1)
- hmargin = 0
- vmargin = 0
- x = 1
- y = 1
- i=0
- for k,v in pairs(t) do
- paint(v[3])
- term.setCursorPos(x,y)
- print(k..":")
- paint(1)
- term.setCursorPos(x+9, y)
- print(ae.countOfItemType(v[1],v[2]))
- y = y+1
- if i % 8 == 0 and i ~= 0 then
- x = x + 14
- y = 0
- end
- i = i + 1
- end
- term.setCursorPos(34, 3)
- print(">")
- term.setCursorPos(34, 7)
- print("<")
- os.sleep(5)
- mon.clear()
- end
- page = 0
- function getPage(page)
- thisPage{}
- for idx = page*16, idx+16, 1 do
- if items[idx] then
- table.insert(items[idx], thisPage)
- end
- end
- return thisPage
- end
- while true do
- p = getPage(page)
- draw(p)
- os.queueEvent("")
- evt, btn, x, y = os.pullEvent("mouse_click")
- if evt and x > 32 and y < 5 then
- page = page + 1
- elseif evt and x > 32 and y > 5 and page > 0 then
- page = page - 1
- end
- function paint(color)
- if color ~= nil then
- mon.setTextColor(color)
- else
- mon.setTextColor(colors.white)
- end
- end
Add Comment
Please, Sign In to add comment