I'm realy trying to learn all that lua stuff and how to use ComputerCraft for usefull stuff.
On every project that i started the time comes that i cant fix my problems because i'm to new in lua.
Because of that i'm trying to learn everything step by step instead of just jumping right into a big project.
I found a nice little tutorial on youtube and i'm trying to follow it step by step.
But it seems like i'm stuck now. The code that i used works fine on the youtube video.
My setup is easy. Its just a computer ontop of a ME Interface. On one side of the interface a chest.
Got some wood in my ME Drive and the Computer can find that wood if i run this:
Spoiler
me = peripheral.wrap("bottom")
liste = me.getAvailableItems()
for nummer, item in pairs(liste) do
print(item.id.." "..item.dmg.." "..item.qty.." "..item.name)
end
But when i try to suck some items out of the ME and push them into the chest i just get
bios:366: [string "test"]:6: function arguments expected
This code seems to work fine in the video i'm watching:
Spoiler
me = peripheral.wrap("bottom")
liste = me.getAvailableItems()
for nummer, item in pairs(liste) do
-- print(item.id.." "..item.dmg.." "..item.qty.." "..item.name)
if item.id == minecraft:planks and item.dmg == 0 then
liste[nummer].qty = 17
ret = me.extractItem(liste[nummer], "west")
print("rausgeworfen")
print("ret = "..ret)
end
end
I dont get why this is working in the video but not on my part.
Anyone here that maybe can find the problem and help me getting better in lua?