View difference between Paste ID: 7A8T2i5e and G8KCjQA2
SHOW: | | - or go back to the newest paste.
1-
local pim = peripheral.wrap("pim_1")
1+
local meTerminal = peripheral.wrap("left")
2-
local mon = peripheral.wrap("monitor_71")
2+
local mon = peripheral.wrap("right")
3
4
--Don't change anything below this line
5
local items
6-
if (not fs.exists("invjson")) then
6+
local encoded
7-
    shell.run("pastebin", "get", "4nRg9CHU", "invjson")
7+
8
if (not fs.exists("json")) then
9-
os.loadAPI("invjson")
9+
    shell.run("pastebin", "get", "4nRg9CHU", "json")
10
end
11-
local lastPlayer
11+
os.loadAPI("json")
12
13-
function renderBottom(_color)
13+
encoded = {}
14-
    mon.setBackgroundColor(_color)
14+
items = meTerminal.getAvailableItems()
15-
    _x, _y = mon.getSize()
15+
for v in pairs(items) do
16-
    for x = 1, _x, 1 do
16+
    mon.setCursorPos(1,v)
17-
        mon.setCursorPos(x, _y)
17+
    mon.write(json.encode(items[v]))
18-
        mon.write(" ")
18+
    print(json.encode(items[v]))
19-
    end
19+
    encoded[v] = json.encode(items[v])
20-
    mon.setBackgroundColor(colors.black)
20+
21
22
print("[" .. table.concat(encoded, ",") .. "]")
23-
function playerOn()
23+