Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dofile("denesik_lib.lua")
- rotateToRed("back")
- --listSide={"front","top","down",
- -- "left","right","back"}
- craft={"top","front","top",
- "left","down","left",
- "top","front","top"}
- craftSlot="right"
- function isSide(side)
- for i=1,9 do
- if(craft[i]==side)then
- return true
- end
- end
- return false
- end
- function suck_(side,slot)
- if(side=="front" or
- side=="right" or
- side=="left")then
- while(turtle.getItemCount(slot)==0)do
- turtle.select(slot)
- turtle.suck()
- end
- end
- if(side=="top")then
- while(turtle.getItemCount(slot)==0)do
- turtle.select(slot)
- turtle.suckUp()
- end
- end
- if(side=="down")then
- while(turtle.getItemCount(slot)==0)do
- turtle.select(slot)
- turtle.suckDown()
- end
- end
- end
- function getItemChest(side)
- if(side=="left" and isSide(side))then
- turtle.turnLeft()
- end
- if(side=="right" and isSide(side))then
- turtle.turnRight()
- end
- for i=1,9 do
- slot = numCraftToSlot(i)
- if(craft[i]==side)then
- suck_(side,slot)
- end
- end
- if(side=="left" and isSide(side))then
- turtle.turnRight()
- end
- if(side=="right" and isSide(side))then
- turtle.turnLeft()
- end
- end
- function drop_(side)
- if(side=="left")then
- turtle.turnLeft()
- end
- if(side=="right")then
- turtle.turnRight()
- end
- if(side=="right" or
- side=="left" or
- side=="front")then
- turtle.drop()
- end
- if(side=="down")then
- turtle.dropDown()
- end
- if(side=="top")then
- turtle.dropUp()
- end
- if(side=="left")then
- turtle.turnRight()
- end
- if(side=="right")then
- turtle.turnLeft()
- end
- end
- while(true)do
- getItemChest("front")
- getItemChest("top")
- getItemChest("down")
- getItemChest("left")
- getItemChest("right")
- turtle.select(4)
- turtle.craft()
- drop_(craftSlot)
- end
Advertisement
Add Comment
Please, Sign In to add comment