Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chestSlot = 15
- local torchSlot = 16
- local cobbleSlot = 2
- local fuelSlot = 1
- local bucketSlot = 3
- local chose = 1
- local t=12
- local torchesplace = "No"
- local floorplace = "Yes"
- local chestplace = "No"
- local czank = 16
- a = colors.green
- b = colors.yellow
- c = colors.yellow
- d = colors.yellow
- -- ----------------------------------------------------
- local function bucket()
- local success, data = turtle.inspectDown()
- if data.name == "minecraft:flowing_lava" then
- turtle.select(bucketSlot)
- turtle.placeDown()
- turtle.refuel()
- end
- if data.name == "minecraft:lava" then
- turtle.select(bucketSlot)
- turtle.placeDown()
- turtle.refuel()
- end
- end
- -- -----------------------------------
- local function screen()
- term.clear()
- term.setTextColor(colors.yellow)
- print( "Fuel Level: "..turtle.getFuelLevel() )
- print("")
- print("")
- print("Torch distance: "..t)
- if floorplace == "Yes" then
- print("Floor will be placed")
- else
- print("Floor won't be placed")
- end
- print("")
- print("")
- print("Fuel Slot:"..fuelSlot)
- print("Build Block Slot:"..cobbleSlot)
- print("Bucket Slot:"..bucketSlot)
- print("Chest Slot:"..chestSlot)
- print("Torch Slot:"..torchSlot)
- end
- -- -----------------------------------
- local function fuel()
- if turtle.getFuelLevel() < 50 then
- turtle.select(fuelSlot)
- turtle.refuel(5)
- end
- end
- -- --------------------------------------
- local function dig()
- while turtle.detect() == true do
- turtle.dig()
- end
- turtle.forward()
- screen()
- end
- -- -------------------------------------
- local function floor()
- if floorplace == "Yes" then
- if turtle.detectDown() then
- else
- turtle.select(cobbleSlot)
- turtle.placeDown()
- end
- end
- end
- -- -------------------------------------
- local function chest()
- if chestplace == "Yes" then
- if turtle.getItemCount(14) >= 1 then
- turtle.up()
- turtle.turnRight()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.select(chestSlot)
- turtle.place()
- for y=14,4,-1 do
- turtle.select(y)
- turtle.drop()
- end
- turtle.turnLeft()
- end
- end
- end
- -- -------------------------------------
- local function torchchunk()
- if torchesplace == "Yes" then
- turtle.up()
- turtle.select(torchSlot)
- turtle.placeDown()
- end
- end
- -- -------------------------------------
- local function torch2x2()
- if torchesplace == "Yes" then
- turtle.turnLeft()
- turtle.up()
- turtle.forward()
- if turtle.detect() then
- else
- turtle.select(cobbleSlot)
- turtle.place()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(torchSlot)
- turtle.place()
- turtle.turnRight()
- turtle.down()
- end
- end
- -- --------------------------------
- local function mine1x2()
- end
- -- --------------------------------
- local function mine3x3()
- end
- -- --------------------------------
- local function chunk()
- turtle.refuel(5)
- print( "Fuel Level: "..turtle.getFuelLevel() )
- while true do
- czank_set=1
- for h=4,1,-1 do
- if czank_set==2 then
- czank=czank-2
- czank_set=0
- end
- if czank<=0 then
- break
- end
- czank_set=czank_set+1
- for g=czank,1,-1 do
- fuel()
- dig()
- bucket()
- floor()
- turtle.turnLeft()
- dig()
- bucket()
- floor()
- turtle.turnRight()
- turtle.digUp()
- turtle.up()
- turtle.turnRight()
- dig()
- turtle.turnLeft()
- turtle.down()
- chest()
- end
- torchchunk()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- end
- end
- end
- -- --------------------------------
- local function mine2x2()
- turtle.refuel(5)
- print( "Fuel Level: "..turtle.getFuelLevel() )
- while true do
- for i=t,1,-1 do
- fuel()
- dig()
- bucket()
- floor()
- turtle.turnLeft()
- dig()
- bucket()
- floor()
- turtle.turnRight()
- turtle.digUp()
- turtle.up()
- turtle.turnRight()
- dig()
- turtle.turnLeft()
- turtle.down()
- chest()
- end
- torch2x2()
- end
- end
- -- --------------Mining----------------------
- local function MineSC()
- term.clear()
- term.setCursorPos(3,3);
- term.setTextColor(a)
- print("1x2")
- term.setCursorPos(3,4);
- term.setTextColor(b)
- print("2x2")
- term.setCursorPos(3,5);
- term.setTextColor(c)
- print("3x3")
- term.setCursorPos(3,6);
- term.setTextColor(d)
- print("Chunk!")
- end
- local function mine()
- a = colors.green
- b = colors.yellow
- c = colors.yellow
- d = colors.yellow
- term.clear()
- chose = 1
- while true do
- MineSC()
- local event, key = os.pullEvent( "key" )
- if key == keys.enter then
- break
- end
- if key == keys.up then
- chose = chose - 1
- end
- if key == keys.down then
- chose = chose + 1
- end
- if chose <= 0 then
- chose = 4
- end
- if chose >= 5 then
- chose = 1
- end
- if chose == 1 then
- a = colors.green
- b = colors.yellow
- c = b
- d = b
- end
- if chose == 2 then
- a = colors.yellow
- b = colors.green
- c = a
- d = a
- end
- if chose == 3 then
- a = colors.yellow
- b = a
- c = colors.green
- d = a
- end
- if chose == 4 then
- a = colors.yellow
- b = a
- c = a
- d = colors.green
- end
- end
- if chose == 1 then
- mine1x2()
- end
- if chose == 2 then
- mine2x2()
- end
- if chose == 3 then
- mine3x3()
- end
- if chose == 4 then
- chunk()
- end
- end
- -- ------------------------------------------
- -- --------------OPTIONS----------------------
- local function OptionsSC()
- term.clear()
- term.setCursorPos(3,3);
- term.setTextColor(a)
- print("Place Torches: "..torchesplace)
- term.setCursorPos(3,4);
- term.setTextColor(b)
- print("Place Floor: "..floorplace)
- term.setCursorPos(3,5);
- term.setTextColor(c)
- print("Place Chest: "..chestplace)
- term.setCursorPos(3,6);
- term.setTextColor(d)
- print("Back to menu")
- end
- local function options()
- a = colors.green
- b = colors.yellow
- c = colors.yellow
- d = colors.yellow
- term.clear()
- chose = 1
- while true do
- OptionsSC()
- local event, key = os.pullEvent( "key" )
- if key == keys.enter then
- break
- end
- if key == keys.up then
- chose = chose - 1
- end
- if key == keys.down then
- chose = chose + 1
- end
- if chose <= 0 then
- chose = 4
- end
- if chose >= 5 then
- chose = 1
- end
- if chose == 1 then
- a = colors.green
- b = colors.yellow
- c = b
- d = b
- end
- if chose == 2 then
- a = colors.yellow
- b = colors.green
- c = a
- d = a
- end
- if chose == 3 then
- a = colors.yellow
- b = a
- c = colors.green
- d = a
- end
- if chose == 4 then
- a = colors.yellow
- b = a
- c = a
- d = colors.green
- end
- end
- if chose == 1 then
- if torchesplace == "No" then
- torchesplace = "Yes"
- options()
- else
- torchesplace = "No"
- options()
- end
- end
- if chose == 2 then
- if floorplace == "No" then
- floorplace = "Yes"
- options()
- else
- floorplace = "No"
- options()
- end
- end
- if chose == 3 then
- if chestplace == "No" then
- chestplace = "Yes"
- options()
- else
- chestplace = "No"
- options()
- end
- end
- if chose == 4 then
- end
- end
- -- ---------------MENU----------------------
- local function MenuSC()
- term.clear()
- term.setCursorPos(3,3);
- term.setTextColor(a)
- print("Start")
- term.setCursorPos(3,4);
- term.setTextColor(b)
- print("Options")
- term.setCursorPos(3,5);
- term.setTextColor(c)
- print("Exit")
- end
- local function Menu()
- term.clear()
- chose = 1
- while true do
- MenuSC()
- local event, key = os.pullEvent( "key" )
- if key == keys.enter then
- break
- end
- if key == keys.up then
- chose = chose - 1
- end
- if key == keys.down then
- chose = chose + 1
- end
- if chose <= 0 then
- chose = 3
- end
- if chose >= 4 then
- chose = 1
- end
- if chose == 1 then
- a = colors.green
- b = colors.yellow
- c = colors.yellow
- end
- if chose == 2 then
- a = colors.yellow
- b = colors.green
- c = colors.yellow
- end
- if chose == 3 then
- a = colors.yellow
- b = colors.yellow
- c = colors.green
- end
- end
- if chose == 1 then
- mine()
- end
- if chose == 2 then
- options()
- end
- if chose == 3 then
- os.shutdown()
- end
- end
- -- -------------------------------------------
- -- -----------------PROGRAM-------------------
- while true do
- local chose = 1
- a = colors.green
- b = colors.yellow
- c = colors.yellow
- d = colors.yellow
- Menu()
- end
- -- -------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement