Posted 18 September 2012 - 05:03 PM
Hello
I have downloaded the code of a sorting machine, but somehow I do get an error: Attempt to call nil
This is the code:
The link with the ZIP (The startup + movements files):
http://www.mediafire...5mrk56mm6hck5cw
Hope somebody can help me out.
Greets
I have downloaded the code of a sorting machine, but somehow I do get an error: Attempt to call nil
This is the code:
function sortStuff()
turtle.suck()
if turtle.compareTo(2) == true then shell.run("coal")
elseif turtle.compareTo(3) == true then shell.run("Spiston")
elseif turtle.compareTo(7) == true then shell.run("piston")
elseif turtle.compareTo(16) == true then shell.run("flint")
elseif turtle.compareTo(12) == true then shell.run("redstonetorch")
elseif turtle.compareTo(4) == true then shell.run("redstone")
elseif turtle.compareTo(10) == true then shell.run("stone")
elseif turtle.compareTo(11) == true then shell.run("cobblestone")
elseif turtle.compareTo(8) == true then shell.run("redstonerepeater")
elseif turtle.compareTo(9) == true then shell.run("dirt")
elseif turtle.compareTo(5) == true then shell.run("goldore")
elseif turtle.compareTo(6) == true then shell.run("ironore")
elseif turtle.compareTo(13) == true then shell.run("sandstone")
elseif turtle.compareTo(14) == true then shell.run("sand")
elseif turtle.compareTo(15) == true then shell.run("stonebricks")
else shell.run("other")
end
end
shell.run("clear")
print "Robotic Sorting Machine- enter SORT to run organization program."
input=read()
if input == "SORT" then shell.run("clear")
print "Working...because you're too lazy to do this yourself..."
end
for x=1,27 do sortStuff()
end
The link with the ZIP (The startup + movements files):
http://www.mediafire...5mrk56mm6hck5cw
Hope somebody can help me out.
Greets