Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local AltarSide = "back"
- local InputChestSide = "left"
- local OutputChestSide = "west"
- local VoronkaSide="south"
- local altar = peripheral.wrap(AltarSide)
- local chest = peripheral.wrap(InputChestSide)
- local mas={0,0}
- local tank = altar.getTankInfo()
- local lp = tank[1]['contents']['amount']
- local Craft = {
- -- Slate 1 lvl
- {input="Thaumcraft:blockCosmeticSolid",
- output="AWWayofTime:blankSlate", Blood=1000},
- -- Slate 2 lvl
- {input="AWWayofTime:blankSlate",
- output="AWWayofTime:reinforcedSlate", Blood=2000},
- -- Slate 3 lvl
- {input="AWWayofTime:reinforcedSlate",
- output="AWWayofTime:imbuedSlate", Blood=5000},
- -- Slate 4 lvl
- {input="AWWayofTime:imbuedSlate",
- output="AWWayofTime:demonicSlate", Blood=15000},
- -- Slate 5 lvl
- {input="AWWayofTime:demonicSlate",
- output="AWWayofTime:bloodMagicBaseItems", Blood=30000}
- --
- }
- function CheckChestItem()
- while true do
- for i=1, chest.getInventorySize() do
- if chest.getStackInSlot(i)~=nil then
- for j=1, 5 do
- if chest.getStackInSlot(i).id==Craft[j].input then
- mas={i,j}
- print("1"..mas[2])
- return mas
- end end end end
- end
- end
- function CheckCraft(j)
- while true do
- if altar.getStackInSlot(1)~=nil then
- if altar.getStackInSlot(1).id==Craft[j].output then
- altar.pushItem(OutputChestSide, 1)
- craft="false"
- save_config(craft,mas[2])
- break
- end
- end
- sleep(0.2)
- end
- end
- function CheckChest(i,j)
- while true do
- local tank = altar.getTankInfo()
- local lp = tank[1]['contents']['amount']
- if lp>=Craft[j].Blood then
- chest.pushItem(VoronkaSide, i, 1)
- craft="true"
- save_config(craft,mas[2])
- break
- end
- end
- sleep(0.1)
- end
- function save_config(craft,j)
- sw = fs.open("config.txt", "w")
- sw.writeLine(craft)
- sw.writeLine(j)
- sw.close()
- end
- if fs.exists("config.txt") == false then
- save_config("false",0)
- else
- sr = fs.open("config.txt", "r")
- craft = sr.readLine()
- mas[2]=tonumber(sr.readLine())
- sr.close()
- end
- while true do
- if craft=="false" then
- mas=CheckChestItem()
- if mas[2]~=0 then
- CheckChest(mas[1],mas[2])
- end
- end
- CheckCraft(mas[2])
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement