This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Anon10W1z's profile picture

Minecraft Tnt Cannon Controller

Started by Anon10W1z, 31 July 2013 - 12:57 PM
Anon10W1z #1
Posted 31 July 2013 - 02:57 PM
As seen in this youtube video:

[media]http://www.youtube.com/watch?v=_YyB6sAdR7Q[/media]

You can make a TNT cannon out of dispensers and a few other materials. But what if you want to make that bad boy automatic? That's where this script comes into play.

You can type in the following to download this utility and use it as startup (if you don't save it as startup, hold Ctrl+T for one second to terminate the application).

pastebin get gz1UGX1w startup

This utility is meant to be used as the startup program on a regular computer attached to the front of the TNT cannon.

The code follows:
Spoiler

term.clear()
term.setCursorPos(1, 1)
print("Welcome to the Anon10W1z TNT cannon controller!")
sleep(2)
while true do
term.clear()
term.setCursorPos(1, 1)
print("Place as many TNT's as you want in each dispenser.")
print()
print("Type in the number of TNT's you want to launch. This number should be at maximum the number of TNT's in the dispenser with the least.")
print()
local amount = read()
for DoNotChangeThis=1,amount do
term.clear()
term.setCursorPos(1, 1)
print("Readying TNT...")
term.setCursorPos(1, 3)
print("TNT's that have been launched:")
print(DoNotChangeThis-1)
redstone.setOutput("back", true)
sleep(0.2)
redstone.setOutput("back", false)
sleep(4.25)
term.setCursorPos(1, 2)
print("TNT launched!")
term.setCursorPos(1, 4)
print(DoNotChangeThis)
term.setCursorPos(1, 1)
sleep(1)
term.clear()
end
end

Screenies:
Spoiler





You can place up to 576 TNT's in each dispenser.

For those who are wondering, in the first picture, yes, that is an obsidian slab, taken from the mod Slabcraft.
Geforce Fan #2
Posted 31 July 2013 - 09:24 PM
I think there's a default program that can do the same thing with redstone. Good idea though.
Anon10W1z #3
Posted 01 August 2013 - 02:03 PM
I think there's a default program that can do the same thing with redstone. Good idea though.
Well yes, but I just wanted to make it easy for the people like me who want to use their computers in different ways without having to manually type in lines of code.