Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player="ecco7777"
- function getMessage()
- return string.lower(io.read())
- end
- function containsAll(message,str)
- i=1
- strings={}
- while string.find(str,";") do
- strings[i]=string.sub(str,1,string.find(str,";")-1)
- str=string.sub(str,string.find(str,";")+1)
- i=i+1
- end
- strings[i]=str
- bol=true
- for i=1,#strings do
- if string.find(message,strings[i])==nil then
- bol=false
- end
- end
- return bol
- end
- function containsAny(message,str)
- i=1
- strings={}
- while string.find(str,";") do
- strings[i]=string.sub(str,1,string.find(str,";")-1)
- str=string.sub(str,string.find(str,";")+1)
- i=i+1
- end
- strings[i]=str
- bol=false
- for i=1,#strings do
- if string.find(message,strings[i]) then
- bol=true
- end
- end
- return bol
- end
- function saveTab(file,tab)
- fp=fs.open(file,"w")
- fp.write(textutils.serialize(tab))
- fp.close()
- end
- function getTab(file)
- fp=fs.open(file,"r")
- return textutils.unserialize(fp.readAll())
- end
- if fs.exists(".mem")==false then
- mem={}
- saveTab(".mem",mem)
- end
- function say(string)
- print(string)
- end
- function playerAge()
- end
- function playerName()
- if mem[player]["name"]==nil then
- say("Möchtest du mir deinen RL Namen sagen "..player.." ? Ja/Nein")
- message=getMessage(player)
- if containsAny(message,"nein;nope;niemals;ne") then
- say("Ok dann nenn ich dich einfach "..player..". Oder soll ich dich anders nennen? Ja/Nein")
- message=getMessage(player)
- if containsAny(message,"nein;nope;niemals;ne") then
- say("Ok dann nenn ich dich einfach "..player)
- else
- say("Gut wie soll ich dich nennen?")
- message=getMessage(player)
- mem[player]["name"]=message
- saveTab(".mem",mem)
- end
- else
- say("Gut wie heißt du?")
- message=getMessage(player)
- mem[player]["nickName"]=message
- saveTab(".mem",mem)
- end
- else
- say("Du heißt "..mem[player]["name"])
- end
- end
- function playerPets()
- end
- function newPlayer()
- if mem[player]==nil then
- mem[player]={}
- say(player..", Ich weiß ja noch garnichts über dich O.O")
- end
- playerName()
- end
- newPlayer()
- --while true do
- --end
Add Comment
Please, Sign In to add comment