Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i=peripheral.wrap("right")
- side=2
- s=peripheral.wrap("bottom")
- subCraftId={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
- recipeList={
- 5,"wood planks",
- 17,0,0,
- 0,0,0,
- 0,0,0,
- 280,"sticks",
- 5,0,0,
- 5,0,0,
- 0,0,0,
- 54,"wooden chest",
- 5,5,5,
- 5,0,5,
- 5,5,5,
- 58,"crafting table",
- 5,5,0,
- 5,5,0,
- 0,0,0,
- 61,"furnace",
- 4,4,4,
- 4,0,4,
- 4,4,4,
- 102,"glass pane",
- 20,20,20,
- 20,20,20,
- 0,0,0,
- 257,"iron pickaxe",
- 265,265,265,
- 0,280,0,
- 0,280,0,
- 512,"mining well",
- 265,331,265,
- 265,4058,265,
- 265,257,265,
- 518,"tank",
- 20,20,20,
- 20,0,20,
- 20,20,20,
- 515,"pump",
- 518,0,0,
- 512,0,0,
- 0,0,0,
- 12249,"plastic sheets",
- 12250,12250,0,
- 12250,12250,0,
- 0,0,0,
- 1227,"turtle",
- 265,265,265,
- 265,1225,265,
- 265,54,265,
- 1225,"computer",
- 1,1,1,
- 1,331,1,
- 1,102,1,
- 12259,"factory machine block",
- 12249,12249,12249,
- 1,1,1,
- 0,0,0,
- 363579,"bio generator",
- 12249,12249,12249,
- 33,61,33,
- 369,12259,369,
- 4056,"wooden gear",
- 0,280,0,
- 280,0,280,
- 0,280,0,
- 4057,"stone gear",
- 0,4,0,
- 4,4056,4,
- 0,4,0,
- 4058,"iron gear",
- 0,265,0,
- 265,4057,265,
- 0,265,0,
- 4059,"golden gear",
- 0,266,0,
- 266,4058,265,
- 0,266,0,
- 4060,"diamond gear",
- 0,264,0,
- 264,4059,264,
- 0,264,0,
- 33,"piston",
- 5,5,5,
- 4,265,4,
- 4,331,4,
- 33274,"stirling engine",
- 4,4,4,
- 0,20,0,
- 4057,33,4057,
- 506,"redstone engine",
- 5,5,5,
- 0,20,0,
- 4056,33,4056,
- 30184,"copper wire isolated",
- 30216,30216,30216,
- 169107,169107,169107,
- 30216,30216,30216,
- 30191,"electronic circut",
- 30184,30184,30184,
- 331,30249,331,
- 30184,30184,30184,
- 30190,"advanced circuit",
- 331,348,331,
- 131423,30191,131423,
- 331,348,331,
- 33385,"iron furnace",
- 0,265,0,
- 265,0,265,
- 265,61,265,
- 30239,"battery",
- 0,30184,0,
- 30247,331,30247,
- 30247,331,30247,
- 617,"machine block",
- 30249,30249,30249,
- 30249,0,30249,
- 30249,30249,30249,
- 611,"generator",
- 30239,0,0,
- 617,0,0,
- 61,0,0,
- 356,"redstone repeater",
- 76,331,76,
- 1,1,1,
- 0,0,0,
- 76,"redstone torch",
- 331,0,0,
- 280,0,0,
- 0,0,0,
- 50,"torch",
- 263,0,0,
- 280,0,0,
- 0,0,0,
- 278,"diamond pickaxe",
- 264,264,264,
- 0,280,0,
- 0,280,0,
- 507,"filler",
- 351,511,351,
- 360799,58,360799,
- 4059,54,4059,
- 511,"place marker",
- 131423,0,0,
- 76,0,0,
- 0,0,0,
- 66153,"electric furnace",
- 0,30191,0,
- 331,33385,331,
- 0,0,0,
- 1200,"enderchest",
- 369,35,369,
- 49,54,49,
- 369,368,369,
- 380,"couldron",
- 265,0,265,
- 265,0,265,
- 265,265,265,
- 134218928,"ender tank",
- 369,35,369,
- 49,380,49,
- 369,368,369,
- 608,"bat box",
- 5,30184,5,
- 30239,30239,30239,
- 5,5,5,
- 882209,"energy crystal",
- 331,331,331,
- 331,5267,331,
- 331,331,331,
- 882177,"jetpack",
- 30249,30190,30249,
- 30249,608,30249,
- 348,0,348,
- 2850,"energy bridge",
- 266,331,266,
- 20,264,20,
- 266,331,266
- }
- function getItem(id,amount)
- gotItem=false
- x=0
- if s.list(side)~=nil then
- if s.list(side)[id]~=nil then
- if s.list(side)[id]>=amount then
- s.extract(side,id,1,amount)
- gotItem=true
- else
- if s.list(side)[id]>0 then
- amount=amount-s.list(side)[id]
- s.extract(side,id,1,s.list(side)[id])
- end
- end
- end
- end
- x=x+1
- end
- function craftItem(id,amount,craftId)
- recipe=1
- print(craftId)
- subCraftId[craftId]=id
- dumb()
- turtle.select(1)
- while recipeList[recipe]~=id and recipeList[recipe]~=nil do
- recipe=recipe+11
- end
- if recipeList[recipe]~=id then
- gotRecipe=false
- else
- gotRecipe=true
- craftProcess=0
- while craftProcess<9 do
- if recipeList[recipe+craftProcess+2]~=0 then
- getItem(recipeList[recipe+craftProcess+2],amount)
- end
- if gotItem==false and recipeList[recipe+craftProcess+2]~=0 and recipeList[recipe+craftProcess+1]~=nil then
- print("crafte "..recipeList[recipe+craftProcess+2])
- craftItem(recipeList[recipe+craftProcess+2],1,craftId+1)
- dumb()
- else
- turtle.select(1)
- i.dropUp(craftProcess,amount)
- craftProcess=craftProcess+1
- end
- end
- end
- if gotItem==true then
- c=peripheral.wrap("top")
- c.setPattern(0,1,2,3,4,5,6,7,8)
- amount2=amount
- while amount2>=0 do
- c.craft(17)
- amount2=amount2-1
- end
- turtle.suckUp()
- if craftId>=1 then
- print("craft ferig "..craftId)
- craftItem(subCraftId[craftId-1],1,craftId-1)
- end
- end
- return(craftId)
- end
- function dumb()
- x=1
- while x<=9 do
- turtle.suckUp()
- slotAmount=turtle.getItemCount(1)
- turtle.dropDown()
- s.sort(side,slotAmount)
- x=x+1
- end
- turtle.dropDown()
- s.sort(side,slotAmount)
- turtle.select(1)
- end
- --Terminal
- x=1
- y=0
- while true do
- x=0
- term.clear()
- while x<=13 do
- if x==1 then term.setCursorPos(1,1) term.write(">") end
- term.setCursorPos(2,x)
- term.write(recipeList[x*11+2+11*y])
- x=x+1
- end
- event, key, isHeld = os.pullEvent("key")
- if key==208 then y=y+1 end
- if key==200 then y=y-1 end
- if key==28 then
- craftItem(recipeList[1+11*(y+1)],1,1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement