because right now i am having to cycle the turtle.select(1) then going to (2) then (3) ect. is there away for me just to go
turtle.placeUp()
turtle.dropUp() then just have it drop all its items up?
for i=1, 16 do
turtle.select(1)
turtle.dropUp()
end
Ehem, turtle.select(i) not turtle.select(1) ^_^/>You could use a loop:for i=1, 16 do turtle.select(1) turtle.dropUp() end
I have been on IRC for 11 hours :P/> Can't think while tired :P/>Ehem, turtle.select(i) not turtle.select(1) ^_^/>You could use a loop:for i=1, 16 do turtle.select(1) turtle.dropUp() end
Yeah, I know the feeling :P/>I have been on IRC for 11 hours :P/> Can't think while tired :P/>Ehem, turtle.select(i) not turtle.select(1) ^_^/>You could use a loop:for i=1, 16 do turtle.select(1) turtle.dropUp() end
while turtle.detect() do
-- your code here
end
A good attention to detail usually helps.
turtle.placeUp(1)
place up the chest
for i=1,16 do
and for each slot
turtle.select(i)
turtle.dropUp()
turtle.digUp()
turtle.suck()
drop items from the slot, DIG THE CHEST, and for some reason suck items from somewhere.
end
End the loop.
local function empty()
if turtle.getItemCount(16) < 15 then
turtle.select(1)
turtle.placeUp()
for i = 1, 16 do
turtle.select(i)
turtle.dropUp()
end
turtle.select(1)
turtle.digUp()
end
end
local args = {...}
local times = tonumber(args[1]) -- this is how many times we want to run the program
local args = {...}
print(args[1]) --> foo
print(args[2]) --> bar
print(args[3]) --> baz
local args = {...}
local times = tonumber(args[1]) -- this is how many times we want to run the program
for i=1, times do
-- your code
end
local args = {...} -- Get arguments and put them into the 'args' table
if args[2] then -- If the program is used incorrectly
print("Usage: test [times]") -- Help the user on how to correctly use it
error() -- Quit
end
if not args[1] then -- If no amount is supplied
local n = 1 -- Set to run 1 time
else -- Otherwise if an amount IS supplied
local n = tonumber(args[1]) -- Set it to run that many times
end
for i = 1,n do -- Start the loop
<code> -- Insert your code here
end