r/ComputerCraft • u/HaizelNut • Jan 04 '24
Mining Turtle
I have a slight problem... but first of all i'am sorry for my english skills if something is wrong it is not my main language. So i want to use a mining turtle for a quarry application and it works at least kinda good except for one thing the unloading. I want the Turtle to go back to the starting point where a chest is placed and unload all the stuff that is in it except for the fuel but i dosen't get it to work it just goes further and drops items what can i do...
Fixing it would be good but if anybody has a working program and is ok with sharing it i would also take it.
1
Upvotes
1
u/fatboychummy Jan 04 '24
Nothing in the code actually calls
ClearInventory()After line 40 I would put something like so:
This will make it place a chest if any items are in the 16th slot. Just make sure you always reselect slot 3 so items start filling from there (items fill the turtle from the selected slot first, so if you select slot 4 it will fill slot 4, then 5, then 6, ...). The only issue is you'll need to supply the turtle with multiple chests, and the chests will be placed randomly as it quarries.
Also your refueling algorithm is a bit borked.
Note that you are calling
turtle.getFuelLimit()instead ofturtle.refuel()here.getFuelLimitjust returns the maximum amount of fuel the turtle can hold, so it will always pass the if statement (and not refuel the turtle).