[Addon] Kiddo: Whisper auto-reply addon with simple semantic analysis menu

User Tag List

Results 1 to 7 of 7
  1. #1
    kixer's Avatar Master Sergeant
    Reputation
    34
    Join Date
    May 2010
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Addon] Kiddo: Whisper auto-reply addon with simple semantic analysis

    Disclaimer:
    1) I have put this thread to Programs and bots forum first. But then I've stumbled upon this forum, so I have moved it myself (delete&repost).
    2) This addon does not coply to Blizzard's EULA. Use with caution, on your own risk.

    Long story short: While learning lua, I've created this simple addon that auto-replies to whisper messages. It is based on the Eliza chat bot. Eliza works like a psychoterapist. It tries to analyze what you type (e.g. I had a dream) and based on set of rules it will reply you something like "What does that dream suggest to you?"

    I've changed the set of rules ('script' - you can find the original on the linked page) to behave like a kid playing WoW. It's not perfect and the script should be changed for anyone who would like to use it anyway. The auto-replies will be only as good as you design them.

    If you are familiar with lua, changing the script itself will be easy (again, see the linked page for the description of the rules in the script). The script is included as multiline string in Kiddo.lua

    The addon starts disabled and it knows two commands:

    /kiddo on
    /kiddo off

    The programming is not nice, it's quick and dirty. If anyone wants to help, we can agree on that whatever you change in the code itself, just publish here and you can freely use it for whatever purpose you want.

    TODO:

    1) the script contains some synonyms that don't work as intended (see todo in the code, '@words')
    2) the addon uses onUpdate event to schedule chat replies. I've put a delay between whisper receive and whisper reply. But I have little idea how this work, I just copied something from some wow forum. When you see the lua, it will be clear to you
    3) tidy the code - as I did not know how lua works, I just started coding, so the code really needs some work E.g. I've used my own trim function, but lua in WoW has some library to do it...
    4) better script - English is not my mother tongue. I am unable to correctly analyze what would typical botter-spotter question look like in terms of the script.

    Addon: kiddo.zip - this is some free file sharing site, please advice on something better. I know I should add the virus scan link, but the file itself si behind captcha, so I can't perform in situ scan.

    You can test it by sending a whisper to yourself, but it will soon end up in why-what loop. I think with a correct script, 1-2 whisper replies should look very real.
    Last edited by kixer; 10-26-2010 at 12:35 AM. Reason: disclaimer

    These ads disappear when you log in.

  2. #2
    hp94's Avatar Legendary
    Reputation
    742
    Join Date
    Nov 2009
    Posts
    586
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd actually like to see how this works, I'll check into it tonight.

    It also looks like something neat, so I'll throw some +rep in too.

  3. #3
    FlorenceBoles's Avatar Member
    Reputation
    1
    Join Date
    Mar 2021
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A world of the war carat is fit for the terms for the citizens. Paths of the fund and Essay Services Reviews Club for the signatures for the team. Operation is hit for the liquidation for the turns for humans.

  4. #4
    AdamWalsh's Avatar Member
    Reputation
    1
    Join Date
    May 2021
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting thoughts, thanks. I want to add that WoWChatBot will save you from the mechanical repetition of the same words to different people over and over again. For example, if you are a sorcerer, a request from your clients always contains a specific formula name: "Crusader" / "spell power" etc. With some simple rules in WoWChatBot, a price (configured as a reply message) will be sent to your client automatically when you will get the formula name (configured as a keyword) The user can choose to reply to the message sent from whisper / party / raid. A response message will be sent by the plugin if it matches the configuration rules. One rule is divided into several tokens by a delimeter. The first token is the reply message to be sent. Other tokens are keywords that can trigger this rule. When a message containing one of the keywords is received, a response message will be sent. I learned this information from YouTube videos in which the authors share tips on setting up WoWChatBot, there you can find a couple of hundred videos on this topic and I noticed that in most cases they are published by accounts that have more than 47 thousand subscribers! I am sure that in order to achieve such indicators, the owners of these channels used the services of viplikes.net to quickly increase their number.

  5. #5
    fonillius's Avatar Active Member WINNER OF THE BEST BOT DEVELOPER COMPETITION
    CoreCoins Purchaser Authenticator enabled
    Reputation
    48
    Join Date
    May 2007
    Posts
    249
    Thanks G/R
    5/31
    Trade Feedback
    4 (75%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kixer View Post
    Disclaimer:
    1) I have put this thread to Programs and bots forum first. But then I've stumbled upon this forum, so I have moved it myself (delete&repost).
    2) This addon does not coply to Blizzard's EULA. Use with caution, on your own risk.

    Long story short: While learning lua, I've created this simple addon that auto-replies to whisper messages. It is based on the Eliza chat bot. Eliza works like a psychoterapist. It tries to analyze what you type (e.g. I had a dream) and based on set of rules it will reply you something like "What does that dream suggest to you?"

    I've changed the set of rules ('script' - you can find the original on the linked page) to behave like a kid playing WoW. It's not perfect and the script should be changed for anyone who would like to use it anyway. The auto-replies will be only as good as you design them.

    If you are familiar with lua, changing the script itself will be easy (again, see the linked page for the description of the rules in the script). The script is included as multiline string in Kiddo.lua

    The addon starts disabled and it knows two commands:

    /kiddo on
    /kiddo off

    The programming is not nice, it's quick and dirty. If anyone wants to help, we can agree on that whatever you change in the code itself, just publish here and you can freely use it for whatever purpose you want.

    TODO:

    1) the script contains some synonyms that don't work as intended (see todo in the code, '@words')
    2) the addon uses onUpdate event to schedule chat replies. I've put a delay between whisper receive and whisper reply. But I have little idea how this work, I just copied something from some wow forum. When you see the lua, it will be clear to you
    3) tidy the code - as I did not know how lua works, I just started coding, so the code really needs some work E.g. I've used my own trim function, but lua in WoW has some library to do it...
    4) better script - English is not my mother tongue. I am unable to correctly analyze what would typical botter-spotter question look like in terms of the script.

    Addon: kiddo.zip - this is some free file sharing site, please advice on something better. I know I should add the virus scan link, but the file itself si behind captcha, so I can't perform in situ scan.

    You can test it by sending a whisper to yourself, but it will soon end up in why-what loop. I think with a correct script, 1-2 whisper replies should look very real.





    You can write the source code here into
    Code:
    code block
    Or you can go in Ownedcore "Go advanced" while posting, scroll down, add to attachments, upload from your computer the .zip file, and done.

    Thanks!

    PS.
    I found interesting LUA code written about eliza already, maybe this helps you too


    lua-users wiki: Scite Eliza Classic
    Code:
    ------------------------------------------------------------------------
    -- Joseph Weizenbaum's classic Eliza ported to SciTE Version 2
    -- Kein-Hong Man <[email protected]> 20060905
    -- This program is hereby placed into PUBLIC DOMAIN
    ------------------------------------------------------------------------
    -- HOW TO USE
    -- * This program is for recreational purposes only. :-)
    -- * ClassicEliza function will open a new buffer, then type away...
    -- * Eliza recognizes one line of input only (if you are typing very
    --   long lines, please consider seeing a real person.)
    -- * Eliza will not interfere with other buffers or handlers, and is
    --   compatible with extman.
    ------------------------------------------------------------------------
    -- Original ELIZA paper:
    --   ELIZA--A Computer Program For the Study of Natural Language
    --   Communication Between Man and Machine,
    --   Joseph Weizenbaum, 1966, Communications of the ACM Volume 9,
    --   Number 1 (January 1966): 36-35.
    --   URL: http://i5.nyu.edu/~mm64/x52.9265/january1966.html
    ------------------------------------------------------------------------
    -- A copy of the original BASIC source of this Lua version of ELIZA can
    -- be found at Josep Subirana's ELIZA download page.
    ------------------------------------------------------------------------
    -- NOTES
    -- * Modifications made to fit the program into SciTE...
    -- * For historical accuracy, functionality is more-or-less identical,
    --   as is the use of an all upper-case alphabet for output.
    -- * There is really no point extending this program. Many other more
    --   advanced Eliza-type programs exist. Good candidates for porting are
    --   EMACS' doctor.el and Perl's Chatbot-Eliza.
    -- * One difference is keyword are matched by iterating through a hash
    --   array, so matching order will be different from initialization order.
    -- * In order to avoid keeping any internal state, this Eliza does not
    --   remember your name.
    -- * Input is now case-insensitive.
    -- * The original used backticks for apostrophes, this was fixed.
    -- * A couple of spelling mistakes in strings and comments fixed.
    ------------------------------------------------------------------------
    
    ------------------------------------------------------------------------
    -- constants and primitives
    ------------------------------------------------------------------------
    local SIG = "SciTE_ClassicEliza"
    
    ------------------------------------------------------------------------
    -- simple check for extman, partially emulate if okay to do so
    ------------------------------------------------------------------------
    if OnChar and not scite_Command then
      Error("There is an OnChar conflict, please use extman")
    elseif not scite_OnChar then
      -- simple way to add a handler only, can't remove like extman does
      local _OnChar
      scite_OnChar = function(f) _OnChar = f end
      OnChar = function(c) if _OnChar then return _OnChar(c) end end
    end
    
    ------------------------------------------------------------------------
    -- Eliza main routine, processes user input
    -- * Input is case insensitive. No punctuation except apostrophes,
    --   as in: don't you're i'm i've you've.
    ------------------------------------------------------------------------
    local function Eliza(text)
      local response = ""
      local user = string.upper(text)
      local userOrig = user
    
      -- randomly selected replies if no keywords
      local randReplies = {
        "WHAT DOES THAT SUGGEST TO YOU?",
        "I SEE...",
        "I'M NOT SURE I UNDERSTAND YOU FULLY.",
        "CAN YOU ELABORATE ON THAT?",
        "THAT IS QUITE INTERESTING!",
        "THAT'S SO... PLEASE CONTINUE...",
        "I UNDERSTAND...",
        "WELL, WELL... DO GO ON",
        "WHY ARE YOU SAYING THAT?",
        "PLEASE EXPLAIN THE BACKGROUND TO THAT REMARK...",
        "COULD YOU SAY THAT AGAIN, IN A DIFFERENT WAY?",
      }
    
      -- keywords, replies
      local replies = {
        [" CAN YOU"] = "PERHAPS YOU WOULD LIKE TO BE ABLE TO",
        [" DO YOU"] = "YES, I",
        [" CAN I"] = "PERHAPS YOU DON'T WANT TO BE ABLE TO",
        [" YOU ARE"] = "WHAT MAKES YOU THINK I AM",
        [" YOU'RE"] = "WHAT IS YOUR REACTION TO ME BEING",
        [" I DON'T"] = "WHY DON'T YOU",
        [" I FEEL"] = "TELL ME MORE ABOUT FEELING",
        [" WHY DON'T YOU"] = "WHY WOULD YOU WANT ME TO",
        [" WHY CAN'T I"] = "WHAT MAKES YOU THINK YOU SHOULD BE ABLE TO",
        [" ARE YOU"] = "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM",
        [" I CAN'T"] = "HOW DO YOU KNOW YOU CAN'T",
        [" SEX"] = "I FEEL YOU SHOULD DISCUSS THIS WITH A HUMAN.",
        [" I AM"] = "HOW LONG HAVE YOU BEEN",
        [" I'M"] = "WHY ARE YOU TELLING ME YOU'RE",
        [" I WANT"] = "WHY DO YOU WANT",
        [" WHAT"] = "WHAT DO YOU THINK?",
        [" HOW"] = "WHAT ANSWER WOULD PLEASE YOU THE MOST?",
        [" WHO"] = "HOW OFTEN DO YOU THINK OF SUCH QUESTIONS?",
        [" WHERE"] = "WHY DID YOU THINK OF THAT?",
        [" WHEN"] = "WHAT WOULD YOUR BEST FRIEND SAY TO THAT QUESTION?",
        [" WHY"] = "WHAT IS IT THAT YOU REALLY WANT TO KNOW?",
        [" PERHAPS"] = "YOU'RE NOT VERY FIRM ON THAT!",
        [" DRINK"] = "MODERATION IN ALL THINGS SHOULD BE THE RULE.",
        [" SORRY"] = "WHY ARE YOU APOLOGIZING?",
        [" DREAMS"] = "WHY DID YOU BRING UP THE SUBJECT OF DREAMS?",
        [" I LIKE"] = "IS IT GOOD THAT YOU LIKE",
        [" MAYBE"] = "AREN'T YOU BEING A BIT TENTATIVE?",
        [" NO"] = "WHY ARE YOU BEING NEGATIVE?",
        [" YOUR"] = "WHY ARE YOU CONCERNED ABOUT MY",
        [" ALWAYS"] = "CAN YOU THINK OF A SPECIFIC EXAMPLE?",
        [" THINK"] = "DO YOU DOUBT",
        [" YES"] = "YOU SEEM QUITE CERTAIN. WHY IS THIS SO?",
        [" FRIEND"] = "WHY DO YOU BRING UP THE SUBJECT OF FRIENDS?",
        [" COMPUTER"] = "WHY DO YOU MENTION COMPUTERS?",
        [" AM I"] = "YOU ARE",
      }
    
      -- conjugate
      local conjugate = {
        [" I "] = "YOU",
        [" ARE "] = "AM",
        [" WERE "] = "WAS",
        [" YOU "] = "ME",
        [" YOUR "] = "MY",
        [" I'VE "] = "YOU'VE",
        [" I'M "] = "YOU'RE",
        [" ME "] = "YOU",
        [" AM I "] = "YOU ARE",
        [" AM "] = "ARE",
      }
    
      -- random replies, no keyword
      local function replyRandomly()
        response = randReplies[math.random(table.getn(randReplies))].."\n"
      end
    
      -- find keyword, phrase
      local function processInput()
        for keyword, reply in pairs(replies) do
          local d, e = string.find(user, keyword, 1, 1)
          if d then
            -- process keywords
            response = response..reply.." "
            if string.byte(string.sub(reply, -1)) < 65 then -- "A"
              response = response.."\n"; return
            end
            local h = string.len(user) - (d + string.len(keyword))
            if h > 0 then
              user = string.sub(user, -h)
            end
            for cFrom, cTo in pairs(conjugate) do
              local f, g = string.find(user, cFrom, 1, 1)
              if f then
                local j = string.sub(user, 1, f - 1).." "..cTo
                local z = string.len(user) - (f - 1) - string.len(cTo)
                response = response..j.."\n"
                if z > 2 then
                  local l = string.sub(user, -(z - 2))
                  if not string.find(userOrig, l) then return end
                end
                if z > 2 then response = response..string.sub(user, -(z - 2)).."\n" end
                if z < 2 then response = response.."\n" end
                return
              end--if f
            end--for
            response = response..user.."\n"
            return
          end--if d
        end--for
        replyRandomly()
        return
      end
    
      -- main()
      -- accept user input
      if string.sub(user, 1, 3) == "BYE" then
        response = "BYE, BYE FOR NOW.\nSEE YOU AGAIN SOME TIME.\n"
        return response
      end
      if string.sub(user, 1, 7) == "BECAUSE" then
        user = string.sub(user, 8)
      end
      user = " "..user.." "
      -- process input, print reply
      processInput()
      response = response.."\n"
      return response
    end
    
    ------------------------------------------------------------------------
    -- OnChar handler, grabs a single line of input only upon [Enter]
    ------------------------------------------------------------------------
    local function ElizaHandler(c)
      if not buffer[SIG] then return end    -- verify buffer signature
      if c == "\n" then                     -- user typed [Enter]
        local lnUser = editor:LineFromPosition(editor.CurrentPos) - 1
        if lnUser < 0 then return end
        -- grab line without ending newlines
        local lbeg = editor:PositionFromLine(lnUser)
        local lend = editor.LineEndPosition[lnUser]
        local text = editor:textrange(lbeg, lend)
        -- perform Eliza text processing
        if text ~= "" then
          editor:AddText(Eliza(text))
        end
      end
      return true
    end
    
    ------------------------------------------------------------------------
    -- script initialization (opens a new buffer and set up handlers)
    ------------------------------------------------------------------------
    function ClassicEliza()
      scite_OnChar(ElizaHandler)
      scite.Open("")
      buffer[SIG] = true;
      editor:AddText([[
    WELCOME TO ANOTHER SESSION WITH
    YOUR COMPUTER PSYCHIATRIST, ELIZA
    
    IT SURE IS NEAT TO HAVE YOU DROP BY
    
    ]])
      editor:DocumentEnd()
      math.randomseed(os.time())
    end
    
    -- end of script

    TAKE CARE!
    Last edited by fonillius; 3 Weeks Ago at 10:34 PM.
    -fonillius

  6. #6
    jimmys96's Avatar Legendary
    Reputation
    725
    Join Date
    Aug 2008
    Posts
    1,151
    Thanks G/R
    209/203
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by fonillius View Post






    You can write the source code here into
    Code:
    code block
    Or you can go in Ownedcore "Go advanced" while posting, scroll down, add to attachments, upload from your computer the .zip file, and done.

    Thanks!

    PS.
    I found interesting LUA code written about eliza already, maybe this helps you too


    lua-users wiki: Scite Eliza Classic
    Code:
    ------------------------------------------------------------------------
    -- Joseph Weizenbaum's classic Eliza ported to SciTE Version 2
    -- Kein-Hong Man <[email protected]> 20060905
    -- This program is hereby placed into PUBLIC DOMAIN
    ------------------------------------------------------------------------
    -- HOW TO USE
    -- * This program is for recreational purposes only. :-)
    -- * ClassicEliza function will open a new buffer, then type away...
    -- * Eliza recognizes one line of input only (if you are typing very
    --   long lines, please consider seeing a real person.)
    -- * Eliza will not interfere with other buffers or handlers, and is
    --   compatible with extman.
    ------------------------------------------------------------------------
    -- Original ELIZA paper:
    --   ELIZA--A Computer Program For the Study of Natural Language
    --   Communication Between Man and Machine,
    --   Joseph Weizenbaum, 1966, Communications of the ACM Volume 9,
    --   Number 1 (January 1966): 36-35.
    --   URL: http://i5.nyu.edu/~mm64/x52.9265/january1966.html
    ------------------------------------------------------------------------
    -- A copy of the original BASIC source of this Lua version of ELIZA can
    -- be found at Josep Subirana's ELIZA download page.
    ------------------------------------------------------------------------
    -- NOTES
    -- * Modifications made to fit the program into SciTE...
    -- * For historical accuracy, functionality is more-or-less identical,
    --   as is the use of an all upper-case alphabet for output.
    -- * There is really no point extending this program. Many other more
    --   advanced Eliza-type programs exist. Good candidates for porting are
    --   EMACS' doctor.el and Perl's Chatbot-Eliza.
    -- * One difference is keyword are matched by iterating through a hash
    --   array, so matching order will be different from initialization order.
    -- * In order to avoid keeping any internal state, this Eliza does not
    --   remember your name.
    -- * Input is now case-insensitive.
    -- * The original used backticks for apostrophes, this was fixed.
    -- * A couple of spelling mistakes in strings and comments fixed.
    ------------------------------------------------------------------------
    
    ------------------------------------------------------------------------
    -- constants and primitives
    ------------------------------------------------------------------------
    local SIG = "SciTE_ClassicEliza"
    
    ------------------------------------------------------------------------
    -- simple check for extman, partially emulate if okay to do so
    ------------------------------------------------------------------------
    if OnChar and not scite_Command then
      Error("There is an OnChar conflict, please use extman")
    elseif not scite_OnChar then
      -- simple way to add a handler only, can't remove like extman does
      local _OnChar
      scite_OnChar = function(f) _OnChar = f end
      OnChar = function(c) if _OnChar then return _OnChar(c) end end
    end
    
    ------------------------------------------------------------------------
    -- Eliza main routine, processes user input
    -- * Input is case insensitive. No punctuation except apostrophes,
    --   as in: don't you're i'm i've you've.
    ------------------------------------------------------------------------
    local function Eliza(text)
      local response = ""
      local user = string.upper(text)
      local userOrig = user
    
      -- randomly selected replies if no keywords
      local randReplies = {
        "WHAT DOES THAT SUGGEST TO YOU?",
        "I SEE...",
        "I'M NOT SURE I UNDERSTAND YOU FULLY.",
        "CAN YOU ELABORATE ON THAT?",
        "THAT IS QUITE INTERESTING!",
        "THAT'S SO... PLEASE CONTINUE...",
        "I UNDERSTAND...",
        "WELL, WELL... DO GO ON",
        "WHY ARE YOU SAYING THAT?",
        "PLEASE EXPLAIN THE BACKGROUND TO THAT REMARK...",
        "COULD YOU SAY THAT AGAIN, IN A DIFFERENT WAY?",
      }
    
      -- keywords, replies
      local replies = {
        [" CAN YOU"] = "PERHAPS YOU WOULD LIKE TO BE ABLE TO",
        [" DO YOU"] = "YES, I",
        [" CAN I"] = "PERHAPS YOU DON'T WANT TO BE ABLE TO",
        [" YOU ARE"] = "WHAT MAKES YOU THINK I AM",
        [" YOU'RE"] = "WHAT IS YOUR REACTION TO ME BEING",
        [" I DON'T"] = "WHY DON'T YOU",
        [" I FEEL"] = "TELL ME MORE ABOUT FEELING",
        [" WHY DON'T YOU"] = "WHY WOULD YOU WANT ME TO",
        [" WHY CAN'T I"] = "WHAT MAKES YOU THINK YOU SHOULD BE ABLE TO",
        [" ARE YOU"] = "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM",
        [" I CAN'T"] = "HOW DO YOU KNOW YOU CAN'T",
        [" SEX"] = "I FEEL YOU SHOULD DISCUSS THIS WITH A HUMAN.",
        [" I AM"] = "HOW LONG HAVE YOU BEEN",
        [" I'M"] = "WHY ARE YOU TELLING ME YOU'RE",
        [" I WANT"] = "WHY DO YOU WANT",
        [" WHAT"] = "WHAT DO YOU THINK?",
        [" HOW"] = "WHAT ANSWER WOULD PLEASE YOU THE MOST?",
        [" WHO"] = "HOW OFTEN DO YOU THINK OF SUCH QUESTIONS?",
        [" WHERE"] = "WHY DID YOU THINK OF THAT?",
        [" WHEN"] = "WHAT WOULD YOUR BEST FRIEND SAY TO THAT QUESTION?",
        [" WHY"] = "WHAT IS IT THAT YOU REALLY WANT TO KNOW?",
        [" PERHAPS"] = "YOU'RE NOT VERY FIRM ON THAT!",
        [" DRINK"] = "MODERATION IN ALL THINGS SHOULD BE THE RULE.",
        [" SORRY"] = "WHY ARE YOU APOLOGIZING?",
        [" DREAMS"] = "WHY DID YOU BRING UP THE SUBJECT OF DREAMS?",
        [" I LIKE"] = "IS IT GOOD THAT YOU LIKE",
        [" MAYBE"] = "AREN'T YOU BEING A BIT TENTATIVE?",
        [" NO"] = "WHY ARE YOU BEING NEGATIVE?",
        [" YOUR"] = "WHY ARE YOU CONCERNED ABOUT MY",
        [" ALWAYS"] = "CAN YOU THINK OF A SPECIFIC EXAMPLE?",
        [" THINK"] = "DO YOU DOUBT",
        [" YES"] = "YOU SEEM QUITE CERTAIN. WHY IS THIS SO?",
        [" FRIEND"] = "WHY DO YOU BRING UP THE SUBJECT OF FRIENDS?",
        [" COMPUTER"] = "WHY DO YOU MENTION COMPUTERS?",
        [" AM I"] = "YOU ARE",
      }
    
      -- conjugate
      local conjugate = {
        [" I "] = "YOU",
        [" ARE "] = "AM",
        [" WERE "] = "WAS",
        [" YOU "] = "ME",
        [" YOUR "] = "MY",
        [" I'VE "] = "YOU'VE",
        [" I'M "] = "YOU'RE",
        [" ME "] = "YOU",
        [" AM I "] = "YOU ARE",
        [" AM "] = "ARE",
      }
    
      -- random replies, no keyword
      local function replyRandomly()
        response = randReplies[math.random(table.getn(randReplies))].."\n"
      end
    
      -- find keyword, phrase
      local function processInput()
        for keyword, reply in pairs(replies) do
          local d, e = string.find(user, keyword, 1, 1)
          if d then
            -- process keywords
            response = response..reply.." "
            if string.byte(string.sub(reply, -1)) < 65 then -- "A"
              response = response.."\n"; return
            end
            local h = string.len(user) - (d + string.len(keyword))
            if h > 0 then
              user = string.sub(user, -h)
            end
            for cFrom, cTo in pairs(conjugate) do
              local f, g = string.find(user, cFrom, 1, 1)
              if f then
                local j = string.sub(user, 1, f - 1).." "..cTo
                local z = string.len(user) - (f - 1) - string.len(cTo)
                response = response..j.."\n"
                if z > 2 then
                  local l = string.sub(user, -(z - 2))
                  if not string.find(userOrig, l) then return end
                end
                if z > 2 then response = response..string.sub(user, -(z - 2)).."\n" end
                if z < 2 then response = response.."\n" end
                return
              end--if f
            end--for
            response = response..user.."\n"
            return
          end--if d
        end--for
        replyRandomly()
        return
      end
    
      -- main()
      -- accept user input
      if string.sub(user, 1, 3) == "BYE" then
        response = "BYE, BYE FOR NOW.\nSEE YOU AGAIN SOME TIME.\n"
        return response
      end
      if string.sub(user, 1, 7) == "BECAUSE" then
        user = string.sub(user, 8)
      end
      user = " "..user.." "
      -- process input, print reply
      processInput()
      response = response.."\n"
      return response
    end
    
    ------------------------------------------------------------------------
    -- OnChar handler, grabs a single line of input only upon [Enter]
    ------------------------------------------------------------------------
    local function ElizaHandler(c)
      if not buffer[SIG] then return end    -- verify buffer signature
      if c == "\n" then                     -- user typed [Enter]
        local lnUser = editor:LineFromPosition(editor.CurrentPos) - 1
        if lnUser < 0 then return end
        -- grab line without ending newlines
        local lbeg = editor:PositionFromLine(lnUser)
        local lend = editor.LineEndPosition[lnUser]
        local text = editor:textrange(lbeg, lend)
        -- perform Eliza text processing
        if text ~= "" then
          editor:AddText(Eliza(text))
        end
      end
      return true
    end
    
    ------------------------------------------------------------------------
    -- script initialization (opens a new buffer and set up handlers)
    ------------------------------------------------------------------------
    function ClassicEliza()
      scite_OnChar(ElizaHandler)
      scite.Open("")
      buffer[SIG] = true;
      editor:AddText([[
    WELCOME TO ANOTHER SESSION WITH
    YOUR COMPUTER PSYCHIATRIST, ELIZA
    
    IT SURE IS NEAT TO HAVE YOU DROP BY
    
    ]])
      editor:DocumentEnd()
      math.randomseed(os.time())
    end
    
    -- end of script

    TAKE CARE!
    The thread is 11 years old, and the original poster hasn't been on this site in 10 years. Don't think it'll help him much.

  7. #7
    fonillius's Avatar Active Member WINNER OF THE BEST BOT DEVELOPER COMPETITION
    CoreCoins Purchaser Authenticator enabled
    Reputation
    48
    Join Date
    May 2007
    Posts
    249
    Thanks G/R
    5/31
    Trade Feedback
    4 (75%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jimmys96 View Post
    The thread is 11 years old, and the original poster hasn't been on this site in 10 years. Don't think it'll help him much.
    Maybe it helps someone else
    -fonillius

Similar Threads

  1. [Help] LF Auto Reply AddOn
    By ariyan1991 in forum WoW UI, Macros and Talent Specs
    Replies: 1
    Last Post: 11-02-2014, 04:38 PM
  2. Auto reply addon
    By Xander007 in forum World of Warcraft General
    Replies: 2
    Last Post: 02-18-2013, 11:11 AM
  3. Auto reply addon/program?
    By Palle in forum World of Warcraft General
    Replies: 1
    Last Post: 03-10-2008, 10:43 AM
  4. Auto Reply (with delay) [Set-up in 5 minutes]
    By Paperboi in forum World of Warcraft Bots and Programs
    Replies: 3
    Last Post: 03-05-2007, 09:56 AM
All times are GMT -5. The time now is 08:12 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search