Posted 19 November 2012 - 06:24 PM
I created a wirelessly controlled turtle nuker. It requires a wireless mining turtle, a computer, a wireless modem, and a lot of explosives (such as nukes, nova catalysts, nova cataclysms, tnt, etc..). It goes up 64 blocks and then starts placing a specified amount of explosives with 4 blocks in between each one and then goes back and lights them off one by one. The computer is only need for initial instructions. Here is the code.
This is the code for the computer.
This is the code for the turtle.
This is the code for the computer.
while true do
term.setCursorPos(1,1)
term.clear()
for _, side in pairs(redstone.getSides()) do
rednet.open(side)
end
print("What would you like to broadcast?")
word = read()
rednet.broadcast(word)
if word == "nuke" then
print("How many?")
amt = read()
rednet.broadcast(amt)
end
print("This was broadcasted!")
print(word)
id,message = rednet.receive()
print(message)
sleep(2)
end
This is the code for the turtle.
function nuke()
id,n = rednet.receive()
rednet.broadcast("May death rain upon them")
for y=1, 64 do
turtle.up()
end
nukeplace()
turtle.turnRight()
turtle.turnRight()
for i=2, n do
implode()
for x=1, 5 do
turtle.forward()
end
end
for z=1, 64 do
turtle.down()
end
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.turnRight()
turtle.turnRight()
end
function nukeplace()
for i=2, n do
turtle.placeDown()
for x=1, 5 do
turtle.forward()
end
end
turtle.placeDown()
end
function implode()
redstone.setOutput("bottom", true)
end
while true do
rednet.open("right")
print("Waiting for signal")
id,message = rednet.receive()
if message == "nuke" then
nuke()
end
end