Posted 03 January 2017 - 07:08 PM
So im back after a long time away from computercraft
I am playing a survival map i have wanted to create for a long time
the thing is i want to make to put onto screen what marterials i have in my storage in my secreet evil lair section.
peripheral.wrap("mcp_mobius_betterbarrel_0")
peripheral.wrap("mcp_mobius_betterbarrel_1")
peripheral.wrap("mcp_mobius_betterbarrel_2")
peripheral.wrap("mcp_mobius_betterbarrel_3")
peripheral.wrap("mcp_mobius_betterbarrel_4")
peripheral.wrap("mcp_mobius_betterbarrel_5")
peripheral.wrap("mcp_mobius_betterbarrel_6") }
–this one was the first and it displayed correctly in this code.
– barrel.wrap("mcp_mobius:betterbarrel_0")
local function write( … )
for _,mon in pairs( monitors ) do
mon.write( … )
end
end
mon = peripheral.wrap("monitor_9")
tbl = barrel.getStoredItems()
name= tbl.display_name
qty = tbl.qty
– while true do
mon.clear()
mon.setCursorPos(1,1)
mon.write(name)
mon.setCursorPos(12,1)
mon.write(qty)
– end
what i want to do is foloving.
while true do
mon.clear()
mon.setCursorPos(1,1)
mon.write(name)
mon.setCursorPos(12,1)
mon.write(qty)
end
and this should continue but on a new line and foreward like being
while true do
mon.clear()
mon.setCursorPos(1,2) + 1 for each barrel added to the table. etc
mon.write(name)
mon.setCursorPos(12,2) + 1 for each barrel added to the table. etc
mon.write(qty)
Hope someone can help me with this as this can help mee understand the table thingy better.
Petz
I am playing a survival map i have wanted to create for a long time
the thing is i want to make to put onto screen what marterials i have in my storage in my secreet evil lair section.
Spoiler
local barrel = {peripheral.wrap("mcp_mobius_betterbarrel_0")
peripheral.wrap("mcp_mobius_betterbarrel_1")
peripheral.wrap("mcp_mobius_betterbarrel_2")
peripheral.wrap("mcp_mobius_betterbarrel_3")
peripheral.wrap("mcp_mobius_betterbarrel_4")
peripheral.wrap("mcp_mobius_betterbarrel_5")
peripheral.wrap("mcp_mobius_betterbarrel_6") }
–this one was the first and it displayed correctly in this code.
– barrel.wrap("mcp_mobius:betterbarrel_0")
local function write( … )
for _,mon in pairs( monitors ) do
mon.write( … )
end
end
mon = peripheral.wrap("monitor_9")
tbl = barrel.getStoredItems()
name= tbl.display_name
qty = tbl.qty
– while true do
mon.clear()
mon.setCursorPos(1,1)
mon.write(name)
mon.setCursorPos(12,1)
mon.write(qty)
– end
what i want to do is foloving.
while true do
mon.clear()
mon.setCursorPos(1,1)
mon.write(name)
mon.setCursorPos(12,1)
mon.write(qty)
end
and this should continue but on a new line and foreward like being
while true do
mon.clear()
mon.setCursorPos(1,2) + 1 for each barrel added to the table. etc
mon.write(name)
mon.setCursorPos(12,2) + 1 for each barrel added to the table. etc
mon.write(qty)
Hope someone can help me with this as this can help mee understand the table thingy better.
Petz