Posted 12 April 2012 - 01:54 AM
What code do I use to see what items are in a chest? So something like there is 40 redstone in a chest, but I want the computer to tell me how many are in the chest? Thanks in advance!
[list=1]
[*]
print("Please enter the ammount of Copper Ingots.")
[*]
copper = io.read()
[/list]
try = turtle.suck()
while try == false do
os.sleep(1)
try = turtle.suck()
end
turtle.drop()
redstone.setOutput("right", true)
stop = false
c = 0
while stop == false do
os.sleep(1)
stop = redstone.getInput("back")
c = c + 1
if redstone.getOutput("right") == true then
if c > 1500 then
redstone.setOutput("right", false)
c = 0
end
else
if c > 20 then
redstone.setOutput("right", true)
c = 0
end
end
end
redstone.setOutput("right", false)
try = true
while try == true do
suck = turtle.suck()
if suck == true then
os.sleep(1)
try = turtle.drop()
end
if turtle.compareTo(2) == false then
try = false
end
end
redstone.setOutput("back", true)
c = 3
while c < 17 do
turtle.select(c)
turtle.suck()
c = c + 1
end