Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function del()
- term.clear()
- term.setCursorPos(1,1)
- print("Type 'clear' to remove all notes.")
- print("Type 'edit' to edit notes")
- print("Type 'exit' to return to notes.")
- com = read()
- delnavigate()
- end
- function delnavigate()
- if com == "clear" then
- fs.delete("myNotes/notes")
- elseif com == "edit" then
- print("")
- print("We are working on a assisted deleting system")
- print("however it is not availible at the time you are")
- print("using this. To remove notes click the screen,")
- print("type into the console 'cd myNotes' and then")
- print("'edit notes' There will be a list of your")
- print("notes which you can edit.")
- os.pullEvent("mouse_click")
- elseif com == "exit" then
- ask()
- else
- print("Unknown Input")
- print("Rebooting Delete Notes.")
- del()
- end
- end
- function comR()
- com = read()
- navigate()
- end
- function ask()
- term.clear()
- term.setCursorPos(1,1)
- print("Type 'add' to add a note.")
- print("Type 'view' to view notes.")
- print("Type 'delete' to delete notes.")
- print("Type 'exit' to exit the program")
- comR()
- end
- function navigate()
- if com == "exit" then
- os.reboot()
- elseif com == "add" then
- add()
- elseif com == "view" then
- view()
- elseif com == "delete" then
- del()
- else
- print("Unknown input")
- sleep(2)
- ask()
- end
- end
- function add()
- local note = fs.open("myNotes/notes", "w")
- if not fs.isDir("myNotes") then fs.makeDir("myNotes") end
- print("Type your note.")
- print("Or type 'exit' to reboot notes")
- input = read()
- if input == "exit" then
- ask()
- else
- note.writeLine("input")
- ask()
- note.close()
- end
- end
- function view()
- handle = fs.open("myNotes/notes", "r")
- lines = handle.readLine()
- for lines in handle.readLine do
- print("")
- print("notes:")
- print(lines)
- print("Please Re-Type Command To Continue")
- end
- handle.close()
- comR()
- end
- ask()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement