Posted 07 May 2013 - 03:23 PM
"Title:" Sortingsystemproblem
Hello i am trying to build a Sortingsystem with a interactive sorter. I can start my code (so i hope no logical mistakes) but when i put anything into the sorter i get the problem sort :8: attemt to call nil. And here is ma Code:
thank you for helping
your malo13
Hello i am trying to build a Sortingsystem with a interactive sorter. I can start my code (so i hope no logical mistakes) but when i put anything into the sorter i get the problem sort :8: attemt to call nil. And here is ma Code:
m = peripheral.wrap("right")
x =1
name = 0
function ItemName_Menge()
print(ID)
print(menge_hinzu)
items=fs.open(ID,"a")
name = items.readLine()
if ( name == 0 ) then
while ( x ==1) do
print("Was ist das Item mit der ID"..ID)
name1 = read()
name2 = print("Bitte kontroliere die Eingabe und wiederhole Sie")
if name1 == name2 then
items.writeLine(name)
items.writeLine(menge_neu)
x = 0
end
end
else
menge_alt = items.readLine()
items.close()
end
end
function item_empfangen()
event, ID, menge_hinzu = os.pullEvent("isort_item")
ID = tostring(ID)
menge_hinzu = tostring(menge_hinzu)
end
function menge_addieren()
fs.makeDir("items")
items=fs.open("items/"..ID,"w")
menge_neu = menge_alt + menge_hinzu
items.writeLine(name)
items.writeLine(menge_neu)
items.close()
end
function ausgabe()
shell.run("clear")
term.write(name.."wurde"..menge_hinzu" mal ins System aufgenommen und ist nun"..menge_neu.."vorhanden")
end
item_empfangen()
ItemName_Menge()
menge_addieren()
ausgabe()
thank you for helping
your malo13
Edited by