Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tape = peripheral.find("tape_drive")
- d = false
- run = false
- t = 0
- if tape then
- function wipe(s)
- for i=1,500000 do
- if t < s then
- term.setCursorPos(1,5)
- term.write(t.."/"..s)
- else
- term.setCursorPos(1,5)
- term.write(s.."/"..s)
- term.setCursorPos(1,6)
- term.write("Wrapping up..."..t)
- end
- tape.write(0)
- t = t + 1
- end
- end
- if tape.isReady() then
- run = true
- else
- print("Please insert a tape to use this program.")
- end
- else
- print("This program requires a tape drive to function.")
- end
- if run then
- size = tape.getSize()
- term.clear()
- term.setCursorPos(1,1)
- term.write("Are you sure you want to format this tape?(Y,N)")
- print("(this might take a while)")
- term.setCursorPos(1,3)
- input = read()
- if input == ("y") or input == ("yes") or input == ("Y") or input == ("Yes") then
- tape.seek(-size)
- tape.seek(-8000)
- term.setCursorPos(1,4)
- term.write("Phase 1:")
- wipe(size)
- sleep(.5)
- if t < size then
- term.setCursorPos(1,4)
- term.write("Phase 2:")
- wipe(size)
- end
- tape.seek(-size)
- tape.seek(-8000)
- d = true
- else
- print("Aborted.")
- end
- end
- if d then
- term.setCursorPos(1,7)
- term.write("Done!")
- term.setCursorPos(1,8)
- end
Add Comment
Please, Sign In to add comment