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

taking items from a chest

Started by protexxi, 09 October 2012 - 12:03 PM
protexxi #1
Posted 09 October 2012 - 02:03 PM
I wish to place a ender chest retrieve fuel and then refuel

i have a function to refuel
and i have

turtle.select(15)
turtle.placeUp()
turtle.select(14)
turtle.takeUp(5)
turtle.select(15)
turtle.digUp()
end

but it dosent work any ideas?
Doyle3694 #2
Posted 09 October 2012 - 02:09 PM
turtle.suck()
protexxi #3
Posted 09 October 2012 - 02:10 PM
what?
Doyle3694 #4
Posted 09 October 2012 - 02:10 PM
Also, this is on the wiki, please don't ask here without reading the wiki first.
http://computercraft.info/wiki/index.php?title=Turtle_%28API%29
Orwell #5
Posted 09 October 2012 - 02:28 PM
Ender chests won't work for turtles. The contents of ender chests are stored in the player data. Turtles have no player data.
protexxi #6
Posted 09 October 2012 - 02:36 PM
they do work i have it working but my if statment has a error now
protexxi #7
Posted 09 October 2012 - 02:43 PM
looked on the wiki there is no is no help for a goto command e.g

if x <5 then
goto "refuel"
::refuel::
turtle.refuel()
goto "run"
::run::
code here
sends a error on the ::run::
faubiguy #8
Posted 09 October 2012 - 03:05 PM
There is no goto in lua 5.1, which ComputerCraft uses. Use this instead:

if x < 5 then
 turtle.refuel()
end
--code here
protexxi #9
Posted 09 October 2012 - 03:19 PM
i need the code to count so every time it runs it dose x-1 then when x is <5 it runs a a diffident program
protexxi #10
Posted 09 October 2012 - 03:21 PM
this would work

x = 64
if x <5 then
getfuel()
refuel()
tunnel()
end
else if x >5
getfuel()
refuel()
down()
empty()
end
end
but i need it to loop forever?
jag #11
Posted 09 October 2012 - 03:59 PM
Ender chests won't work for turtles. The contents of ender chests are stored in the player data. Turtles have no player data.
I think he means the ender storage mod, not the implemented ender chests.
And you can't even break the ender chests, unless you got a silk touch pickaxe (wich isn't available for turtles…)