Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dispInvAsTbl(monitor,x,y) --Displays the inventory of the turtle as a 4 x 4 table relative to the x and y coordinates specified.
- local c = 1
- while( c < 17) do
- monitor.setCursorPos((c - (4 * (math.ceil(c/4) - 1))) * 3 + x - 3, math.ceil(c/4) + y - 1)
- monitor.write(string.sub(turtle.getItemCount(c), -2))
- monitor.setCursorPos((c - (4 * (math.ceil(c/4) - 1))) * 3 + x - 1, math.ceil(c/4) + y - 1)
- if((c - (4 * (math.ceil(c/4) - 1))) ~= 4 ) then
- monitor.write("|")
- end
- c = c + 1
- end
- end
- mon = peripheral.wrap("left")
- mon.clear()
- local x = read()
- local y = read()
- dispInvAsTbl(mon,x,y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement