Posted 31 January 2013 - 07:17 AM
Hello!
I recently started playing the Feed The Beast mods and am loving turtles!
Below the cut I have posted my first turtle program. Its purpose is to go up and down a wall and replace all the block spots with cobble.
Some issues I have run into are that it doesn't return and dump if it is full, it can't pick cobble from other slots except the one listed, and if it runs out it just mines ou the entire wall without stopping.
I am doing more research and code reading from other people programs but would love to hear any feedback the Pro's have!
Thanks!!
MortymerXT
– Variables
a=1
d=1
– Functions
– Refueling
function JuiceUp()
turtle.select(1)
turtle.refuel(1)
end
function NeedFuelCheck()
if turtle.getFuelLevel() < 10 then
JuiceUp()
else
end
end
– Plaster Up
function plasterup()
NeedFuelCheck()
if turtle.detectUp() == true then
moveover()
d=0
else
turtle.up()
turtle.dig()
turtle.select(2)
turtle.place()
end
end
– Plaster Down
function plasterdown()
NeedFuelCheck()
if turtle.detectDown() == true then
moveover()
d=1
else
turtle.down()
turtle.dig()
turtle.select(2)
turtle.place()
end
end
– Move Over
function moveover()
turtle.turnRight()
if turtle.detect() == false then
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.select(2)
turtle.place()
else
a=0
end
end
– Execution
while a == 1 do
if a == 1 and d == 1 then
plasterup()
else
if a == 1 and d == 0 then
plasterdown()
end
end
end
I recently started playing the Feed The Beast mods and am loving turtles!
Below the cut I have posted my first turtle program. Its purpose is to go up and down a wall and replace all the block spots with cobble.
Some issues I have run into are that it doesn't return and dump if it is full, it can't pick cobble from other slots except the one listed, and if it runs out it just mines ou the entire wall without stopping.
I am doing more research and code reading from other people programs but would love to hear any feedback the Pro's have!
Thanks!!
MortymerXT
Spoiler
– Wall Plaster v1.5 by MortymerXT– Variables
a=1
d=1
– Functions
– Refueling
function JuiceUp()
turtle.select(1)
turtle.refuel(1)
end
function NeedFuelCheck()
if turtle.getFuelLevel() < 10 then
JuiceUp()
else
end
end
– Plaster Up
function plasterup()
NeedFuelCheck()
if turtle.detectUp() == true then
moveover()
d=0
else
turtle.up()
turtle.dig()
turtle.select(2)
turtle.place()
end
end
– Plaster Down
function plasterdown()
NeedFuelCheck()
if turtle.detectDown() == true then
moveover()
d=1
else
turtle.down()
turtle.dig()
turtle.select(2)
turtle.place()
end
end
– Move Over
function moveover()
turtle.turnRight()
if turtle.detect() == false then
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.select(2)
turtle.place()
else
a=0
end
end
– Execution
while a == 1 do
if a == 1 and d == 1 then
plasterup()
else
if a == 1 and d == 0 then
plasterdown()
end
end
end