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

UGSD! - New Program

Started by Falco, 21 December 2012 - 12:30 AM
Falco #1
Posted 21 December 2012 - 01:30 AM
UGSD stands for "Underground Shaft Digger".

A brief discription:

UGSD, is a powerful program which will help you achive the best
underground tunnels with little work, this is great for joining one base to another without
having to leave either buliding, or connecting your underground lair to an outpost, or simply
just creating a connection of underground tunnels for transporting goods or people.

Features:
  1. Two preloaded tunnel sizes (2x2, 2x3, 3x3).
  2. Custom length of tunnel, in meters.

Planned features:
  • Torch placement system.
Screenshots:
SpoilerMain Menu:

Download!
Spoiler– Writen by Falco.
– My CC Profile: http://www.computerc...ser/7198-falco/
– Offical Download: http://www.computerc...sd-new-program/


version = "0.2"

function clear() – This function acts as a shell.run("clear"), without having to type your program header againg and again.
shell.run("clear")
print(" UGSD! You are running version " .. version)
print(" ————————————–")
print("")
end

function tunnel2x2() – Digs out a 2x2 tunnel.
clear() – This calls our "clear" function.
write("Please choose the length of the tunnel, in meters> ")
length = read() – this listens to our input.
for i = 1, tonumber(length) do
turtle.refuel()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.up()
turtle.turnLeft()
turtle.dig()
turtle.down()
turtle.dig()
turtle.turnRight()
end
startup() – This calls our start menu.
end

function tunnel2x3()
clear()
write("Please choose the length of the tunnel, in meters> ")
length = read()
for i = 1, tonumber(length) do
turtle.refuel()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.turnLeft()
turtle.dig()
turtle.up()
turtle.dig()
turtle.turnRight()
turtle.turnRight()
turtle.dig()
turtle.down()
turtle.dig()
turtle.turnLeft()
end
startup()
end

function tunnel3x3()
clear()
print("Please choose the length of the tunnel, in meters> ")
length = read()
for i = 1, tonumber(length) do
turtle.refuel()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.turnLeft()
turtle.dig()
turtle.up()
turtle.dig()
turtle.digUp()
turtle.up()
turtle.dig()
turtle.turnRight()
turtle.turnRight()
turtle.dig()
turtle.down()
turtle.dig()
turtle.down()
turtle.dig()
turtle.turnLeft()
end
end

– Main Menu –
function startup()
clear()
print("Please choose a tunnel size from the menu: ")
print("")
print("[1] 2x2, Must be placed on the left!")
print("[2] 2x3, Must be placed in the center!")
print("[3] 3x3, Must be placed in the center!")
print("[4] Exit")
startupc = io.read()
if startupc == "1" then
tunnel2x2()
elseif startupc == "2" then
tunnel2x3()
elseif startupc == "3" then
tunnel3x3()
elseif startupc == "4" then
print("")
shell.run("reboot", 2)
end
end

startup() – This is line makes the program start and show the main menu.

Change Log! READ IT!:
SpoilerVersion 0.2
SpoilerChanges:
Spoiler
  1. Readded 3x3 tunnel.

Version 0.1:
SpoilerFeatures:
Spoiler
  1. Two preloaded tunnel sizes (2x2, 2x3).
  2. Custom length of tunnel, in meters.

Download!
Spoiler
-- Writen by Falco.
-- My CC Profile: http://www.computercraft.info/forums2/index.php?/user/7198-falco/

-- function tunnel3x3 is currently disabled due to a bug.

version = " 0.1"

function clear()
	shell.run("clear")
	print("UGSD (Underground Shaft Digger)." .. version)
	print("--------------------------------------")
	print("")
end

function tunnel2x2()
	clear()
	write("Please choose the length of the tunnel, in meters> ")
length = read()
for i = 1, tonumber(length) do
   turtle.refuel()
   turtle.dig()
   turtle.forward()
   turtle.digUp()
   turtle.up()
   turtle.turnLeft()
   turtle.dig()
   turtle.down()
   turtle.dig()
   turtle.turnRight()
end
	startup()
end

function tunnel2x3()
	clear()
	write("Please choose the length of the tunnel, in meters> ")
length = read()
for i = 1, tonumber(length) do
   turtle.refuel()
   turtle.dig()
   turtle.forward()
   turtle.digUp()
   turtle.turnLeft()
   turtle.dig()
   turtle.up()
   turtle.dig()
   turtle.turnRight()
   turtle.turnRight()
   turtle.dig()
   turtle.down()
   turtle.dig()
   turtle.turnLeft()
end
	startup()
end

--function tunnel3x3()
--	clear()
--	print("Please choose the length of the tunnel, in meters> ")
--	length = read()
--for i = 1, tonumber(length) do
--   turtle.refuel()
--   turtle.digDown()
--   turtle.down()
--   turtle.digDown()
--  turtle.down()
--   turtle.digDown()
--   turtle.down()
--   turtle.dig()
--   turtle.forward()
--   turtle.digUp()
--   turtle.turnLeft()
--  turtle.dig()
--   turtle.up()
--   turtle.dig()
--   turtle.digUp()
--   turtle.up()
--   turtle.dig()
--   turtle.turnRight()
--   turtle.turnRight()
--   turtle.dig()
--   turtle.down()
--   turtle.dig()
--   turtle.down()
--   turtle.dig()
--   turtle.turnLeft()
--end
--end

function startup()
	clear()
	print("Please choose a tunnel size from the menu: ")
	print("")
	print("[1] 2x2, Must be placed on the left!")
	print("[2] 2x3, Must be placed in the center!")
--	print("[3] 3x3, Must be placed in the center!")
	print("[3] Exit")
	startupc = io.read()
	if startupc == "1" then
		tunnel2x2()
	elseif startupc == "2" then
		tunnel2x3()
--	elseif startupc == "3" then
		tunnel3x3()
	elseif startupc == "3" then
	print("")
	shell.run("reboot", 2)
	end
end
startup()

Please Note: This is the first program I've EVER made for release so be nice guys. :)/>
theoriginalbit #2
Posted 21 December 2012 - 01:38 AM
Well done. Its good to see that you have finally got it working :)/>
Falco #3
Posted 21 December 2012 - 01:44 AM
Well done. Its good to see that you have finally got it working :)/>

Thank you friend… :ph34r:/>
theoriginalbit #4
Posted 21 December 2012 - 01:52 AM
Well done. Its good to see that you have finally got it working :)/>

Thank you friend… :ph34r:/>

ninja, why ninja? :P/>
Falco #5
Posted 21 December 2012 - 01:54 AM
Well done. Its good to see that you have finally got it working :)/>

Thank you friend… :ph34r:/>

ninja, why ninja? :P/>

I DONT KNOW MAN JUST LEAVE ME ALONE YOUR A BULLY!!! AND MY DADS GONNA KICK YOUR ASS BUDDY :lol:/> :ph34r:/>
theoriginalbit #6
Posted 21 December 2012 - 01:55 AM
snip

I DONT KNOW MAN JUST LEAVE ME ALONE YOUR A BULLY!!! AND MY DADS GONNA KICK YOUR ASS BUDDY :lol:/> :ph34r:/>

well that escalated quickly.
Falco #7
Posted 21 December 2012 - 09:54 AM
Lol this has gone way off topic. ONTOPIC PEOPLE
theoriginalbit #8
Posted 21 December 2012 - 12:53 PM
Why are you telling me as well as yourself, as though it were me and someone else, to get back onto topic? o.O
Falco #9
Posted 21 December 2012 - 05:11 PM
Why are you telling me as well as yourself, as though it were me and someone else, to get back onto topic? o.O

I dont know lool… im a n000000000b!! lool

BACK ON TOPIC! :ph34r:/>
Nortrix0 #10
Posted 21 December 2012 - 05:32 PM
whats the problem with the 3x3 cuz all i could see from the code was a turtle.dig down and turtle.dig didnt have enough spaces
Falco #11
Posted 21 December 2012 - 06:12 PM
whats the problem with the 3x3 cuz all i could see from the code was a turtle.dig down and turtle.dig didnt have enough spaces

Enough spaces….?

EDIT* rewriting it now! also going to add comments. :)/>
Falco #12
Posted 21 December 2012 - 06:58 PM
UPDATED VERSION AVAILABLE! Version 0.2