Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- if #tArgs < 2 then
- error("Usage: en <1/2> <path>")
- end
- if tArgs[1] == "1" then
- local newt = ""
- local rd = fs.open(tArgs[2], "r")
- local txt = rd.readAll()
- rd.close()
- for i = 1, #txt do
- newt = newt..string.char(string.byte(string.sub(txt, i, i))+1)
- end
- local fl = fs.open(tArgs[2], "w")
- fl.write(newt)
- fl.close()
- elseif tArgs[1] == "2" then
- local newt = ""
- local rd = fs.open(tArgs[2], "r")
- local txt = rd.readAll()
- rd.close()
- for i = 1, #txt do
- newt = newt..string.char(string.byte(string.sub(txt, i, i))-1)
- end
- local fl = fs.open(tArgs[2], "w")
- fl.write(newt)
- fl.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement