Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Slot 1: Coal
- --Slot 2: Sepling
- --Slot 3: Bonemill
- CoalSlot = 1
- SepSlot = 2
- BoneSlot = 3
- loop = true
- function Refuel()
- if turtle.getFuelLevel() < 1 then
- turtle.select(CoalSlot)
- if not turtle.refuel(2) then
- print("Nem tudtam tankolni.")
- read("")
- return Refuel
- end
- end
- end
- function cls()
- term.clear()
- term.setCursorPos(1,1)
- end
- function PrintFuel(status)
- cls()
- local x, y = term.getCursorPos()
- term.setCursorPos(x, y)
- term.clearLine()
- print("Time: " .. textutils.formatTime(os.time(),true))
- local x, y = term.getCursorPos()
- term.setCursorPos(x, y)
- term.clearLine()
- print("Fuel level: " .. turtle.getFuelLevel())
- if status then
- print("Working")
- else
- print("Stop")
- end
- end
- function GetBm()
- turtle.select(BoneSlot)
- return turtle.getItemCount(BoneSlot)
- end
- function GetSe()
- turtle.select(SepSlot)
- return turtle.getItemCount(SepSlot)
- end
- function CuttingWood()
- if turtle.detect() then
- turtle.select(4)
- turtle.dig()
- turtle.forward()
- layer = 0
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up(1)
- layer = layer + 1
- end
- for d = 0, layer do
- turtle.down()
- end
- layer = 0
- turtle.back()
- return true
- else
- return false
- end
- end
- function GoWork()
- for w = 0, 2 do
- turtle.forward()
- end
- end
- function GoHome()
- for b = 0, 2 do
- turtle.back()
- end
- end
- function GetBone()
- turtle.turnLeft(1)
- turtle.select(BoneSlot)
- turtle.suck()
- turtle.suck()
- turtle.suck()
- turtle.suck()
- turtle.turnRight(1)
- end
- function GetSep()
- turtle.turnRight(1)
- turtle.select(SepSlot)
- turtle.suck()
- turtle.turnLeft(1)
- end
- function wooding()
- turtle.select(SepSlot)
- turtle.place()
- end
- function boneing()
- turtle.select(BoneSlot)
- for i = 0, 5 do
- turtle.place()
- sleep(.5)
- end
- end
- function drop()
- for i = 0, 1 do
- turtle.turnRight()
- end
- for i = 4, 16 do
- turtle.select(i)
- turtle.drop()
- end
- for i = 0, 1 do
- turtle.turnRight()
- end
- end
- function main()
- Refuel()
- PrintFuel(true)
- GetBone()
- PrintFuel(true)
- GetSep()
- PrintFuel(true)
- GoWork()
- PrintFuel(true)
- wooding()
- PrintFuel(true)
- boneing()
- PrintFuel(true)
- CuttingWood()
- PrintFuel(true)
- GoHome()
- PrintFuel(true)
- drop()
- PrintFuel(true)
- end
- function stopCheck()
- if redstone.getInput("bottom") then
- return true
- else
- return false
- end
- end
- while loop do
- while stopCheck() do
- cls()
- PrintFuel(true)
- main()
- delay = 0.1
- end
- delay = 2
- cls()
- PrintFuel(false)
- sleep(delay)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement