51 posts
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?
818 posts
Posted 09 October 2012 - 02:09 PM
turtle.suck()
51 posts
Posted 09 October 2012 - 02:10 PM
what?
818 posts
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
1054 posts
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.
51 posts
Posted 09 October 2012 - 02:36 PM
they do work i have it working but my if statment has a error now
51 posts
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::
231 posts
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
51 posts
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
51 posts
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?
521 posts
Location
Stockholm, Sweden
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…)