Minecraft
ComputerCraft/Feed The Beast Code
BRANCH MINE / THAT CANINDIAN
ComputerCraft is a mod for Minecraft that allows you to program computers called turtles to do work for you. Feed The Beast is a mod pack for Minecraft that has the ComputerCraft mod in it.
This code is a code that I made myself that branch mines for you. All you have to do after you name it is type (name of program) (length of strip mine). You should also put torches in the 15th and 16th slot.
local tArgs = {...}
local todo = tonumber(tArgs[1])
local t = 1
local p = 2
local h = 8
function goBack()
turtle.turnRight()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
torch()
turtle.forward()
turtle.forward()
turtle.forward()
end
function torch()
turtle.select(16)
turtle.getItemCount(16)
if turtle.getItemCount(16) < 1 then
turtle.select(15)
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.turnLeft()
turtle.select(1)
else
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.turnLeft()
turtle.select(1)
end
end
function branchTime()
turtle.turnLeft()
for b = 1, 10 do
if turtle.detect() == true then
repeat
turtle.dig()
sleep(0.5)
until turtle.detect() == false
turtle.forward()
else
turtle.forward()
end
if turtle.detectUp() == true then
repeat
turtle.digUp()
sleep(0.50)
until turtle.detectUp() == false
end
end
goBack()
for f = 1, 10 do
if turtle.detect() == true then
repeat
turtle.dig()
sleep(0.5)
until turtle.detect() == false
turtle.forward()
else
turtle.forward()
end
if turtle.detectUp() == true then
repeat
turtle.digUp()
until turtle.detectUp() == false
end
end
goBack()
turtle.turnRight()
end
for i = 1, todo do
if turtle.detect() == true then
repeat
turtle.dig()
sleep(0.5)
until turtle.detect() == false
turtle.forward()
else
turtle.forward()
end
if turtle.detectUp() == true then
repeat
turtle.digUp()
sleep(0.5)
until turtle.detectUp() == false
end
t=t+1
if t == 3 then
branchTime()
t=0
end
end
turtle.turnRight()
turtle.turnRight()
for o = 1, todo do
turtle.forward()
end
turtle.turnRight()
turtle.turnRight()
No comments:
Post a Comment