Posted 28 March 2013 - 09:01 PM
Hi:D
EDIT: Sorry.. the [code.] tags didnt indent the code
im on a tekkit server with my friend, and he asked me to make list above all our chests, which contains "Copper", "Tin" etc. but.
im a bit tired right now, and cant figure out, how to do this automatically.
more information comming soon
screenie:
all the signs on this screenshot, is what i want to be monitors.
old code:(my first attempt)
thanks in advance
EDIT: Sorry.. the [code.] tags didnt indent the code
im on a tekkit server with my friend, and he asked me to make list above all our chests, which contains "Copper", "Tin" etc. but.
im a bit tired right now, and cant figure out, how to do this automatically.
local mon = peripheral.wrap("left")
local length = mon.getSize()
local sp = mon.setCursorPos
local w = mon.write
function getData()
data = fs.open("data", "r")
data.readAll()
data.close()
end
function saveData()
data1 = fs.open("data", "w")
for i = 1, #data do
fs.writeLine(data[i])
end
data1.close()
end
local ores = {
[1] = { ['Copper'] = 32,
['Iron'] = 32,
['Gold'] = 32, } -- monitor 1 (above the 1 chest, should print "Copper", Iron, Gold --
-- all of them ... (8 monitors at all)
}
local mon = peripheral.wrap('left')
for i, v in pairs( ores ) do
sp(v,v)
w(v)
end
could anyone please help me making that to happen?more information comming soon
screenie:
Spoiler
all the signs on this screenshot, is what i want to be monitors.
old code:(my first attempt)
local mon = peripheral.wrap("left")
local length = mon.getSize()
local sp = mon.setCursorPos
local w = mon.write
function getData()
data = fs.open("data", "r")
data.readAll()
data.close()
end
function saveData()
data1 = fs.open("data", "w")
for i = 1, #data do
fs.writeLine(data[i])
end
data1.close()
end
local ores = {
[1] = { ['Copper'] = 32,
['Iron'] = 32,
['Gold'] = 32, } -- monitor 1 (above the 1 chest, should print "Copper", Iron, Gold --
-- all of them ...
}
local mon = peripheral.wrap('left')
-- this is what i did, quickly. but that is what i want to be automated. (checking the ores table and printing the containing data)
sp(1,1)
w(ores[1][1])
sp(1,2)
w(ores[1][2])
sp(1,3)
w(ores[1][3])
-- etc...
thanks in advance