Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handle = fs.open("recipes", "r")
- output = handle.readAll()
- if output == "test" then
- dest = {}
- else
- dest = textutils.unserialize(output)
- end
- handle.close()
- currtable = {}
- term.clear()
- term.setCursorPos(1,1)
- term.write("Name of output: ")
- crafted = read()
- term.setCursorPos(1,2)
- term.write("Type of output: ")
- craftedtype = read()
- table.insert(currtable, { name = crafted , type = craftedtype})
- for i = 1,9 do
- term.clear()
- term.setCursorPos(1,1)
- term.write("Name of component in slot "..i..":")
- component = read()
- term.clear()
- term.setCursorPos(1,1)
- term.write("Type of component in slot"..i..":")
- comptype = read()
- table.insert(currtable, {name = component, type = comptype})
- end
- table.insert(dest, currtable)
- handle = fs.open("recipes", "w")
- handle.write(textutils.serialize(dest))
- handle.close()
- shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement