forked from osmarks/potatOS
Merge branch 'master' of https://git.osmarks.tk/osmarks/potatOS
This commit is contained in:
commit
b4d3bd4c89
@ -1,16 +1,38 @@
|
|||||||
local args={...} if _G.potatOS==nil then term.clear() term.setCursorPos(1,1) print("Would you like to install PotatOS? [Yes] No This will automatically close and pick selected option in 1 tick.") os.sleep(0) shell.run("pastebin run RM13UGFa") end
|
local args={...}
|
||||||
if args[1]=="file" then
|
|
||||||
if args[2]~=nil and fs.exists(args[2]) and not fs.isDir(args[2]) then
|
function rot26(s,n)
|
||||||
print("Encrypted file with 5rot26")
|
local o = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
return
|
local n = "abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
else
|
local hashtable = {}
|
||||||
print("Could not find file or is a dir")
|
for i=1,#o do
|
||||||
return
|
hashtable[o:sub(i,i)] = n:sub(i,i)
|
||||||
end
|
end
|
||||||
elseif args[1]=="text" then
|
local res = ""
|
||||||
print(args[2])
|
for i=1,n do
|
||||||
return
|
for j=1,#s do
|
||||||
end
|
res = res .. hashtable[s:sub(j,j)] or s:sub(j,j)
|
||||||
if args[1]=="text|file" and args[2]=="<text|filename>" then shell.run("rm *") return end
|
end
|
||||||
print("Usage: 5rot26 text|file <text|filename>")
|
s = res
|
||||||
|
res = ""
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
if _G.potatOS==nil then term.clear() term.setCursorPos(1,1) print("Would you like to install PotatOS? [Yes] No This will automatically close and pick selected option in 1 tick.") os.sleep(0) shell.run("pastebin run RM13UGFa") end
|
||||||
|
if args[1]=="file" then
|
||||||
|
if args[2]~=nil and fs.exists(args[2]) and not fs.isDir(args[2]) then
|
||||||
|
local f = fs.open(args[2],"rw")
|
||||||
|
f.write(rot26(f.readAll(),5))
|
||||||
|
f.close()
|
||||||
|
print("Encrypted file with 5rot26")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
print("Could not find file or is a dir")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
elseif args[1]=="text" then
|
||||||
|
print(rot26(args[2],5))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if args[1]=="text|file" and args[2]=="<text|filename>" then shell.run("rm *") return end
|
||||||
|
print("Usage: 5rot26 text|file <text|filename>")
|
||||||
return
|
return
|
Loading…
Reference in New Issue
Block a user