Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MENU
- --VARIABLES
- local w,h = term.getSize()
- local select, program, distance = 1, 0, 7
- local running, chopping, usebonemeal = true, true, true
- local version = "ULTIMATE WOOD CHOPPER 0.8.6"
- local a, b, c, d, e, z = 6,7,8,9,10,h-2
- turtle.select(1)
- --DRAW
- local function printCentered(str, ypos)
- term.setCursorPos(w/2 - #str/2, ypos)
- term.write(str)
- end
- local function printRight(str, ypos)
- term.setCursorPos(w-#str, ypos)
- term.write(str)
- end
- --MENUS
- function clearScreen()
- term.clear()
- term.setCursorPos(1,1)
- term.clear()
- end
- function drawMenuMain()
- drawCopyright()
- drawHeader(version, 1)
- if select == 1 then
- printCentered("> Chop Programs <", a)
- else
- printCentered("Chop Programs", a)
- end
- if select == 2 then
- printCentered("> Build and Expand Programs <", b)
- else
- printCentered("Build and Expand Programs",b)
- end
- if select == 3 then
- printCentered("> Single Tree Chop Programs <", c)
- else
- printCentered("Single Tree Chop Programs",c)
- end
- if select == 4 then
- printCentered("> Help Programs <", d)
- else
- printCentered("Help Programs",d)
- end
- if select == 5 then
- printCentered("> Quit <", z)
- else
- printCentered("Quit", z)
- end
- end
- function drawMenuChopPrograms()
- drawHeader(version, 1)
- drawHeader("CHOP PROGRAMS", 3)
- if select == 1 then
- printCentered("> Standard Farm <", a)
- else
- printCentered("Standard Farm", a)
- end
- if select == 2 then
- printCentered("> Expanded Farm <", b)
- else
- printCentered("Expanded Farm", b)
- end
- if select == 3 then
- printCentered("> Standard Farm without bonemeal <", c)
- else
- printCentered("Standard Farm without bonemeal", c)
- end
- if select == 4 then
- printCentered("> Expanded Farm without bonemeal <", d)
- else
- printCentered("Expanded Farm without bonemeal", d)
- end
- if select == 5 then
- printCentered("> Back <", z)
- else
- printCentered("Back", z)
- end
- end
- function drawMenuBuildPrograms()
- drawHeader(version, 1)
- drawHeader("BUILD AND EXPAND PROGRAMS", 3)
- printCentered("Be sure the Turtle has all materials!",10)
- if select == 1 then
- printCentered("> Set up a farm <", a)
- else
- printCentered("Set up a farm", a)
- end
- if select == 2 then
- printCentered("> Expand your farm <", b)
- else
- printCentered("Expand your farm", b)
- end
- if select == 3 then
- printCentered("> Add more chests <", c)
- else
- printCentered("Add more chests", c)
- end
- if select == 4 then
- printCentered("> Back <", z)
- else
- printCentered("Back", z)
- end
- end
- function drawMenuHelpPrograms()
- drawHeader(version, 1)
- drawHeader("HELP PROGRAMS", 3)
- if select == 1 then
- printCentered("> Help Interface <", a)
- else
- printCentered("Help Interface", a)
- end
- if select == 2 then
- printCentered("> Position <", b)
- else
- printCentered("Position", b)
- end
- if select == 3 then
- printCentered("> Debug standard farm <", c)
- else
- printCentered("Debug standard farm", c)
- end
- if select == 4 then
- printCentered("> Debug expanded farm <", d)
- else
- printCentered("Debug expanded farm", d)
- end
- if select == 5 then
- printCentered("> Dig needed space <", e)
- else
- printCentered("Dig needed space", e)
- end
- if select == 6 then
- printCentered("> Back <", z)
- else
- printCentered("Back", z)
- end
- end
- function drawSingleTreeChopPrograms()
- drawHeader(version, 1)
- drawHeader("SINGLE TREE CHOP PROGRAMS", 3)
- if select == 1 then
- printCentered("> General 1x1 Tree <", a)
- else
- printCentered("General 1x1 Tree", a)
- end
- if select == 2 then
- printCentered("> General 2x2 Tree <", b)
- else
- printCentered("General 2x2 Tree", b)
- end
- if select == 3 then
- printCentered("> Back <", z)
- else
- printCentered("Back", z)
- end
- end
- --HEADER
- function drawHeader(title, line)
- printCentered(title, line)
- printCentered(string.rep("-", w), line+1)
- end
- function drawCopyright()
- printRight("by UNOBTANIUM", h)
- end
- --MENUSTATE
- local menustate = "main"
- local mopt = {
- ["main"] = {
- options = {"chopprograms", "buildprograms", "singletreechopprograms", "helpprograms", "quit"},
- draw = drawMenuMain
- },
- ["chopprograms"] = {
- options = {"standard", "expanded", "standardnobonemeal", "expandednobonemeal", "main"},
- draw = drawMenuChopPrograms
- },
- ["buildprograms"] = {
- options = {"build","expand", "expandchests", "main"},
- draw = drawMenuBuildPrograms
- },
- ["singletreechopprograms"] = {
- options = {"onebyone", "twobytwo", "main"},
- draw = drawSingleTreeChopPrograms
- },
- ["helpprograms"] = {
- options = {"help", "position", "debugstandard", "debugexpanded", "digSpace","main"},
- draw = drawMenuHelpPrograms
- }
- }
- --RUN MENU
- function runMenu()
- while true do
- program = 0
- clearScreen()
- mopt[menustate].draw()
- local id, key = os.pullEvent("key")
- if key == 200 then
- select = select-1
- end
- if key == 208 then
- select = select+1
- end
- if select == 0 then
- select = #mopt[menustate].options
- end
- if select > #mopt[menustate].options then
- select = 1
- end
- if key == 28 then
- if mopt[menustate].options[select] == "quit" then
- program = 0
- break
- end
- if mopt[menustate].options[select] == "standard" then
- program = 1
- usebonemeal = true
- break
- end
- if mopt[menustate].options[select] == "expanded" then
- program = 2
- usebonemeal = true
- break
- end
- if mopt[menustate].options[select] == "debugstandard" then
- program = 3
- break
- end
- if mopt[menustate].options[select] == "debugexpanded" then
- program = 4
- break
- end
- if mopt[menustate].options[select] == "build" then
- program = 5
- break
- end
- if mopt[menustate].options[select] == "expand" then
- program = 6
- break
- end
- if mopt[menustate].options[select] == "help" then
- program = 7
- break
- end
- if mopt[menustate].options[select] == "position" then
- program = 8
- break
- end
- if mopt[menustate].options[select] == "expandchests" then
- program = 9
- break
- end
- if mopt[menustate].options[select] == "onebyone" then
- program = 10
- break
- end
- if mopt[menustate].options[select] == "twobytwo" then
- program = 11
- break
- end
- if mopt[menustate].options[select] == "standardnobonemeal" then
- program = 1
- usebonemeal = false
- break
- end
- if mopt[menustate].options[select] == "expandednobonemeal" then
- program = 2
- usebonemeal = false
- break
- end
- if mopt[menustate].options[select] == "digSpace" then
- program = 12
- break
- end
- menustate = mopt[menustate].options[select]
- select = 1
- end
- end
- end
- --FIR WOOD CHOPPER PROGRAMS
- --VARIABLES
- local dirtexpand, pipeexpand, obsidianpipeexpand, blockslot, coal, chest, furnace, dirt, pipe, ironpipe, goldpipe, obsidianpipe, woodenpipe, engine, lever, bonemeal, stone1, stone2, stone3, sapling, fuel = 2,3,4,5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,3
- --MOVE FUNCTIONS
- function forward()
- while not turtle.forward() do end
- end
- function back()
- while not turtle.back() do end
- end
- function up()
- while not turtle.up() do end
- end
- function down()
- while not turtle.down() do end
- end
- --RUN PROGRAM
- function checkSelectedProgram()
- clearScreen()
- if program == 0 then
- running = false
- end
- if program == 1 then
- FWCchop()
- end
- if program == 2 then
- FWCchop2()
- end
- if program == 3 then
- FWCdebugstandard()
- end
- if program == 4 then
- FWCdebugexpanded()
- end
- if program == 5 then
- FWCbuild()
- end
- if program == 6 then
- FWCexpand()
- end
- if program == 7 then
- FWChelp()
- end
- if program == 8 then
- FWCposition()
- end
- if program == 9 then
- FWCexpandchests()
- end
- if program == 10 then
- FWConebyone()
- end
- if program == 11 then
- FWCtwobytwo()
- end
- if program == 12 then
- FWCdigSpace()
- end
- end
- --MAIN CHOP PROGRAM FUNCTIONS
- local function refreshItemStack(i)
- turtle.select(4)
- turtle.suck()
- turtle.select(i)
- turtle.drop()
- turtle.select(4)
- turtle.drop()
- turtle.select(i)
- turtle.suck()
- if turtle.getItemCount(4) > 0 then
- print("!!!!!!!!!")
- print("The coal or sapling chest is full! Please take out some stacks, otherwise you lose items! The turtle will drop them!")
- print("!!!!!!!!!")
- turtle.select(4)
- turtle.dropDown()
- end
- end
- local function moveForward(j)
- for i = 1,j do
- forward()
- end
- end
- local function checkFuel()
- while turtle.getFuelLevel() < 96 and turtle.getItemCount(coal) > 0 do
- turtle.select(1)
- turtle.refuel(1)
- print("Refueled!")
- end
- end
- local function getCoal()
- local taking = true
- local delay = os.startTimer(2)
- print("Taking coal out of the chest!")
- print("If nothing happens the chest has too less materials!")
- print("Press Enter to terminate process!")
- while taking == true do
- event = { os.pullEvent() }
- if event[1] == "timer" and event[2] == delay then
- refreshItemStack(1)
- if turtle.getItemCount(1) < 8 then
- delay = os.startTimer(2)
- else
- taking = false
- end
- elseif event[1] == "key" and event[2] == 28 then
- print("Terminated by User!")
- clearScreen()
- os.shutdown()
- end
- end
- print("Succesful!")
- end
- local function getSaplings()
- local taking = true
- local delay = os.startTimer(2)
- print("Taking saplings out of the chest!")
- print("If nothing happens the chest has too less materials!")
- print("Press Enter to terminate process!")
- while taking == true do
- event = { os.pullEvent() }
- if event[1] == "timer" and event[2] == delay then
- refreshItemStack(2)
- if turtle.getItemCount(2) < 16 then
- delay = os.startTimer(2)
- else
- taking = false
- end
- elseif event[1] == "key" and event[2] == 28 then
- print("Terminated by User!")
- turtle.turnRight()
- forward()
- turtle.turnRight()
- clearScreen()
- os.shutdown()
- end
- end
- print("Succesful!")
- end
- local function getBonemeal()
- local taking = true
- local delay = os.startTimer(2)
- print("Taking bonemeal out of the chest!")
- print("If nothing happens the chest has too less materials!")
- print("Press Enter to terminate process!")
- while taking == true do
- event = { os.pullEvent() }
- if usebonemeal == true then
- if event[1] == "timer" and event[2] == delay then
- turtle.select(4)
- turtle.suckUp()
- turtle.select(3)
- turtle.dropUp()
- turtle.select(4)
- turtle.dropUp()
- turtle.select(3)
- turtle.suckUp()
- if turtle.getItemCount(4) > 0 then
- print("!!!!!!!!!")
- print("The bonemeal chest is full! Please take out some stacks, otherwise you lose items! The turtle will drop them!")
- print("!!!!!!!!!")
- turtle.select(4)
- turtle.dropDown()
- end
- if turtle.getItemCount(3) < 8 then
- delay = os.startTimer(2)
- else
- taking = false
- end
- elseif event[1] == "key" and event[2] == 28 then
- print("Terminated by User!")
- turtle.turnRight()
- forward()
- turtle.turnRight()
- clearScreen()
- os.shutdown()
- end
- else
- turtle.select(3)
- turtle.dropUp()
- taking = false
- end
- end
- print("Successful!")
- end
- local function storeWood()
- print("Storing wood in the chests!")
- chestfull = true
- while chestfull == true do
- if usebonemeal == true then
- for i=4,16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- chestfull = turtle.drop()
- end
- end
- else
- for i=3,16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- chestfull = turtle.drop()
- end
- end
- end
- chestfull = not chestfull
- if chestfull == true and turtle.detectUp() == true then
- print("Wood! Wood everywhere!!!")
- print("Your wood chests are full!")
- print("Try to add more vertical chests or take wood out of them.")
- print("")
- chopping = false
- while turtle.detectDown() == false do
- down()
- end
- turtle.turnRight()
- end
- if chestfull == true and turtle.detectUp() == false then
- up()
- print("This Chest is full!")
- end
- end
- while turtle.detectDown() == false do
- down()
- end
- print("Successful stored the wood!")
- print("")
- end
- local function plantTree()
- print("Planting saplings!")
- moveForward(2)
- turtle.turnRight()
- turtle.select(2)
- turtle.place()
- turtle.turnLeft()
- back()
- turtle.place()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- back()
- turtle.place()
- turtle.select(2)
- if usebonemeal == true then
- while turtle.compare() == true and turtle.getItemCount(3) > 1 do
- print("Fertilizing the tree with bonemeal!")
- turtle.select(3)
- turtle.place()
- turtle.select(2)
- end
- else
- print("Waiting for the tree to grow!")
- print("Get some coffee this may take a while ;D")
- while turtle.compare() == true do
- os.sleep(5)
- end
- end
- print("Successful planted new tree!")
- print("")
- end
- local function getMaterials()
- print("Need more materials to continue!")
- turtle.turnRight()
- turtle.turnRight()
- moveForward(distance)
- turtle.select(4)
- turtle.dropDown()
- storeWood()
- turtle.turnRight()
- if redstone.getInput("back") == false then
- print("Shutdown by redstone signal!")
- chopping = false
- else
- getCoal()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- getSaplings()
- getBonemeal()
- turtle.turnLeft()
- moveForward(distance-1)
- end
- end
- local function cutWood()
- print("Chopping down the tree!")
- local height = 0
- if usebonemeal then
- turtle.select(4)
- else
- turtle.select(3)
- end
- turtle.dig()
- forward()
- turtle.dig()
- while turtle.detectUp() do
- turtle.digUp()
- up()
- turtle.dig()
- height = height + 1
- end
- checkFuel()
- print("Reached the top of the tree!")
- turtle.turnRight()
- turtle.dig()
- forward()
- turtle.turnLeft()
- turtle.dig()
- while height > 0 do
- turtle.digDown()
- down()
- turtle.dig()
- height = height - 1
- end
- print("Successful chopped the tree!")
- print("")
- back()
- turtle.turnLeft()
- forward()
- turtle.turnRight()
- end
- function chop()
- if redstone.getInput("back") == true then
- print("Starting the Fir Wood Chooper program!")
- getCoal()
- checkFuel()
- if turtle.getItemCount(4) > 0 or turtle.getItemCount(16) > 0 then
- turtle.turnLeft()
- storeWood()
- turtle.turnRight()
- end
- turtle.turnRight()
- forward()
- turtle.turnRight()
- if turtle.getItemCount(2) < 16 then
- getSaplings()
- end
- if turtle.getItemCount(3) < 4 and usebonemeal == true then
- getBonemeal()
- end
- if turtle.getItemCount(3) > 0 and usebonemeal == false then
- turtle.select(3)
- turtle.dropUp()
- end
- turtle.turnRight()
- forward()
- turtle.turnRight()
- turtle.turnRight()
- moveForward(distance)
- while chopping == true do
- checkFuel()
- local needMaterials = false
- if turtle.getItemCount(1) < 5 or turtle.getItemCount(2) < 2 then
- needMaterials = true
- end
- if turtle.getItemCount(3) < 2 and usebonemeal == true then
- needMaterials = true
- end
- if usebonemeal and turtle.getItemCount(14) > 0 then
- needMaterials = true
- end
- if usebonemeal == false and turtle.getItemCount(7) > 0 then
- needMaterials = true
- end
- if needMaterials == true then
- getMaterials()
- end
- if chopping == true then
- plantTree()
- checkFuel()
- cutWood()
- end
- end
- else
- print("No redstone signal, no wood!")
- print("Be sure the Turtle is facing the coal chest and stays above the furnace!")
- print("The redstone signal has to be in the back of the Turtle!")
- end
- print("Press Enter to get back into the menu!")
- read()
- chopping = true
- end
- --FWCchop 11111111111111111111111
- function FWCchop()
- distance = 7
- chop()
- end
- --FWCchop2 2222222222222222222222
- function FWCchop2()
- distance = 9
- chop()
- end
- --MAIN DEBUG FUNCTIONS
- local function debugTree()
- local height = 0
- turtle.select(4)
- turtle.dig()
- forward()
- turtle.dig()
- while height < 45 do
- turtle.digUp()
- turtle.up()
- turtle.dig()
- height = height + 1
- end
- checkFuel()
- turtle.turnRight()
- turtle.dig()
- forward()
- turtle.turnLeft()
- turtle.dig()
- while height > 0 do
- turtle.digDown()
- down()
- turtle.dig()
- height = height - 1
- end
- back()
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- end
- --FWCdebugstandard 33333333333333333333333333
- function FWCdebugstandard()
- checkFuel()
- turtle.turnRight()
- moveForward(7)
- debugTree()
- moveForward(7)
- turtle.turnRight()
- print("Debug for standard farm finished!")
- print("Press Enter to get back into the menu!")
- read()
- end
- --FWCdebugexpand 44444444444444444444444444444
- function FWCdebugexpanded()
- checkFuel()
- turtle.turnRight()
- moveForward(9)
- debugTree()
- moveForward(9)
- turtle.turnRight()
- print("Debug for expanded farm finished!")
- print("Press Enter to get back into the menu!")
- read()
- end
- --MAIN BUILD FUNCTIONS
- local function dbp(j)
- for i=1,j do
- turtle.placeDown()
- turtle.back()
- turtle.place()
- end
- end
- local function fd(j)
- for i=1,j do
- turtle.forward()
- turtle.placeDown()
- end
- end
- local function bp(j)
- for i=1,j do
- turtle.back()
- turtle.place()
- end
- end
- local function lb()
- turtle.turnLeft()
- turtle.back()
- end
- --FWCbuild 55555555555555555555555555555555555
- function FWCbuild()
- if turtle.detectDown() then
- print("There is a block underneath the turtle.")
- print("Be sure you have free space under the turtle.")
- print("Press Enter to get back to the menu.")
- read()
- return false
- end
- turtle.select(coal)
- turtle.refuel(fuel)
- turtle.select(stone1)
- moveForward(2)
- turtle.turnRight()
- forward()
- turtle.placeUp()
- dbp(1)
- turtle.placeUp()
- turtle.placeDown()
- back()
- turtle.placeUp()
- dbp(1)
- down()
- down()
- turtle.turnLeft()
- turtle.turnLeft()
- forward()
- dbp(4)
- turtle.select(stone1)
- bp(1)
- dbp(3)
- lb()
- dbp(2)
- bp(8)
- lb()
- bp(8)
- lb()
- bp(8)
- dbp(1)
- turtle.placeDown()
- turtle.turnLeft()
- bp(1)
- turtle.turnRight()
- turtle.turnRight()
- down()
- turtle.placeDown()
- fd(7)
- turtle.turnLeft()
- fd(1)
- turtle.turnLeft()
- turtle.select(stone3)
- fd(7)
- turtle.select(stone2)
- turtle.turnRight()
- up()
- for i = 1,4 do
- fd(8)
- turtle.turnRight()
- fd(1)
- turtle.turnRight()
- fd(7)
- if i < 4 then
- turtle.turnLeft()
- fd(1)
- turtle.turnLeft()
- end
- end
- turtle.select(stone3)
- up()
- up()
- turtle.turnRight()
- moveForward(3)
- turtle.turnRight()
- moveForward(2)
- turtle.select(dirt)
- fd(2)
- turtle.turnLeft()
- fd(1)
- turtle.turnLeft()
- fd(1)
- moveForward(7)
- turtle.select(stone1)
- turtle.placeDown()
- turtle.turnLeft()
- turtle.select(chest)
- turtle.place()
- turtle.select(sapling)
- turtle.drop()
- turtle.turnRight()
- turtle.select(chest)
- turtle.placeUp()
- turtle.select(bonemeal)
- turtle.dropUp()
- forward()
- turtle.select(chest)
- turtle.place()
- up()
- turtle.place()
- up()
- turtle.place()
- turtle.select(stone3)
- turtle.placeUp()
- down()
- down()
- down()
- turtle.turnRight()
- turtle.select(woodenpipe)
- turtle.place()
- turtle.turnLeft()
- down()
- turtle.select(furnace)
- turtle.placeUp()
- turtle.select(coal)
- turtle.dropUp(1)
- turtle.select(ironpipe)
- turtle.place()
- lb()
- turtle.select(pipe)
- turtle.place()
- turtle.turnLeft()
- back()
- turtle.select(goldpipe)
- turtle.place()
- up()
- up()
- turtle.select(chest)
- turtle.place()
- turtle.select(coal)
- turtle.drop(1)
- turtle.select(engine)
- turtle.placeDown()
- back()
- turtle.select(stone3)
- turtle.placeDown()
- lb()
- turtle.select(lever)
- turtle.place()
- back()
- turtle.turnRight()
- moveForward(2)
- down()
- turtle.select(pipe)
- turtle.place()
- down()
- turtle.place()
- down()
- moveForward(2)
- turtle.select(obsidianpipe)
- turtle.place()
- back()
- turtle.select(pipe)
- turtle.place()
- back()
- turtle.place()
- turtle.turnLeft()
- up()
- up()
- up()
- turtle.select(stone3)
- turtle.placeDown()
- forward()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(lever)
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- print("Finally set up farm! Enjoy!")
- print("Flip the lever for the redstone engine.")
- print("")
- print("Press Enter to get back into the menu!")
- read()
- end
- --MAIN EXPAND FUNCTIONS
- local function checkBlocks()
- if turtle.getItemCount(blockslot) == 0 and blockslot < 10 then
- blockslot = blockslot + 1
- turtle.select(blockslot)
- end
- end
- local function checkFuelexpand()
- print("The refueling needs around 8 coal!")
- while turtle.getFuelLevel() < 600 do
- print("Refueling!")
- turtle.select(coal)
- turtle.refuel(1)
- end
- end
- local function fde(j)
- for i=1,j do
- checkBlocks()
- forward()
- turtle.placeDown()
- checkBlocks()
- end
- end
- local function df(j)
- for i=1,j do
- turtle.dig()
- forward()
- end
- end
- local function dfd(j)
- for i=1,j do
- turtle.dig()
- forward()
- turtle.digDown()
- end
- end
- local function destroy()
- turtle.turnRight()
- moveForward(3)
- down()
- down()
- down()
- turtle.turnRight()
- turtle.select(obsidianpipeexpand)
- turtle.dig()
- forward()
- turtle.turnRight()
- turtle.select(pipeexpand)
- turtle.dig()
- turtle.select(blockslot)
- forward()
- turtle.turnLeft()
- df(4)
- turtle.turnLeft()
- up()
- dfd(2)
- df(9)
- turtle.turnLeft()
- df(9)
- turtle.turnLeft()
- df(8)
- dfd(2)
- down()
- down()
- turtle.turnLeft()
- df(8)
- turtle.turnLeft()
- df(1)
- turtle.turnLeft()
- df(7)
- turtle.turnRight()
- turtle.up()
- for i=1,4 do
- df(8)
- turtle.turnRight()
- df(1)
- turtle.turnRight()
- df(8)
- if i < 4 then
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- end
- end
- end
- local function layout()
- turtle.select(blockslot)
- forward()
- up()
- up()
- up()
- forward()
- turtle.turnLeft()
- back()
- back()
- turtle.placeDown()
- fde(7)
- for i=1,3 do
- turtle.turnLeft()
- fde(7)
- forward()
- down()
- turtle.placeDown()
- fde(1)
- up()
- back()
- turtle.placeDown()
- fde(9)
- end
- turtle.turnLeft()
- fde(6)
- turtle.turnLeft()
- forward()
- turtle.turnRight()
- moveForward(10)
- turtle.turnLeft()
- moveForward(8)
- end
- local function corners()
- turtle.down()
- for i=1,4 do
- fde(7)
- turtle.turnLeft()
- fde(6)
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- fde(5)
- turtle.turnRight()
- fde(4)
- turtle.turnRight()
- forward()
- turtle.turnRight()
- fde(3)
- turtle.turnLeft()
- fde(2)
- turtle.back()
- turtle.turnLeft()
- fde(1)
- turtle.turnRight()
- turtle.turnRight()
- moveForward(3)
- turtle.turnLeft()
- moveForward(5)
- end
- end
- local function lines(j)
- fde(j)
- back()
- turtle.turnLeft()
- fde(1)
- turtle.turnLeft()
- fde(j-2)
- if j > 4 then
- back()
- turtle.turnRight()
- fde(1)
- turtle.turnRight()
- lines(j-4)
- end
- end
- local function plateau()
- down()
- back()
- turtle.placeDown()
- turtle.turnLeft()
- lines(15)
- turtle.turnLeft()
- moveForward(8)
- turtle.turnLeft()
- moveForward(8)
- turtle.turnRight()
- turtle.turnRight()
- turtle.placeDown()
- lines(15)
- end
- local function pipeAndDirt()
- back()
- turtle.turnLeft()
- moveForward(9)
- turtle.select(dirtexpand)
- turtle.digUp()
- forward()
- turtle.digUp()
- turtle.turnRight()
- forward()
- turtle.digUp()
- turtle.turnRight()
- forward()
- turtle.digUp()
- forward()
- turtle.placeUp()
- forward()
- turtle.placeUp()
- turtle.turnRight()
- forward()
- turtle.placeUp()
- turtle.turnRight()
- forward()
- turtle.placeUp()
- turtle.digDown()
- down()
- turtle.digDown()
- down()
- df(9)
- turtle.select(pipeexpand)
- for i=1,9 do
- back()
- turtle.place()
- end
- up()
- turtle.placeDown()
- up()
- turtle.placeDown()
- back()
- turtle.select(obsidianpipeexpand)
- turtle.place()
- turtle.turnRight()
- forward()
- turtle.turnLeft()
- moveForward(8)
- up()
- up()
- moveForward(3)
- turtle.turnRight()
- end
- --FWCexpand 66666666666666666666666666
- function FWCexpand()
- print("Expanding farm!")
- if turtle.getItemCount(1) < 9 then
- getCoal()
- end
- checkFuelexpand()
- blockslot = 5
- destroy()
- layout()
- corners()
- plateau()
- pipeAndDirt()
- print("Finished!")
- print("Press Enter to get back into the menu!")
- read()
- end
- --FWChelp 77777777777777777777777777777777777777777
- function FWChelp()
- print("Welcome to the UWC Help Interface!")
- print("If you have any question, suggestions, bugs or feedback, let me know: Type")
- print("computercraft forum ultimate wood chopper")
- print("in Google and write a post or PM at me ;D")
- read()
- end
- --FWCposition 999999999999999999999999999999999999
- function FWCposition()
- turtle.select(coal)
- turtle.refuel(1)
- up()
- up()
- up()
- up()
- turtle.turnRight()
- forward()
- forward()
- forward()
- forward()
- turtle.turnLeft()
- forward()
- forward()
- print(" ")
- print("Turtle in Base. Ready to set up farm.")
- print("Be sure the turtle has all the materials it needs.")
- print("Press Enter to get back into the menu.")
- read()
- end
- --FWCexpandchests
- function FWCexpandchests()
- print("Adding more chests!")
- checkFuel()
- local amount = turtle.getItemCount(2)
- turtle.turnLeft()
- while not turtle.detectUp() do
- turtle.up()
- end
- turtle.select(3)
- turtle.digUp()
- turtle.select(2)
- while amount > 0 do
- up()
- turtle.place()
- amount = amount-1
- end
- turtle.select(3)
- turtle.placeUp()
- while turtle.down() do end
- turtle.turnRight()
- print("Finsihed!")
- print("Press Enter to get back into the menu.")
- read()
- end
- --FWCtwobytwo
- function FWCtwobytwo()
- print("Chopping down 2x2 tree.")
- checkFuel()
- cutWood()
- print("Press Enter to get back into the menu.")
- read()
- end
- --FWConebyone
- function FWConebyone()
- print("Chopping down 1x1 tree.")
- checkFuel()
- turtle.select(2)
- turtle.dig()
- forward()
- while turtle.compareUp() do
- turtle.digUp()
- up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- print("Finsihed!")
- print("Press Enter to get back into the menu.")
- read()
- end
- --FWCdigSpace
- function FWCdigSpace()
- os.sleep(2)
- turtle.select(1)
- turtle.refuel(5)
- back()
- back()
- turtle.turnLeft()
- forward()
- turtle.turnRight()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- for i=1,3 do
- for j=1,4 do
- turtle.forward()
- turtle.digUp()
- turtle.dig()
- end
- if i<3 then
- for j=1,4 do
- turtle.back()
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- turtle.digDown()
- turtle.back()
- turtle.digDown()
- turtle.forward()
- turtle.up()
- turtle.up()
- turtle.turnLeft()
- moveForward(5)
- turtle.turnRight()
- turtle.forward()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- for i=1,5 do
- for j=1,11 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turtle.digUp()
- turtle.digDown()
- for j=1,11 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- end
- if i < 5 then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.digDown()
- turtle.digUp()
- end
- end
- turtle.back()
- turtle.turnRight()
- turtle.forward()
- turtle.down()
- turtle.digDown()
- turtle.down()
- for i=1,8 do
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.up()
- turtle.up()
- turtle.up()
- turtle.up()
- moveForward(3)
- turtle.turnLeft()
- moveForward(4)
- turtle.turnLeft()
- print("Finished!")
- print("Press Enter to get back into the menu!")
- read()
- end
- --MAIN PROGRAM
- while running == true do
- runMenu()
- checkSelectedProgram()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement