Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Replicate by Booyaah
- --TO DO LIST:
- --fix veinmine
- --dont break saplings when looking for sugarcane
- --Stop looking for sugarcane once it's found
- --The last treefarm didn't make sure there was enough fuel
- --!make a rep.craft (common patterns + custom patterns option)
- --then make a more developed treefarm area (and a timer for how long they have been growing) and place a torch at 0,0,0 (crafting a torch could use a better crafting API)
- --fix the multiple turns during treeSearch (make pathing API?)
- --add: making decisions based on how many items we have (like the initial dirt gather and treeSearching)
- --DEBUG CONTROLS:
- debugPause=false
- skiptreeSearch=false
- --EMERGENCY WOOD HARVESTING
- --Because: Needs fuel badly
- rep.firstTree()
- --SETTING A CHEST LOCATION
- --Because: doesn't have any storage locations
- t.goto(0,0,-1,0,"dig")
- rep.saveLocation("chest1","down")
- --GATHERING COBBLE
- --Because: idk?
- rep.firstCobble()
- rep.gotoLocation("chest1")
- --TREE SEARCHING
- --Because: still low on fuel
- t.goto(0,0,-4,0,"dig")
- rep.treeSearch()
- t.goto(0,0,0,0,"dig")
- rep.gotoLocation("chest1")
- --CRAFTING CHEST (INCLUDES CRAFTING PLANKS AND PLACING CHEST)
- --Because: no chest exists in first chest position
- t.displayAction("Crafting")
- t.dropAllExcept("down","log")
- t.transferItem("log",_G.woodSlot)
- t.select(_G.woodSlot)
- craftQuantity=turtle.getItemCount()-1
- t.suck("down","all")
- craftResult=rep.craftItem("planks",craftQuantity)
- craftResult=rep.craftItem("chest", 1) --What if this fails?
- rep.gotoLocation("chest1")
- t.place("down","chest") --what if this fails?
- --MAKING TREE FARM
- --Because: no tree farm is known
- t.displayAction("placing saplings")
- t.condenseInventory()
- t.select(1)
- --could add a treeSearch here: to check over the minedown loacations but it takes too long and gets boring to watch.
- --t.goto(0,0,7,2,"dig") --don't forget to jump over the torch on the way
- --rep.treeSearch()
- local oakCount=0
- local nonoakCount=0
- for i=1,16 do --figuring out which type of saplings to plant
- if turtle.getItemCount(i)>0 then
- local countDetails=t.getDetails(i)
- if countDetails.name=="sapling" then
- if countDetails.nickname=="oak_sapling" then
- oakCount=oakCount+turtle.getItemCount(i)
- else
- nonoakCount=nonoakCount+turtle.getItemCount(i)
- end
- end
- end
- end
- if oakCount>nonoakCount then
- for i=1,16 do
- local countDetails=t.getDetails(i)
- if countDetails.name=="sapling" then
- if countDetails.nickname=="oak_sapling" then
- else
- t.select(i)
- turtle.refuel()
- end
- end
- end
- t.select(1)
- rep.createTreeFarm(0,0,-1,0,"oak_sapling")
- else
- for i=1,16 do
- if t.getDetails(i).nickname=="oak_sapling" then
- t.select(i)
- turtle.refuel()
- end
- end
- t.select(1)
- rep.createTreeFarm(0,0,-1,0,"not_oak_sapling")
- end
- --if I treesearch above Minedown locations then I can createTreeFarm(0,0,11,2)
- --INITIAL SHALLOW MINING
- --Because: a furnace is needed and no cobble is owned, also hoping to find coal
- rep.gotoLocation("chest1")
- t.condenseInventory()
- t.dropAllExcept("down","planks","log","coal")
- t.displayAction("Mining Down")
- rep.mineDown(1,0,2,2,14,"sides") --how far down do I need to go? Based on what I find? (coal/iron/cobble)
- rep.mineUp(2,_G["y"],4,2,14,"sides")
- t.f(1,"dig")
- while t.findItem("stone") do --drop all andesite, diorite and granite
- t.drop("down","stone")
- end
- t.displayAction("Covering Hole")
- for i=1,4 do
- t.place("front","cobblestone")
- t.d(1)
- end
- t.r(1,"dig")
- t.place("down","cobblestone")
- t.goto(1,0,2,2,"dig")
- t.goto(1,-1,2,2,"dig")
- for i=1,4 do
- t.place("front","cobblestone")
- t.d(1)
- end
- t.r(1,"dig")
- t.place("down","cobblestone")
- t.a(2)
- t.w(2,"dig")
- t.dig("down")
- t.place("down","cobblestone")
- t.w(1,"dig")
- t.dig("down")
- t.place("down","cobblestone")
- --done filling in the mineDown hole
- t.goto(0,0,0,1,"dig") --placing dirt/cobble around the chests and signs
- t.w(1,"dig")
- t.place("down","dirt")
- t.place("down","cobblestone")
- t.dig("up")
- t.a(1)
- for i=1,5 do
- t.w(1,"dig")
- t.dig("up")
- t.place("down","dirt")
- t.place("down","cobblestone")
- end
- t.a(1)
- for i=1,2 do
- t.w(1,"dig")
- t.dig("up")
- t.place("down","dirt")
- t.place("down","cobblestone")
- end
- t.a(1)
- for i=1,5 do
- t.w(1,"dig")
- t.dig("up")
- t.place("down","dirt")
- t.place("down","cobblestone")
- end
- t.a(1)
- t.w(1,"dig")
- t.dig("up")
- t.place("down","dirt")
- t.place("down","cobblestone")
- t.a(1)
- t.w(1)
- for i=1,4 do
- t.w(1,"dig")
- t.dig("up")
- t.dig("down")
- end
- rep.gotoLocation("chest1")
- t.checkFuel(4)
- t.dropAllExcept("down","cobblestone")
- --CRAFTING A FURNACE
- --Because: no furnace existing
- t.displayAction("crafting furnace")
- local _,cobbleCount=t.findItem("cobblestone") --should first check to make sure we have 8 cobble...
- if cobbleCount>=8 then --should do something different if we don't have enough cobble
- craftResult=rep.craftItem("furnace", 1) --should do something different if the crafting didn't work...
- end
- ---------------------------------------
- t.d(1)
- t.r(1)
- t.place("up","furnace")
- t.a(1)
- t.select(1)
- t.f(1)
- t.suck("down","all")
- --MAKING CHARCOAL
- --Because: want to make a torch per competition requirements (no iron yet so we dont need it for smelting
- t.displayAction("Making Charcoal")
- t.checkFuel(12)
- t.condenseInventory()
- t.r(1)
- rep.smelt("log",1,"planks",1)
- t.displayAction("Waiting4Charcoal")
- for i=9,1,-1 do
- term.setCursorPos(18,1)
- term.write(i.." ")
- sleep(1)
- end
- term.setCursorPos(17,1)
- term.write(" ")
- t.suck("up")
- --CRAFTING TORCH
- --competition requirement
- t.displayAction("Crafting Torch")
- t.checkFuel(20)
- t.f(1)
- craftResult=rep.craftItem("stick",1)
- craftResult=rep.craftItem("torch",1)
- t.goto(0,0,1,2,"dig")
- t.place("down","dirt")
- t.s(1)
- t.place("front","torch")
- --CRAFTING SIGN
- --for entertainment
- rep.gotoLocation("chest1")
- t.displayAction("Crafting Sign") --Better check you have enough planks to do this
- t.checkFuel(20)
- craftResult=rep.craftItem("sign",1)
- t.goto(0,0,0,1,"dig")
- rep.saveLocation("sign1","front")
- rep.placeSign("front","Gone Mining.\nWill be back\nsoon.\n-Turtle ".._G.turtleNumber)
- t.goto(0,0,-2,1,"dig")
- rep.saveLocation("sign2","front")
- t.select(t.findItem("sign"))
- rep.placeSign("front","Careful:\nIt's a long\n way down.")
- rep.gotoLocation("chest1")
- --collect everything
- t.suck("down","all")
- t.condenseInventory()
- t.select(1)
- --going Diamond Mining (INSTEAD SHOULD PROBABLY GATHER MORE WOOD if neeed AND LOOK FOR REEDS)
- --drop the garbage
- theSlot,currentLogs=t.findItem("logs")
- if currentLogs>1 then
- craftResult=rep.craftItem("planks",currentLogs-1)
- end
- t.suck("down","all")
- t.dropAllExcept("down","planks","coal") --if there are more than 64 planks or more than 1 type of plank then the turtle will probably not have enough planks to make it through mining
- t.condenseInventory()
- t.displayAction("Diamond Mining!")
- t.displayAction("Bedrock Level") --we should be mining veins during this time.
- rep.findBedrockLevel(0,0,-2,0)
- t.displayAction("Diamond Mining!")
- t.condenseInventory()
- rep.diamondMine(16,6,false) -- false means drop extra cobble and dirt, return to surface when required items are gathered. After a while, go harvest the trees that were planted earlier
- --LOOK AT REFUEL FUNCTION: it needs to keep refueling until it has more than target, the function was only refueling one of each item and then saying it's out of fuel.
- t.displayAction("storing items")
- t.goto(0,_G.bedrockLevel,-2,1,"dig")
- while _G["y"]<-1 do --veinmine on the way back up
- possibleVein=t.getDetails("front").name
- if possibleVein=="diamond_ore" or possibleVein=="coal_ore" or possibleVein=="iron_ore" or possibleVein=="gold_ore" or possibleVein=="redstone_ore" or possibleVein=="lapis_ore" then _G.veins[#_G.veins+1]={_G.x,_G.y,_G.z,_G.u,"front",possibleVein} end
- if #_G.veins>0 then t.mineVein(_G["x"],_G["y"],_G["z"],_G["u"],"forward") end
- t.r(1,"dig")
- end
- t.goto(0,-1,-2,0,"dig")
- t.place("forward","cobblestone")
- t.place("down","cobblestone")
- t.r(1,"dig")
- t.a(1)
- t.dropAll("down","cobblestone") --START TIMER! if it reaches 4 minutes then we need to go back and suck/drop all the extra cobblestone that was dropped on the ground next to the storage chest.
- t.dropAll("down","dirt")
- t.goto(0,0,-1,2,"dig")
- t.dropAllExcept("down","coal","planks")
- t.suck("down","all")
- t.dropAllExcept("down","coal","planks","sapling","dirt","torch") --what if there is a bunch of junk in the chest and torches don't fit in the inventory
- t.condenseInventory()
- rep.treeFarm(6)
- rep.gotoLocation("chest1") --crafting the wood that was just collected so it can be used for crafting
- t.suck("down","all")
- craftResult=rep.craftItem("planks",64)
- t.drop("down","planks")
- theSlot,currentLogs=t.findItem("logs")
- if currentLogs>1 then
- craftResult=rep.craftItem("planks",currentLogs-1)
- end
- t.suck("down","all")
- t.checkFuel(20)
- t.displayAction("crafting chest")
- --UH, what if none of the saplings grew and I have no wood? (logCount<2)
- craftResult=rep.craftItem("chest",2)
- t.displayAction("storing cobble")
- t.goto(0,0,-3,0,"dig") --UH, what if I was out of fuel and now I just consumed my chest to refuel?? WHat now??
- t.dig("down")
- t.place("down","chest")
- rep.saveLocation("chest2","down")
- t.s(1)
- t.suck("down","all")
- t.s(1)
- t.suck("down","all")
- t.condenseInventory()
- t.w(2,"dig")
- t.place("down","chest")
- t.dropAll("down","cobblestone")
- t.dropAll("down","dirt")
- t.s(2)
- t.suck("down","all")
- t.w(2,"dig")
- t.d(1)
- rep.placeSign("front","Cobblestone\nand\nDirt")
- rep.saveLocation("sign3","front")
- t.goto(0,0,-1,2,"dig")
- t.dropAllExcept("down","planks","log","coal")
- t.condenseInventory()
- t.displayAction("Making Charcoal") --on a testrun: didnt have enough planks to cook all the wood, so time was wasted sitting there while no charcoal was cooking
- rep.gotoLocation("sign1") --on this testrun: ran out of logs so I have 27 planks in there with nothing to cook
- rep.placeSign("front","Producing\nCharcoal")
- t.goto(0,3,-1,0,"dig")
- --===============================
- --MOVE TO THE rep function
- logCount=turtle.getItemCount(t.findItem("log"))
- t.drop("down","log",logCount-4) --UH, what if there aren't enough logs?
- t.s(1)
- t.goto(0,2,0,0,"dig")
- plankCount=turtle.getItemCount(t.findItem("planks"))
- t.drop("front","planks",plankCount-4) --UH, what if there aren't enough planks?
- t.f(1)
- t.w(1)
- t.displayAction("Waiting4Charcoal") --WHILE WAITING FOR COOKING CHARCOAL, WE COULD JUST GRAB THE FIRST 2 CHARCOAL AND GO MAKE SURE THE SAPLINGS HAVE ROOM TO GROW.
- waitTime=10*(logCount-4) --seconds (should be 10 seconds * #of logs)
- if waitTime<2 then waitTime=2 end
- for i=waitTime,1,-1 do
- term.setCursorPos(16,1)
- term.write(i.." ")
- sleep(1)
- end
- term.setCursorPos(15,1)
- term.write(" ")
- t.suck("up")
- t.s(1)
- t.r(1,"dig")
- t.suck("forward")
- t.r(1,"dig")
- t.w(1,"dig")
- t.suck("down")
- t.s(1)
- t.f(1)
- t.condenseInventory()
- t.displayAction("crafting torches")
- rep.gotoLocation("origin")
- rep.gotoLocation("chest1")
- t.checkFuel(20)
- craftResult=rep.craftItem("stick",1) --UH, what if we have more than 16 types of items in the chest and sticks/charcoal are not amng the items sucked up?
- craftResult=rep.craftItem("torch",1) --should probably flow the items instead of this... (see above)
- if turtle.getFuelLevel()<750 then
- while t.findItem("charcoal") and turtle.getFuelLevel()<5000 do
- turtle.select(t.findItem("charcoal"))
- turtle.refuel(1)
- end
- t.select(_G.selectedSlot)
- end
- t.w(1,"dig")
- for i=1,16 do --dropping all the junk down the hole
- if turtle.getItemCount(i)>0 then
- if t.getDetails(i).name=="stone" or t.getDetails(i).name=="red_flower" or t.getDetails(i).name=="yellow_flower" or t.getDetails(i).name=="brown_mushroom" or t.getDetails(i).name=="red_mushroom" or t.getDetails(i).name=="wheat_seeds" then
- t.select(i)
- turtle.dropDown(64)
- end
- end
- t.dropExtra("down","cobblestone") --drop the extra resources so they don't fill up the chest
- t.dropExtra("down","dirt")
- end
- t.w(1,"dig")
- for i=1,16 do --dropping all the dirt/cobble in the chest
- if turtle.getItemCount(i)>0 then
- if t.getDetails(i).name=="dirt" or t.getDetails(i).name=="cobblestone" then
- t.select(i)
- turtle.dropDown(64)
- end
- end
- end
- t.select(1)
- t.s(2)
- rep.treeFarm(6)
- ---------------------------------------------- DOUBLE CHECK that chest1 doesn't have junk in it like cobble/andesite/flowers
- t.displayAction("Diamond Mining!")
- rep.gotoLocation("sign1")
- rep.placeSign("front","Diamond\nmining.\n2nd trip\n-Turtle "..turtleNumber)
- t.a(1)
- t.w(1,"dig")
- theSlot,currentPlanks=t.findItem("planks") --this can get broken if you have 1 birchwood and 30 oak wood in inventory
- if turtle.getFuelLevel()<350 and currentPlanks<25 then --if you might run out of fuel then craft some wood into planks
- planksNeeded=math.ceil((25-currentPlanks)/4)
- print(planksNeeded)
- t.dropAllExcept("down","log")
- t.dropExtra("down","log")
- turtle.craft(planksNeeded)
- end
- t.suck("down","all")
- t.dropAllExcept("down","planks","coal")
- t.condenseInventory()
- t.goto(0,0,-2,2,"dig")
- while _G["y"]>_G.bedrockLevel do
- possibleVein=t.getDetails("front").name
- if possibleVein=="diamond_ore" or possibleVein=="coal_ore" or possibleVein=="iron_ore" or possibleVein=="gold_ore" or possibleVein=="redstone_ore" or possibleVein=="lapis_ore" then _G.veins[#_G.veins+1]={_G.x,_G.y,_G.z,_G.u,"front",possibleVein} end
- if #_G.veins>0 then t.mineVein(_G["x"],_G["y"],_G["z"],_G["u"],"forward") end
- t.f(1,"dig")
- end
- rep.diamondMine(16,6,false)
- t.displayAction("storing items")
- t.goto(0,_G.bedrockLevel,-2,3,"dig")
- while _G["y"]<-1 do
- possibleVein=t.getDetails("front").name
- if possibleVein=="diamond_ore" or possibleVein=="coal_ore" or possibleVein=="iron_ore" or possibleVein=="gold_ore" or possibleVein=="redstone_ore" or possibleVein=="lapis_ore" then _G.veins[#_G.veins+1]={_G.x,_G.y,_G.z,_G.u,"front",possibleVein} end
- if #_G.veins>0 then t.mineVein(_G["x"],_G["y"],_G["z"],_G["u"],"forward") end
- t.r(1,"dig")
- end
- t.goto(0,-1,-2,0,"dig")
- --dropping off extra cobble
- t.dropExtra("front","cobblestone")
- t.goto(0,0,-1,2,"dig")
- t.display("pause 13",32,13,8)
- if debugPause==true then read() end
- t.checkFuel(20)
- --craft 2 chests
- --if there aren't enough planks, then craft them out of wood (logs)
- --SHOULD ADD: IF THERE ARE NO LOGS, GO FARM THEM OR TREESEARCH THEM
- t.suck("down","all")
- theSlot,currentPlanks=t.findItem("planks")
- if currentPlanks<22 then --if you might run out of fuel then craft some wood into planks
- planksNeeded=math.ceil((24-currentPlanks)/4)
- t.suck("down","all") --what if we have >16 stacks of stuff in the chest (should flow items)
- t.dropAllExcept("down","log")
- t.dropExtra("down","log")
- turtle.craft(planksNeeded)
- t.drop("down","log")
- t.suck("down","all")
- end
- t.condenseInventory()
- t.dropAllExcept("down","planks")
- t.dropExtra("down","planks")
- --=============================
- --SWITCH THIS TO rep FUNCTION
- craftResult=rep.craftItem("chest",2) --UH, what if we don't have 16 planks?
- --[[
- t.transferItem("planks",_G.plankSlot)
- t.select(_G.plankSlot)
- --Double-check this is fixed:
- for k=1,11 do
- if k~=4 and k~=6 and k~=8 then turtle.transferTo(k,2) end
- end
- turtle.dropDown()
- turtle.craft(2)
- doubleCheck=t.findItem("chest")
- if doubleCheck==nil then t.display("error crafting 2 chests",15,12,25) end
- --use the extra chest to sort out inventory============= "flow inventory"
- t.goto(0,0,-1,1)
- t.place("forward","chest")
- t.suck("down","all")
- t.dropAllExcept("front","planks","stick")
- t.suck("down","all")
- t.dropAllExcept("front","planks","stick") --UH, what if we magically don't have any sticks? (there should still be 2 sticks in there... but they could disappear...)
- --crafting sign
- t.transferItem("stick",10)
- t.transferItem("planks",_G.plankSlot)
- t.select(_G.plankSlot)
- for i=1,7 do
- if i~=4 then turtle.transferTo(i,1) end
- end
- for i=1,16 do
- if i~=1 and i~=2 and i~=3 and i~=5 and i~=6 and i~=7 and i~=10 then
- t.select(i)
- turtle.dropDown()
- end
- end
- t.select(4)
- turtle.craft(1) --sign crafted*********
- doubleCheck=t.findItem("sign")
- if doubleCheck==nil then t.display("error crafting signs",15,12,25) end
- --]]
- --Make a list of which items go in which chest
- --====================================================================================================================
- t.drop("down","stick") --CAN WE JUST USE dropAllExcept here instead? not needed?
- t.suck("front","all")
- t.dropAll("down","sapling")
- t.dropAll("down","torch")
- t.dropAll("down","apple")
- t.dropAll("down","log")
- t.dropAll("down","wheat_seeds")
- t.suck("front","all")
- t.dropAll("down","sapling")
- t.dropAll("down","torch")
- t.dropAll("down","apple")
- t.dropAll("down","log")
- t.dropAll("down","wheat_seeds")
- t.dig("front")
- rep.gotoLocation("chest2")
- t.dropAll("down","cobblestone")
- t.dropAll("down","dirt")
- t.dropAll("down","gravel")
- t.w(2,"dig")
- t.dig("down")
- t.place("down","chest")
- rep.saveLocation("chest3","down")
- t.dropAll("down","iron_ore")
- t.dropAll("down","dye") --lapis
- t.dropAll("down","redstone")
- t.dropAll("down","gold_ore")
- t.dropAll("down","diamond")
- t.dropAll("down","emerald")
- t.dropAll("down","obsidian")
- t.dropAll("down","flint")
- t.d(1)
- rep.placeSign("front","Mined\nMaterials")
- rep.saveLocation("sign4","front")
- t.d(1)
- t.w(2,"dig")
- t.a(1)
- t.display("pause 14",32,13,8)
- if debugPause==true then read() end
- --updating sign to show that gravel is stored here too.
- rep.placeSign("front","Cobblestone,\nDirt and Gravel")
- t.goto(0,0,-1,2,"dig")
- t.condenseInventory()
- --if we don't have 200 fuel we need to make sure we have planks to get us around
- if turtle.getFuelLevel()<200 and t.getDetails(t.findItem("planks")).count<14 then
- t.suck("down","all")
- local logCount=t.getDetails("log").count
- if logCount>1 then craftResult=rep.craftItem("planks",logCount-1) end
- end
- rep.treeFarm(6)
- rep.gotoLocation("chest1")
- --t.goto(0,0,-1,0,"dig")
- t.dropAll("down","sapling")
- t.dropAll("down","torch")
- t.dropAll("down","dirt")
- t.dropAll("down","log")
- t.dropAll("down","apple")
- --time to go look for sand and reeds?
- t.display("pause 15",32,13,8)
- if debugPause==true then read() end
- t.select(1)
- --KEEPS RUNNING OUT OF PLANKS BUT THERE ARE PLENTY OF LOGS: need to craft planks and refuel
- --clears out all the blocks around the treefarm (needed for large initial trees and hills)
- --if it doesnt have fuel then it should keep treefarming
- t.checkFuel(750)
- t.displayAction("Landscaping")
- rep.gotoLocation("sign1")
- rep.placeSign("front","Landscaping")
- t.select(1)
- t.goto(1,1,2,3,"dig")
- function clearArea(length)
- for i=1,length do
- if t.getDetails("up").name=="furnace" then else t.dig("up") end
- if turtle.detectDown() then
- local checkName=t.getDetails("down").name
- if checkName=="torch" or checkName=="standing_sign" or checkName=="wall_sign" then else t.dig("down") end
- end
- t.w(1,"dig")
- end
- if t.getDetails("up").name=="furnace" then else t.dig("up") end
- if turtle.detectDown() then
- local checkName=t.getDetails("down").name
- if checkName=="torch" or checkName=="standing_sign" or checkName=="wall_sign" then else t.dig("down") end
- end
- end
- t.goto(7,2,2,0,"dig")
- for i=1,3 do
- clearArea(14)
- t.d(1)
- t.w(1,"dig")
- t.d(1)
- clearArea(14)
- t.a(1)
- t.w(1,"dig")
- t.a(1)
- end
- clearArea(14)
- t.d(1)
- t.w(1,"dig")
- t.d(1)
- clearArea(10)
- t.r(1,"dig")
- t.w(2,"dig")
- t.f(1,"dig")
- clearArea(2)
- t.a(1)
- t.w(1,"dig")
- t.a(1)
- for i=1,3 do
- clearArea(14)
- t.d(1)
- t.w(1,"dig")
- t.d(1)
- clearArea(14)
- t.a(1)
- t.w(1,"dig")
- t.a(1)
- end
- t.goto(7,4,2,0,"dig")
- for i=1,7 do
- clearArea(14)
- t.d(1)
- t.w(1,"dig")
- t.d(1)
- clearArea(14)
- t.a(1)
- t.w(1,"dig")
- t.a(1)
- end
- t.goto(7,7,2,0,"dig")
- for i=1,7 do
- clearArea(14)
- t.d(1)
- t.w(1,"dig")
- t.d(1)
- clearArea(14)
- t.a(1)
- t.w(1,"dig")
- t.a(1)
- end
- t.goto(0,1,0,0,"dig")
- t.goto(0,0,-1,0,"dig")
- rep.treeFarm(10)
- t.goto(0,0,-1,0,"dig")
- --add one last check to make sure no dirt/junk in the chest1
- t.checkFuel(150)
- t.goto(0,1,0,0,"dig")
- -- t.goto(0,1,7,2,"dig") --don't forget to jump over the torch on the way
- -- rep.treeSearch()
- -- t.goto(0,1,0,0,"dig")
- rep.gotoLocation("chest1")
- t.suck("down","all")
- t.dropAllExcept("down","planks","dirt","sapling","torch")
- t.w(2)
- t.suck("down","all")
- t.dropAll("down","cobblestone")
- t.dropAll("down","gravel")
- t.condenseInventory()
- t.goto(0,1,0,0,"dig")
- t.checkFuel(150)
- --[[
- local oakCount=0
- local nonoakCount=0
- for i=1,16 do --figuring out which type of saplings to plant
- if turtle.getItemCount(i)>0 then
- local countDetails=t.getDetails(i)
- if countDetails.name=="sapling" then
- if countDetails.nickname=="oak_sapling" then
- oakCount=oakCount+turtle.getItemCount(i)
- else
- nonoakCount=nonoakCount+turtle.getItemCount(i)
- end
- end
- end
- end
- if oakCount>nonoakCount then
- for i=1,16 do
- local countDetails=t.getDetails(i)
- if countDetails.name=="sapling" then
- if countDetails.nickname=="oak_sapling" then
- else
- t.select(i)
- turtle.refuel()
- end
- end
- end
- t.select(1)
- rep.createTreeFarm(0,0,11,2,"oak_sapling")
- else
- for i=1,16 do
- if t.getDetails(i).nickname=="oak_sapling" then
- t.select(i)
- turtle.refuel()
- end
- end
- t.select(1)
- rep.createTreeFarm(0,0,11,2,"not_oak_sapling")
- end
- --]]
- t.goto(0,2,0,0,"dig")
- t.goto(0,0,0,0,"dig") --to avoid breaking furnace
- t.goto(0,0,-3,0,"dig")
- t.dropAll("down","dirt")
- rep.gotoLocation("chest1")
- t.suck("down","all")
- t.dropAllExcept("down","log")
- if t.findItem("log") then craftResult=rep.craftItem("planks",64) end
- t.suck("down","all")
- t.dropAllExcept("down","planks")
- t.goto(0,0,-5,0,"dig")
- t.suck("down","all")
- t.dropAllExcept("down","iron_ore","gold_ore","planks")
- rep.gotoLocation("chest1")
- t.checkFuel(16)
- t.r(1,"dig")
- theSlot,ironCount=t.findItem("iron_ore")
- if theSlot then
- rep.smelt("iron_ore",ironCount,"planks", 64)
- end
- t.displayAction("Waiting4Iron")
- waitTime=10*(ironCount) --seconds (should be 10 seconds * #of smelting items)
- if waitTime<2 then waitTime=2 end
- --Wait for smelt
- for i=waitTime,1,-1 do
- term.setCursorPos(16,1)
- term.write(i.." ")
- sleep(1)
- end
- term.setCursorPos(15,1)
- term.write(" ")
- t.suck("up")
- t.s(1)
- t.r(1,"dig")
- t.suck("forward")
- t.r(1,"dig")
- t.w(1,"dig")
- t.suck("down")
- t.s(1)
- t.f(2,"dig")
- t.w(1,"dig")
- t.condenseInventory()
- theSlot,goldCount=t.findItem("gold_ore")
- if theSlot then
- rep.smelt("gold_ore",goldCount,"planks", 64)
- end
- t.displayAction("Waiting4Gold")
- waitTime=10*(goldCount) --seconds (should be 10 seconds * #of smelting items)
- if waitTime<2 then waitTime=2 end
- --Wait for smelt
- for i=waitTime,1,-1 do
- term.setCursorPos(16,1)
- term.write(i.." ")
- sleep(1)
- end
- term.setCursorPos(15,1)
- term.write(" ")
- t.suck("up")
- t.s(1)
- t.r(1,"dig")
- t.suck("forward")
- t.r(1,"dig")
- t.w(1,"dig")
- t.suck("down")
- t.s(1)
- t.f(2,"dig")
- t.w(1,"dig")
- t.condenseInventory()
- t.goto(0,0,-5,0,"dig")
- t.drop("down","gold_ingot")
- rep.gotoLocation("chest1")
- theSlot,ironCount=t.findItem("iron_ingot")
- if ironCount>=3 then craftResult=rep.craftItem("bucket",1) end
- t.goto(0,0,-5,0,"dig")
- t.drop("down","iron_ingot")
- rep.gotoLocation("chest1")
- rep.treeFarm(10)
- t.goto(0,0,-1,0,"dig")
- t.suck("down","all")
- t.goto(0,0,-3,0,"dig")
- t.dropAll("down","dirt")
- t.dropAll("down","stone")
- t.dropAll("down","gravel")
- t.dropAll("down","cobblestone")
- t.goto(0,0,-1,0,"dig")
- t.dropAllExcept("down","coal","planks","log","bucket")
- t.condenseInventory()
- t.goto(0,1,10,3,"dig")
- rep.sugarCaneSearch(20,25,15)
- t.goto(0,1,-15,1,"dig")
- rep.sugarCaneSearch(20,25,15)
- t.goto(0,1,-1,0,"dig")
- t.goto(0,0,-1,0,"dig")
- rep.treeFarm(10)
- t.goto(0,0,-1,0,"dig")
- --[[
- --=================================
- --DEVELOPMENT
- t.checkFuel(200)
- t.displayAction("sugarcane search")
- while t.getDetails("down").name=="none" do
- if t.getDetails("front").name=="reeds" then harvestReedStalk() end
- t.f(1,"nodig")
- end
- if t.getDetails("down").name=="water" then
- --search around for sugarcane
- end
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement