misticos
I send chat messages based on some triggers or time

Supported Games
GameServerKingsGameServerKings

This plugin allows you to easily create timed messages and automatically have a bot respond to in-game chat messages from players based on triggers.

Note: If you need help, please provide details from the smartchatbot.debuginfo console command.

Permissions

If you want to disable permission for message or auto response group, just set it to "".

Configuration

Default Configuration

{
  "Chat Prefix": "<color=#787FFF>Bot </color>",
  "Bot Icon (SteamID)": 0,
  "Cooldown Between Auto Responses For User": "10s",
  "Global Cooldown Between Auto Responses": "2s",
  "Use Default Chat (0), Chat Plus (1), Better Chat (2)": 0,
  "Debug": false,
  "Allow Multiple Auto Responses": false,
  "Minimal Time Between Message And Answer": 1,
  "Maximal Time Between Message And Answer": 5,
  "Joining Message": [
    "Welcome, {name} ({id}, {ip})!",
    "Hello, dear {name} ({id}, {ip})!",
    "{name} came from {country} ({countrycode})"
  ],
  "Leaving Message": [
    "Bye, {name} ({id}, {ip})!\nReason: {reason}",
    "{name} ({id}, {ip}) left the game. Reason: {reason}",
    "{name} from {country} ({countrycode}) just left the game!"
  ],
  "Joining Message Enabled": false,
  "Leaving Message Enabled": false,
  "Auto Messages": [
    {
      "Permission": "smartchatbot.messages",
      "Message Frequency": "5m",
      "Auto Messages": [
        {
          "Is Enabled": true,
          "Message": "Do not mind, I am just a stupid bot."
        }
      ]
    }
  ],
  "Auto Responses": [
    {
      "Permission": "smartchatbot.response",
      "Auto Responses": [
        {
          "Is Enabled": true,
          "Remove Message From Sender": false,
          "Send Response For Everyone (true) or Only For Sender (false)": true,
          "Triggers": [
            {
              "Percentage Of Contained Words": 0.75,
              "Regex Enabled": false,
              "Words": [
                "How",
                "this",
                "bot",
                "works"
              ]
            }
          ],
          "Answers": [
            "This bot really works.",
            "IT WORKS OMG!"
          ]
        }
      ]
    }
  ]
}

Attention: All triggers are case-insensitive. If you use backslash ( \ ) in Regex, you must use double backslash. If message matches any of the triggers, response will be randomly selected and sent. Example: If I write How bot works, it will give me a response. But if I write Howbotworks, it will give me a response too. So if you want to have a response only on messages with spaces, you will need to add them (spaces) in trigger-words. Example:

"Words": [
  "How ",
  " this ",
  " bot ",
  " works"
]

For Developers

private object CanSmartHandleMessage(BasePlayer player, string message) // Called when plugin is trying to handle the message, before any checks, ... Return NOT null to cancel message handling.
private object CanSmartAnswerMessage(BasePlayer player, string message, string answer) // Called when plugin is trying to send a response. Return NOT null to cancel sending the response and all the next responses.

Donate

Click me

MIT License


Copyright (c) 2018-2020 misticos


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.