Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Computer Controlled Crafter by Southp0le
- --..with only few recipes.
- -----------
- --Options--
- -----------
- t = peripheral.wrap("right")
- -------------
- --Functions--
- -------------
- function get(slot)
- ID, amount = t.get(slot)
- if amount>0 then
- if ID>32768 then
- ID=ID%32768
- end
- end
- return ID,amount
- end
- function pulser()
- redstone.setOutput("back",true)
- sleep(0.3)
- redstone.setOutput("back",false)
- sleep(0.3)
- end
- function craft()
- for a=0, 17,1 do
- bolean = false
- while t.craft(a) do
- t.craft(a)
- bolean = true
- end
- if bolean==true then break end
- end
- end
- ---------
- --Cycle--
- ---------
- while true do
- sleep(5)
- for slot=0,17,1 do
- get(slot)
- if amount>0 then
- if ID==12 or ID==21260 or ID==287 or ID==26350 or ID==1 then
- --xx.
- --xx.
- --...
- t.setPattern(slot,slot,nil,slot,slot,nil,nil,nil,nil)
- craft()
- elseif ID==26347 then
- --.x.
- --x.x
- --.x.
- t.setPattern(nil,slot,nil,slot,nil,slot,nil,slot,nil)
- craft()
- elseif ID==25286 then
- --xxx
- --xxx
- --xxx
- t.setPattern(slot,slot,slot,slot,slot,slot,slot,slot,slot)
- craft()
- elseif ID==13401 then
- --x.x
- --.x.
- --x.x
- t.setPattern(slot,nil,slot,nil,slot,nil,slot,nil,slot)
- craft()
- elseif ID==98 then
- --..x
- --.xx
- --xxx
- t.setPattern(nil,nil,slot,nil,slot,slot,slot,slot,slot)
- craft()
- elseif ID==296 then
- --xxx
- --...
- --...
- t.setPattern(slot,slot,slot,nil,nil,nil,nil,nil,nil)
- craft()
- elseif ID==37 or ID==38 or ID==1307 then
- ---x..
- --...
- --...
- t.setPattern(slot,nil,nil,nil,nil,nil,nil,nil,nil)
- craft()
- else
- print("Error: unknown item for crafting")
- print("Cleaning-Process startet..")
- for i=0,slot+1,1 do
- pulser()
- end
- end
- pulser()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment