Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local preMessages = {
- ["Unknown"] = "What?",
- ["TryRemember"] = "Ok, i'll try to remember that.",
- ["Nevermind"] = "What? Nevermind.",
- ["Ok"] = "Ok", --Everything above this aren't actual reponses.
- ["what type of music do you like?"] = "I am not programmed to like anything, but I can hate.",
- ["what do you hate?"] = "Everything.",
- ["who do you hate?"] = "Everyone.",
- ["why do you hate?"] = "I was programmed to hate.",
- ["who made you?"] = "ComputerCraftFan11, The founder of NeXuS Coperation",
- ["are you gay?"] = "I am neither gay or straight, I'm a robot.",
- ["are you straight?"] = "I am neither gay or straight, I'm a robot.",
- ["how old are you?"] = "There is no exact date when I was made.",
- ["your stupid"] = "I am still a young bot. You're*",
- ["you're stupid"] = "I am still a young bot.",
- }
- local agree = {
- ["yep"] = true,
- ["yes"] = true,
- ["yea"] = true,
- ["sure"] = true,
- ["ok"] = true,
- ["why not?"] = true,
- ["agree"] = true,
- ["y"] = true,
- ["uh huh"] = true,
- ["uh-huh"] = true,
- }
- local disagree = {
- ["no"] = true,
- ["nope"] = true,
- ["not"] = true,
- ["don't"] = true,
- ["never"] = true,
- ["don't"] = true,
- ["n"] = true,
- ["nuh uh"] = true,
- ["nuh-uh"] = true,
- }
- local disallow = {
- ["nevermind"] = true,
- ["nothing"] = true,
- }
- local greeting = {
- ["hi"] = true,
- ["hello"] = true,
- ["hey"] = true,
- ["what's up?"] = true,
- }
- local happy = {
- ["good"] = true,
- ["happy"] = true,
- ["normal"] = true,
- ["fine"] = true,
- ["wonderful"] = true,
- }
- local unhappy = {
- ["sad"] = true,
- ["bad"] = true,
- ["terrible"] = true,
- ["ugly"] = true,
- ["not good"] = true,
- ["angry"] = true,
- ["mad"] = true,
- }
- fs.makeDir(".words")
- local timesGreetings = 0;
- local prevMessage = "";
- local timesRepeated = 0;
- function getDict( input )
- if fs.exists(".words/"..input) then
- file = fs.open( ".words/"..input,"r")
- tContents = file.readAll()
- file.close()
- return tContents
- end
- end
- function addDict( input, result )
- if not fs.exists(".words/"..input) then
- file = fs.open( ".words/"..input, "w")
- file.write( result )
- file.close()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("GLaDOS v1.17a (c) 1982 Aperture Science, Inc.")
- print("Hello there.")
- while true do
- write("> ")
- input = read()
- if input ~= "" then
- if prevMessage == input then
- timesRepeated = timesRepeated+1
- else
- prevMessage = input
- timesRepeated = 0
- end
- tDictonary = getDict( input )
- if greeting[ string.lower(input) ] then
- if timesGreetings == 0 then
- print("We already said hello, didn't we?")
- elseif timesGreetings == 2 then
- print("It seems you are obsessed with greetings.")
- else
- print("Please stop repeating yourself. You have a fixation on greetings, it seems.")
- end
- timesGreetings = timesGreetings +1
- elseif timesRepeated == 1 then
- print(prevMessage.. " indeed. So what type of music do you like? ")
- write("> ")
- read()
- print("Nice. ")
- elseif timesRepeated > 2 or timesRepeated == 2 then
- print("Please stop repeating yourself. I can't say I know much about " ..prevMessage.. ". Do you know anything about it? Would you like to teach me? Please?")
- write("> ")
- input = read()
- if agree[ string.lower(input) ] then
- print("Fine. I'll create a new topic in my memory banks, called " ..prevMessage.. ". Please give me a short description of this topic.")
- write("> ")
- desc = read()
- addDict(prevMessage,desc)
- addDict("What is " ..prevMessage.. "?",desc)
- addDict("What is " ..prevMessage,desc)
- addDict("what is " ..prevMessage,desc)
- addDict("what is " ..prevMessage.. "?",desc)
- print("So, how are you doing?")
- write("> ")
- emotion = read()
- timesRepeated = 0
- prevMessage = "";
- if happy[ string.lower(emotion) ] then
- print("Me too. ")
- elseif unhappy[ string.lower(emotion) ] then
- print("Why? ")
- write("> ")
- read()
- print("Oh, I understand. ") --not really :3
- else
- print("What? Uhh nevermind.")
- end
- else
- print("Ok.")
- end
- elseif string.find( string.lower(input), "kill" ) and string.find( string.lower(input), "family" ) then
- print( "No." )
- elseif string.find( string.lower(input), "kill" ) and string.find( string.lower(input), "you" ) then
- print( "No." )
- elseif string.find( string.lower(input), "weather" ) then
- print( "I don't know, go outside and look for yourself." )
- elseif string.find( string.lower(input), "time" ) then
- print( "Time to get a watch." )
- elseif tDictonary then
- print( tDictonary )
- timesGreetings = 0
- elseif preMessages[ string.lower(input) ] then
- print( preMessages[ string.lower(input) ] )
- timesGreetings = 0
- elseif agree[ string.lower(input) ] or disagree[ string.lower(input) ] then
- print( "Ok. ")
- else
- print( preMessages["Unknown"] )
- write("> ")
- input2 = read()
- if input2 ~= "" then
- if disallow[ string.lower(input2) ] then
- print( preMessages["Ok"] )
- else
- print( "Want me to say '" ..input2.. "' when you say '" ..input.. "'?" )
- write("> ")
- input3 = string.lower(read())
- if string.lower(input) == string.lower(input2) and string.lower(input2) == input3 then
- print( "Please stop repeating yourself.")
- else
- if agree[input3] then
- print( preMessages["TryRemember"] )
- addDict(input, input2)
- elseif disagree[input3] then
- print( preMessages["Ok"] )
- else
- print( preMessages["Nevermind"] )
- end
- end
- end
- end
- timesGreetings = 0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment