Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ni=peripheral.wrap("back")
- if ni.listModules~=nil then --NeuralInterface Script
- --Modul Abfrage
- if ni.hasModule("plethora:kinetic")==false then print("please add kinetic module") end
- if ni.hasModule("plethora:introspection")==false then print("please add introspection module") end
- if peripheral.getType("front")~="modem" then print("please add modem on front side") end
- --CheckEffects
- function getEffects()
- effByID={}
- effects=ni.getMetaOwner().potionEffects
- for ie=1, #effects do
- effByID[effects[ie]]=true
- end
- end
- --connect
- rednet.open("front")
- while true do
- potionTimer=os.startTimer(1)
- resp={os.pullEvent()}--rednet Event Abfrage
- if resp[1]=="modem_message" then
- mes=resp[5].message
- if mes=="consume" then
- ni.getInventory().getItem(10).consume()
- ni.getInventory().pushItems("inventory",10,64,36)
- end
- end
- if resp[1]=="timer" then
- if ni.getInventory().getItem(10)==nil then
- redMes=""
- getEffects()
- if effByID["effect.moveSpeed"]==nil then redMes="effect.moveSpeed" end
- if effByID["effect.resistance"]==nil then redMes="effect.resistance" end
- if effByID["effect.damageBoost"]==nil then redMes="effect.damageBoost" end
- if effByID["effect.digSpeed"]==nil then redMes="effect.digSpeed" end
- if effByID["effect.luck"]==nil then redMes="effect.luck" end
- if effByID["effect.jump"]==nil then redMes="effect.jump" end
- if effByID["effect.absorption"]==nil then redMes="effect.absorption" end
- if effByID["effect.regeneration"]==nil then redMes="effect.regeneration" end
- if redMes~="" then rednet.broadcast(redMes) end
- elseif ni.getInventory().getItem(10).consume~=nil then
- ni.getInventory().getItem(10).consume()
- ni.getInventory().pushItems("inventory",10,64,36)
- end
- end
- end
- end
- --Computer
- if ni.listModules==nil then
- if peripheral.getType("right")~="appliedenergistics2:interface" then print("please add interface on right side") end
- if peripheral.getType("top")~="manipulator" then print("please add manipulator on left side") end
- if peripheral.getType("front")~="modem" then print("please add modem on back side") end
- --peripherals
- me=peripheral.wrap("right")
- inv=peripheral.wrap("top")
- rednet.open("back")
- --variables
- args={...}
- file=args[1]
- chestSide="south"
- delay=0.4
- --sort blocks from me to colors
- items=me.findItems(me.listAvailableItems()[1])
- id={}
- for i=1,#items do
- name=items[i].getMetadata().displayName
- if string.find(name,"Regeneration")~=nil then id["effect.regeneration"]=items[i] end
- if string.find(name,"Swiftness")~=nil then id["effect.moveSpeed"]=items[i] end
- if string.find(name,"resistance")~=nil then id["effect.resistance"]=items[i] end
- if string.find(name,"Strength")~=nil then id["effect.damageBoost"]=items[i] end
- if string.find(name,"haste")~=nil then id["effect.digSpeed"]=items[i] end
- if string.find(name,"Luck")~=nil then id["effect.luck"]=items[i] end
- if string.find(name,"Leaping")~=nil then id["effect.jump"]=items[i] end
- if string.find(name,"absorption")~=nil then id["effect.absorption"]=items[i] end
- end
- function pushPotion(item)
- item.export("up",1,1)
- inv.getInventory().pullItems(chestSide,1,1,10)
- end
- while true do
- resp={os.pullEvent("modem_message")}--rednet Event Abfrage
- mes=resp[5].message
- if string.find(mes,"effect") then
- pushPotion(id[mes])
- end
- rednet.broadcast("consume")
- sleep(delay)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement