Last active
June 15, 2021 14:12
-
-
Save jarrydstan/33f98793f72fac8936a23829420decb4 to your computer and use it in GitHub Desktop.
Transfers wood from chest to furnace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local SLOT_COUNT = 16 | |
function getItemIndex(itemName) | |
for slot = 1, SLOT_COUNT, 1 do | |
local item = turtle.getItemDetail(slot) | |
if(item ~= nil) then | |
if(string.match(item.name, itemName)) then | |
return slot | |
end | |
end | |
end | |
end | |
function getWood() | |
turtle.suck() | |
while(true) do | |
woodIndex = getItemIndex("log") | |
if(woodIndex == nil) then | |
turtle.suck() | |
turtle.drop() | |
else | |
turtle.select(woodIndex) | |
turtle.dropUp() | |
return true | |
end | |
end | |
return true | |
end | |
function orientate() | |
while true do | |
x, table = turtle.inspect() | |
if not string.match( table.name,"chest" ) then | |
turtle.turnLeft() | |
else | |
return true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment