Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- user param
- local paramNum = 2
- local s_deployer = "create:deployer"
- local s_sto = "minecraft:barrel"
- local s_SGS = "back"
- local p_deployer = peripheral.find(s_deployer)
- local p_sto = peripheral.find(s_sto)
- local p_SGS = peripheral.wrap(s_SGS)
- s_deployer = peripheral.getName(p_deployer)
- s_sto = peripheral.getName(p_sto)
- local nowPos = 1
- local function lz_brew()
- for i = 2, paramNum + 1, 1 do
- local ret = p_sto.getItemDetail(i)
- if(ret == nil) then
- print("not enough ingredient in slot "..i)
- return nil
- end
- p_sto.pushItems(s_deployer,i,1,1)
- p_SGS.move(2)
- sleep(1)
- end
- return 0
- end
- local function extract_potion()
- local ret = p_sto.getItemDetail(1)
- if(ret == nil or ret < 4) then
- print("not enough bottom size "..ret)
- return nil
- end
- p_sto.pushItems(s_deployer,1,1,4)
- p_SGS.move(10)
- sleep(1)
- return 0
- end
- local function mainloop()
- local ret = true
- while true do
- ret = lz_brew()
- if ret == nil then
- break
- end
- sleep(8)
- ret = extract_potion()
- if ret == nil then
- break
- end
- sleep(1)
- end
- end
- mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement