Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readFile(path)
- file = fs.open(path,"r")
- i = file.readAll()
- file.close()
- return i
- end
- function writeInFile(name,contents)
- file = fs.open(name,"w")
- file.write(contents)
- file.close()
- end
- function load()
- print(readFile("disk/file"))
- end
- function save(i)
- writeInFile("disk/file",i)
- end
- function loadDisk()
- rs.setOutput("top",true)
- sleep(.5)
- end
- function unloadDisk()
- rs.setOutput("top",false)
- rs.setOutput("back",true)
- sleep(.5)
- rs.setOutput("back",false)
- end
- while true do
- loadDisk()
- print(load())
- unloadDisk()
- sleep(2)
- end
- while true do
- i = read()
- loadDisk()
- save(i)
- unloadDisk()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement