Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local yes = 21
- local no = 49
- tArgs = {...}
- fileName = tArgs[1]
- pasteBinCode = tArgs[2]
- local x, y = term.getCursorPos()
- if (#tArgs == 2) then
- term.write("Are you sure you want to overwrite " .. fileName .. "? <y/n>")
- term.setCursorPos(1,(y+1))
- local event, key = os.pullEvent("key")
- while ((key ~= yes) and (key ~= no)) do
- local event, key = os.pullEvent("key")
- end
- if key == yes then
- shell.run("delete", fileName)
- shell.run("pastebin", "get", pasteBinCode, fileName)
- end
- else
- term.write("Usage: replace <File Name> <Pastebin Code>")
- term.setCursorPos(1,(y+1))
- end
Add Comment
Please, Sign In to add comment