Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arg = { ... }
- name = shell.getRunningProgram()
- dir = shell.dir()
- text = ""
- rand = 0
- fin = 0
- let = ""
- select = 0
- function letter()
- rand = math.random(1, 5)
- if rand == 1 then
- let = "a"
- elseif rand == 2 then
- let = "b"
- elseif rand == 3 then
- let = "c"
- elseif rand == 4 then
- let = "d"
- elseif rand == 5 then
- let = "e"
- end
- end
- function finger()
- fin = math.random(0, 9)
- end
- function testKey()
- if fs.exists(dir.."/key") then
- fs.delete(dir.."/key")
- end
- end
- function select()
- if arg[1] == nil then
- print("Use 8 for randomizer.")
- arg[1] = 8
- end
- for i = 1, arg[1] do
- select = math.random(1, 2)
- if select == 1 then
- letter()
- text = text .. let
- elseif select == 2 then
- finger()
- text = text .. tostring(fin)
- end
- end
- print(text)
- end
- select()
- testKey()
- h = fs.open(dir.."/key", "w")
- h.writeLine(text)
- h.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement