Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Config Bereich
- local drain = "right" -- Position der Smelterydrain
- local red = "back" -- Redstone fuer fluessigkeiten steuerung
- -- Config ende
- local chest = peripheral.wrap("front")
- local tank = peripheral.wrap(drain)
- local tankinfo = tank.getTankInfo("unknown")
- local xp = 0
- local draconium = 0
- local draconiumLiq = 0
- local mana = 0
- function saveData()
- for index,v in pairs(tankinfo) do
- if tankinfo[index].contents then
- for k,v in pairs(tankinfo[index].contents) do
- if k == "name" and v == "mana" then
- mana = tankinfo[index].contents.amount
- print("mana: " .. mana)
- end
- if k=="id" then
- print("liquid: "..v)
- if v==202 then
- xp = tankinfo[index].contents.amount
- print("XP: " .. xp)
- end
- if k == "id" and v == 215 then
- draconiumLiq = tankinfo[index].contents.amount
- end
- end
- end
- end
- end
- end
- function saveDraconiumCount()
- draconium =0
- for k,stack in pairs(chest.getAllStacks(false)) do
- if stack then
- for k , v in pairs(stack) do if k == "ore_dict"and v then
- draconium = draconium + stack.qty
- end
- end
- end
- end
- saveData()
- draconium = draconium + (draconiumLiq /144)
- end
- saveDraconiumCount()
- while true do
- redstone.setOutput("back", false)
- print("600 < " .. mana)
- while mana > 288 do
- redstone.setOutput("left", true)
- sleep(0.5)
- redstone.setOutput("left", false)
- sleep(1)
- saveDraconiumCount()
- saveData()
- print("600 < " .. mana)
- end
- for i=1, 16 do
- saveDraconiumCount()
- while draconium >= 2 and xp < (draconium * 500) do
- redstone.setOutput(red, true)
- sleep(1)
- redstone.setOutput(red, false)
- saveData()
- saveDraconiumCount()
- end
- local data = turtle.getItemDetail(i)
- if data then
- if data.count > 0 then
- turtle.select(i)
- turtle.drop(2)
- end
- end
- end
- print("schlafen")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement