Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("tillapi")
- local positions = { {-3,1,2} , {-2,1,2} , {-1,1,2} ,
- {-3,0,2} , {-2,0,2} , {-1,0,2} ,
- {-3,-1,2} , {-2,-1,2} , {-1,-1,2} }
- local slotList = { 1,2,3,5,6,7,9,10,11}
- function goCrafting(count1)
- tillapi.offsetGoTo(-4,1,2)
- turtle.select(13)
- turtle.place()
- tillapi.offsetGoTo(-4,-1,0)
- turtle.select(slotList[count1])
- while turtle.getItemCount() == 0 do
- redstone.setOutput("bottom",true)
- sleep(1)
- redstone.setOutput("bottom",false)
- sleep(1)
- turtle.suckUp(1)
- end
- tillapi.forceMoveBack()
- tillapi.forceMoveBack()
- tillapi.forceMoveUp()
- tillapi.forceMoveUp()
- turtle.select(13)
- turtle.attack()
- local pos = positions[count1]
- tillapi.offsetGoTo(pos[1],pos[2],pos[3])
- turtle.place()
- end
- if fs.exists("logFile") then
- local log = fs.open("logFile","r")
- local pos1 = positions[tonumber(log.readLine())]
- if turtle.getItemCount(13) ~= 0 then
- tillapi.offsetGoTo(pos1[1],pos1[2],pos1[3])
- turtle.select(13)
- turtle.place()
- else
- tillapi.offsetGoTo(-4,1,2)
- turtle.select(13)
- turtle.attack()
- local detail1 = turtle.getItemDetail(13)
- if detail1["name"]=="minecraft:item_frame" then
- turtle.place()
- else
- tillapi.offsetGoTo(pos1[1],pos1[2],pos1[3])
- turtle.select(13)
- turtle.place()
- end
- end
- end
- fs.delete("logFile")
- tillapi.offsetGoTo(0,0,0)
- for k=1,16 do
- turtle.select(k)
- turtle.dropDown(64)
- end
- local count0 = 0
- for key,value in ipairs(positions) do
- count0=count0+1
- tillapi.offsetGoTo(value[1],value[2],value[3])
- turtle.select(13)
- turtle.attack()
- local detail = turtle.getItemDetail(13)
- if detail["name"]=="minecraft:item_frame" then
- turtle.place()
- else
- if fs.exists("logFile") then fs.delete("logFile") end
- local log = fs.open("logFile","w")
- log.writeLine(tostring(count0))
- log.flush()
- log.close()
- goCrafting(count0)
- end
- end
- tillapi.offsetGoTo(0,-2,1)
- turtle.select(13)
- turtle.suck()
- turtle.equipRight()
- turtle.drop()
- turtle.select(14)
- turtle.craft()
- turtle.select(13)
- turtle.suck()
- turtle.equipRight()
- turtle.drop()
- tillapi.offsetGoTo(0,-1,1)
- turtle.select(14)
- turtle.drop()
- if fs.exists("logFile") then fs.delete("logFile") end
- tillapi.offsetGoTo(0,0,0)
- tillapi.craftRefuel()
Add Comment
Please, Sign In to add comment