Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function new_session(id)
- local souhlaska = function()
- local all = {"b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","w","x","b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","w","x","č","ř","š","ž"}
- return all[math.random(#all)]
- end
- local samohlaska = function()
- local all = {"a","e","i","o","u","y","a","e","i","o","u","y","a","e","i","o","u","y","á","é","í","ó","ů","ý"}
- return all[math.random(#all)]
- end
- assert(id)
- local res = {id = id, chat_lines = persistent.recent_lines(), connections={}}
- local ltrs = {}
- if math.random()>0.5 then
- table.insert(ltrs,souhlaska())
- end
- if math.random()>0.8 then
- table.insert(ltrs,samohlaska())
- table.insert(ltrs,souhlaska())
- if math.random()<0.2 then
- table.insert(ltrs,souhlaska())
- end
- end
- table.insert(ltrs,samohlaska())
- table.insert(ltrs,souhlaska())
- if math.random()<0.2 then
- table.insert(ltrs,souhlaska())
- end
- table.insert(ltrs,samohlaska())
- table.insert(ltrs, "nym")
- ltrs[1] = ({["č"] = "Č", ["ř"] = "Ř", ["š"] = "Š", ["ž"] = "Ž", ["á"] = "Á", ["é"] = "É", ["í"] = "Í", ["ó"] = "Ó", ["ů"] = "Ú", ["ý"] = "Ý"})[ltrs[1]] or ltrs[1]:upper()
- res.name = table.concat(ltrs)
- private_message(res,"Teď jsi anonym jménem <b>"..res.name.."</b>. Chatuj nebo napiš otazník...")
- return res
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement