Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = peripheral.wrap("front")
- t = peripheral.wrap("top")
- serum = {}
- function writeFile()
- handle = fs.open("serums", "w")
- handle.write(textutils.serialize(serum))
- handle.close()
- end
- function loadFile()
- handle = fs.open("serums", "r")
- serum = textutils.unserialize(handle.readLine())
- handle.close()
- end
- function furnace()
- r.push("east", 0, 1)
- end
- function store()
- r.push("up", 0, 1)
- end
- function checkSerum(serumName)
- for i = 1, #serum do
- if currSerum.name == serum[i] then
- return "match"
- end
- end
- end
- function moveSerum()
- r.condense()
- if r.getStackInSlot(0) then
- currSerum = r.getStackInSlot(0)
- if checkSerum(currSerum.name) == "match" then
- --print("furnace")
- furnace()
- else
- print("####################################")
- print(currSerum.name)
- store()
- table.insert(serum, currSerum.name)
- writeFile()
- sendFile()
- end
- end
- end
- function sendID()
- rednet.open("right")
- event, sid, mes, dis = os.pullEvent("rednet_message")
- if mes == "id2" then
- rednet.broadcast("id2")
- screen = sid
- print(smelter)
- end
- end
- function sendFile()
- rednet.send(screen, textutils.serialize(serum))
- end
- --------------
- sendID()
- loadFile()
- sendFile()
- print("starting")
- while true do
- moveSerum()
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement