Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------Written by Barnet-----------
- ------------Introduction---------------
- -- This is a program to bake cake. --
- -- You need to place one chest on --
- -- each side of the turtle (thats --
- -- 6 in total). They need to be --
- -- filled as followed: --
- ---------------------------------------
- -- Front: Milk Buckets --
- -- Left: Wheat --
- -- Right: Sugar --
- -- Top: Eggs --
- -- Bottom: Empty (for empty buckets) --
- -- Back: Empty (for the cakes) --
- ---------------------------------------
- -- Now just start the program and --
- -- watch how this turtle is baking --
- -- those sweet sweet cakes. --
- ---------------------------------------
- -- (Please do NOT fill the turtle --
- -- per hand. This could cause some --
- -- problems.) --
- ---------------------------------------
- --functions----------------------------
- function Next()
- x = turtle.getSelectedSlot()
- x=x+1
- turtle.select(x)
- end
- function CheckSlot()
- Item = turtle.getItemDetail()
- if Item.name == "" then
- return true
- else
- return false
- end
- end
- function CheckBucket()
- Item = turtle.getItemDetail()
- if Item.name == "minecraft:bucket" then
- return true
- else
- return false
- end
- end
- function RefillMilk()
- local o = 1
- while o<4 do
- turtle.select(o)
- if pcall(CheckSlot) == true then
- if CheckBucket() == true then
- turtle.dropDown(1)
- turtle.suck(1)
- end
- else
- turtle.suck(1)
- end
- if pcall(CheckSlot) == false then
- print("Missing milk!")
- error()
- end
- o=o+1
- end
- end
- function RefillSugar()
- turtle.select(5)
- if pcall(CheckSlot) == false then
- turtle.turnRight()
- turtle.suck()
- turtle.select(7)
- turtle.suck()
- turtle.turnLeft()
- if pcall(CheckSlot) == false then
- print("Missing sugar!")
- error()
- end
- end
- end
- function RefillEgg()
- turtle.select(6)
- if pcall(CheckSlot) == false then
- turtle.suckUp()
- if pcall(CheckSlot) == false then
- print("Missing eggs!")
- error()
- end
- end
- end
- function RefillWheat()
- turtle.select(9)
- if pcall(CheckSlot) == false then
- turtle.turnLeft()
- turtle.suck()
- turtle.suck()
- turtle.suck()
- turtle.turnRight()
- turtle.select(11)
- if pcall(CheckSlot) == false then
- print("Missing wheat!")
- error()
- end
- end
- end
- --main---------------------------------
- while true do
- RefillMilk()
- RefillSugar()
- RefillEgg()
- RefillWheat()
- turtle.craft()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(12)
- turtle.drop()
- turtle.turnRight()
- turtle.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement