Posted 22 March 2012 - 11:01 PM
<iframe width="420" height="315" src="http://www.youtube.com/embed/ZmzA3N3_yXQ" frameborder="0" allowfullscreen></iframe>
This program has 6 main Features
The first Feature is to do place tracks
-You choose how many tracks you want to put in overall
-You can use up to 256 tracks in one use
The second Feature is to place power tracks every x normal tracks
-You can choose to place power track after a variable number of normal tracks that you choose
-You can use up to 64 power tracks in one use
The Third Feature is to put down a block as a floor in case there isnt one
-This feature will let you be calm when you are worrying about gaps in the ground which will stop the track placer (works on gaps,lava,water,air)
- If there isnt any floor to put on it the tracks , you can simply put up to 192 blocks in the track placer and it will place those blocks in the gaps on the ground or on the air
The Fourth Feature is to Break down block
-This feature will break block that are in the way of your track placer or your tracks
-The track placer will drop any block that he picked up when breaking blockes (its a must sorry)
The Fifth Feature is to come back home safely :]
-If you enable this feature , the track placer will go back all the way to the point he started at
The Sixth Feature is to place redstone torch next to every power rail place (thx dsuzyv for the idea)
-After a power rail is placed, the track placer will place a torch on the left side of the power rail to keep it on all the time
-You can use the other features with it to ensure the torch is placed 100% (unless there is bedrock)
Slot 1 - Junk which is being picked up by the Fourth Feature
Slots 2,3,4,5 - Normal tracks
Slot 6 - Power tracks
Slot 7 - Redstone torches
Slots 8,9 - Floor blocks
This mod is very helpfull at building air tracks - with the Third feature which will make the bridge for you + place down the tracks.
The code:
if turtle.detect() then
if c then
turtle.dig() if turtle.getItemCount(1)>0 then
turtle.select(1) turtle.drop() end return false
else return true
end
end
end
function checkD©
if turtle.detectDown() then
if c then
turtle.digDown() if turtle.getItemCount(1)>0 then
turtle.select(1) turtle.drop() end return false
else return true
end
end
end
function checkR()
if turtle.getItemCount(7)>0 then return 7 end
return 0
end
function checkT()
if turtle.getItemCount(2)>0 then return 2 end
if turtle.getItemCount(3)>0 then return 3 end
if turtle.getItemCount(4)>0 then return 4 end
if turtle.getItemCount(5)>0 then return 5 end
return 0
end
function checkF()
if turtle.getItemCount(8)>0 then return 8 end
if turtle.getItemCount(9)>0 then return 9 end
return 0
end
function checkP()
if turtle.getItemCount(6)>0 then return 6 end
return 0
end
function putT(k)
if checkT()==0 then return true end
turtle.select(checkT())
turtle.placeDown()
sleep(0.5)
if not turtle.compareDown(checkT()) then
if k then
if checkF()==0 then return true end
turtle.digDown()
turtle.down()
turtle.select(checkF())
turtle.placeDown()
turtle.up()
turtle.select(checkT())
turtle.placeDown()
return false
else return true
end
end
end
function putP(k,f,l)
if checkP()==0 then return true end
g=true
turtle.select(checkP())
turtle.placeDown()
sleep(0.5)
if not turtle.compareDown(checkP()) then
if k then
if checkF()==0 then return true end
turtle.digDown()
turtle.down()
turtle.select(checkF())
turtle.placeDown()
turtle.up()
turtle.select(checkP())
turtle.placeDown()
else g=false
end
end
if g then
if f then
turtle.turnLeft()
check(l)
turtle.forward()
checkD(l)
turtle.select(checkR())
turtle.placeDown()
sleep(0.5)
if not turtle.compareDown(checkR()) then
if k then
turtle.digDown()
turtle.down()
turtle.select(checkF())
turtle.placeDown()
turtle.up()
turtle.select(checkR())
turtle.placeDown()
end
end
turtle.turnRight()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
return false
else return true
end
end
end
term.clear()
term.setCursorPos(1,1)
write("How many tracks to put? - Sum (Slots 2,3,4,5) ")
print(newline)
Nor=read()
Nor=tonumber(Nor)
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Put Powered Rail every how many tracks? (Slots 6)")
print(newline)
Pow=read()
Pow=tonumber(Pow)
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Put a redstone torch next to every powered rail? (Slots 7) (yes or no)")
print(newline)
torch=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
write("If there is no floor - Put one? (Slots 8,9) (yes or no) ")
print(newline)
Flo=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Break blocks that are in the way? (yes or no) ")
print(newline)
Brea=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Come back after I finish? (yes or no) ")
print(newline)
back=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
a=0
b=0
if Brea=='yes' then c=true else c=false end
if back=='yes' then d=true else d=false end
if Flo=='yes' then e=true else e=false end
if torch=='yes' then f=true else f=false end
turtle.up()
turtle.forward()
while a<Nor do
sleep(1)
if checkD© then break end
if b>=Pow then
b=0
if putP(e,f,c) then break end
else
if putT(e) then break end
b=b+1
end
if check© then break end
a=a+1
turtle.forward()
end
if d then
turtle.turnLeft()
turtle.turnLeft()
while (a+1)>0 do
turtle.forward()
a=a-1
end
turtle.turnLeft()
turtle.turnLeft()
turtle.down()
end
This program has 6 main Features
The first Feature is to do place tracks
-You choose how many tracks you want to put in overall
-You can use up to 256 tracks in one use
The second Feature is to place power tracks every x normal tracks
-You can choose to place power track after a variable number of normal tracks that you choose
-You can use up to 64 power tracks in one use
The Third Feature is to put down a block as a floor in case there isnt one
-This feature will let you be calm when you are worrying about gaps in the ground which will stop the track placer (works on gaps,lava,water,air)
- If there isnt any floor to put on it the tracks , you can simply put up to 192 blocks in the track placer and it will place those blocks in the gaps on the ground or on the air
The Fourth Feature is to Break down block
-This feature will break block that are in the way of your track placer or your tracks
-The track placer will drop any block that he picked up when breaking blockes (its a must sorry)
The Fifth Feature is to come back home safely :]
-If you enable this feature , the track placer will go back all the way to the point he started at
The Sixth Feature is to place redstone torch next to every power rail place (thx dsuzyv for the idea)
-After a power rail is placed, the track placer will place a torch on the left side of the power rail to keep it on all the time
-You can use the other features with it to ensure the torch is placed 100% (unless there is bedrock)
Slot 1 - Junk which is being picked up by the Fourth Feature
Slots 2,3,4,5 - Normal tracks
Slot 6 - Power tracks
Slot 7 - Redstone torches
Slots 8,9 - Floor blocks
This mod is very helpfull at building air tracks - with the Third feature which will make the bridge for you + place down the tracks.
The code:
Spoiler
function check©if turtle.detect() then
if c then
turtle.dig() if turtle.getItemCount(1)>0 then
turtle.select(1) turtle.drop() end return false
else return true
end
end
end
function checkD©
if turtle.detectDown() then
if c then
turtle.digDown() if turtle.getItemCount(1)>0 then
turtle.select(1) turtle.drop() end return false
else return true
end
end
end
function checkR()
if turtle.getItemCount(7)>0 then return 7 end
return 0
end
function checkT()
if turtle.getItemCount(2)>0 then return 2 end
if turtle.getItemCount(3)>0 then return 3 end
if turtle.getItemCount(4)>0 then return 4 end
if turtle.getItemCount(5)>0 then return 5 end
return 0
end
function checkF()
if turtle.getItemCount(8)>0 then return 8 end
if turtle.getItemCount(9)>0 then return 9 end
return 0
end
function checkP()
if turtle.getItemCount(6)>0 then return 6 end
return 0
end
function putT(k)
if checkT()==0 then return true end
turtle.select(checkT())
turtle.placeDown()
sleep(0.5)
if not turtle.compareDown(checkT()) then
if k then
if checkF()==0 then return true end
turtle.digDown()
turtle.down()
turtle.select(checkF())
turtle.placeDown()
turtle.up()
turtle.select(checkT())
turtle.placeDown()
return false
else return true
end
end
end
function putP(k,f,l)
if checkP()==0 then return true end
g=true
turtle.select(checkP())
turtle.placeDown()
sleep(0.5)
if not turtle.compareDown(checkP()) then
if k then
if checkF()==0 then return true end
turtle.digDown()
turtle.down()
turtle.select(checkF())
turtle.placeDown()
turtle.up()
turtle.select(checkP())
turtle.placeDown()
else g=false
end
end
if g then
if f then
turtle.turnLeft()
check(l)
turtle.forward()
checkD(l)
turtle.select(checkR())
turtle.placeDown()
sleep(0.5)
if not turtle.compareDown(checkR()) then
if k then
turtle.digDown()
turtle.down()
turtle.select(checkF())
turtle.placeDown()
turtle.up()
turtle.select(checkR())
turtle.placeDown()
end
end
turtle.turnRight()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
return false
else return true
end
end
end
term.clear()
term.setCursorPos(1,1)
write("How many tracks to put? - Sum (Slots 2,3,4,5) ")
print(newline)
Nor=read()
Nor=tonumber(Nor)
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Put Powered Rail every how many tracks? (Slots 6)")
print(newline)
Pow=read()
Pow=tonumber(Pow)
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Put a redstone torch next to every powered rail? (Slots 7) (yes or no)")
print(newline)
torch=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
write("If there is no floor - Put one? (Slots 8,9) (yes or no) ")
print(newline)
Flo=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Break blocks that are in the way? (yes or no) ")
print(newline)
Brea=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
write("Come back after I finish? (yes or no) ")
print(newline)
back=read()
print(newline)
term.clear()
term.setCursorPos(1,1)
a=0
b=0
if Brea=='yes' then c=true else c=false end
if back=='yes' then d=true else d=false end
if Flo=='yes' then e=true else e=false end
if torch=='yes' then f=true else f=false end
turtle.up()
turtle.forward()
while a<Nor do
sleep(1)
if checkD© then break end
if b>=Pow then
b=0
if putP(e,f,c) then break end
else
if putT(e) then break end
b=b+1
end
if check© then break end
a=a+1
turtle.forward()
end
if d then
turtle.turnLeft()
turtle.turnLeft()
while (a+1)>0 do
turtle.forward()
a=a-1
end
turtle.turnLeft()
turtle.turnLeft()
turtle.down()
end