This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TimTheRedstoner's profile picture

Turtle Item Counter

Started by TimTheRedstoner, 03 June 2014 - 11:40 AM
TimTheRedstoner #1
Posted 03 June 2014 - 01:40 PM
so im trying to make a item counter for my market but i cant get this to work the code is

function count()
l = 0
for i = 1, 16 do
turtle.suck()
turtle.select(i)
end

for i = 1, 16 do
turtle.select(i)
l = l + turtle.getItemCount(i)
end
file = fs.open("disk/cobble", "w")
file.write(l)
file.close
for s = 1, 16 do
turtle.select(s)
turtle.drop()
end
end
while true do
count()
sleep(2)
end

the error i get is " Bios:366: [string "itemp":15: '=' expected
thanks in advance
Edited on 03 June 2014 - 11:42 AM
KingofGamesYami #2
Posted 03 June 2014 - 01:48 PM
Is this the entire code? Line 15 is

for s = 1, 16 do
which shouldn't throw that error.
MKlegoman357 #3
Posted 03 June 2014 - 01:49 PM
Why u no read this post?

Spoiler

EDIT: Don't take this too seriously, just don't forget to read sticky posts next time.
Edited on 03 June 2014 - 11:52 AM
TheOddByte #4
Posted 03 June 2014 - 01:57 PM
You forgot the paranthesis here

file.close
TimTheRedstoner #5
Posted 03 June 2014 - 03:00 PM
thankyou so much