Posted 31 May 2013 - 11:12 PM
I've been thinking about a tunneling script for a turtle that when it's inventory is full dumps it to an enderchest in slot one, but I can't seem to work out how to define a variable that is defined by the value of a turtle function,
n = return turtle.getItemCount(15) -- I think this is how you check if the turtle has inv space?
local function Dump() -- Dumps entire inventory to an ender chest in slot 1 then breaks the chest
turtle.dig()
turtle.place(1)
turtle.select(2)
turtle.drop(64)
turtle.select(3)
turtle.drop(64)
turtle.select(4)
turtle.drop(64)
turtle.select(5)
turtle.drop(64)
turtle.select(6)
turtle.drop(64)
turtle.select(7)
turtle.drop(64)
turtle.select(8)
turtle.drop(64)
turtle.select(9)
turtle.drop(64)
turtle.select(10)
turtle.drop(64)
turtle.select(11)
turtle.drop(64)
turtle.select(12)
turtle.drop(64)
turtle.select(13)
turtle.drop(64)
turtle.select(14)
turtle.drop(64)
turtle.select(15)
turtle.drop(64)
turtle.select(16)
turtle.drop(64)
turtle.select(1)
sleep(20)
turtle.dig()
end
local function Mine() -- mining script not much to see here
turtle.dig()
turtle.forward()
turtle.digUp()
end
while n<1 do -- trying to say as long as there is room in slot 15, mine
Mine()
end
if n>1 then
Dump()
end
Edited by