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

mining turtle that checks loot chest

Started by Vorg, 03 August 2014 - 06:52 AM
Vorg #1
Posted 03 August 2014 - 08:52 AM
I'm using this mining program: http://www.computercraft.info/forums2/index.php?/topic/10106-yet-another-quarry-my-3-layers-per-pass-variable-sized-hole-excavator/ and it works fine, but I would like the turtle to check loot chest and maybe even scoop bee hives. Any programs like that around?
KingofGamesYami #2
Posted 03 August 2014 - 04:10 PM
<shameless promotion> I've got a branch mining script that will empty chests and other inventories when it runs into them. </shameless promotion>

Here's how I do it, if you are interested in writing/modifying your own:

if turtle.suck() then --#if an inventory with items in it, suck will return true
 while turtle.suck() do end --#basically, keep sucking until nothing is left to suck
end
--#repeat for all directions
flaghacker #3
Posted 03 August 2014 - 05:05 PM
<shameless promotion> I've got a branch mining script that will empty chests and other inventories when it runs into them. </shameless promotion>

Here's how I do it, if you are interested in writing/modifying your own:

if turtle.suck() then --#if an inventory with items in it, suck will return true
while turtle.suck() do end --#basically, keep sucking until nothing is left to suck
end
--#repeat for all directions

Why do you have that if statement?


while turtle.suck() do end
KingofGamesYami #4
Posted 03 August 2014 - 05:46 PM
<shameless promotion> I've got a branch mining script that will empty chests and other inventories when it runs into them. </shameless promotion>

Here's how I do it, if you are interested in writing/modifying your own:

if turtle.suck() then --#if an inventory with items in it, suck will return true
while turtle.suck() do end --#basically, keep sucking until nothing is left to suck
end
--#repeat for all directions

Why do you have that if statement?


while turtle.suck() do end
I've got a bunch of other checks running along side of it. I actually add "and turtle.detect()" to it in my script.
Lyqyd #5
Posted 03 August 2014 - 06:44 PM
Moved to Ask a Pro.
hilburn #6
Posted 03 August 2014 - 08:06 PM
Another option is if you have openp is to have a blacklist of items to not pick up. What turtle needs torches or string?
Vorg #7
Posted 03 August 2014 - 08:57 PM
<shameless promotion> I've got a branch mining script that will empty chests and other inventories when it runs into them. </shameless promotion>

Here's how I do it, if you are interested in writing/modifying your own:

if turtle.suck() then --#if an inventory with items in it, suck will return true
while turtle.suck() do end --#basically, keep sucking until nothing is left to suck
end
--#repeat for all directions

Does turtle.suckUp() and turtle.suckDown() not work now? I tried using these and turtle.suck() empties chest in front, but Up/Down doesn't.
KingofGamesYami #8
Posted 03 August 2014 - 09:13 PM
<shameless promotion> I've got a branch mining script that will empty chests and other inventories when it runs into them. </shameless promotion>

Here's how I do it, if you are interested in writing/modifying your own:

if turtle.suck() then --#if an inventory with items in it, suck will return true
while turtle.suck() do end --#basically, keep sucking until nothing is left to suck
end
--#repeat for all directions

Does turtle.suckUp() and turtle.suckDown() not work now? I tried using these and turtle.suck() empties chest in front, but Up/Down doesn't.
I'm not sure. It should… provided there is room in the turtle's inventory and items in the chest.
Vorg #9
Posted 03 August 2014 - 09:29 PM
Here is the dig up part I modded. Set to just dig a 3 x 2 x 3 and put 3 chest in front stacked each with just a few items. Even tried with just 1 item in each and it empties the middle chest which part of dig forward. But the above and below gets dumped. So turtle is empty cept for a few charcoal for fuel.


local tries = 3
	    while not turtle.up() do
			    if bDebug then print("goUp: while not loop tries="..tries) end
			    if turtle.detectUp() then
					    if bDebug then print("goUp: detectUp") end
-- Dig Up
					    if turtle.suckUp() then --#if an inventory with items in it, suck will return true
							    while turtle.suckUp() do end --#basically, keep sucking until nothing is left to suck
					    end

						  if not turtle.digUp() then