Config and Custom Variables

Default Configuration:

######################################################################################################################################
 ## SexyMotd Configuration File                                                                                                      ##
 ## Learn more about how to set up SexyMotd at http://qwertyness.com/index.php/portfolio/sexymotd                                    ##
 ##                                                                                                                                  ##
 ## When updating to a new version where the configuration file changes, you must reset the file to prevent errors.                  ##
 ## To do this:                                                                                                                      ##
 ## 1. Stop the server.                                                                                                              ##
 ## 2. Backup the configuration file and delete it from the plugin folder.                                                           ##
 ## 3. Restart the server.                                                                                                           ##
 ## 4. Copy and paste the desired settings back into the newly generated file. (As long as that section's syntax hasn't changed)     ##
 ######################################################################################################################################

 # Add a new sub-entry for each separate Motd you want in the random pool.
 # Examples below
 motds:
   - 'Test motd.'
   - 'Hello, motd1;&4Color Test &rw/reset code'
   - 'Hello, motd2;Variable Test %servername% %onlineplayers%'
   - 'Hello, motd3;Variable Test %playername%'
   - '%playername% %servername% %largeplayercount%'
   - '%newplayer%, %maxplayers%, %onlineplayers%, %ip%'

 # The value to show as the maximum player limit to the server. DOES NOT CHANGE THE ACTUAL LIMIT.
 maxPlayers:
   enabled: true
   maxPlayers: 503

 # The value to show as the amount of online players. A random entry is chosen from the list on each ping.
 playerCount:
   enabled: true
   playerCount:
   - 10
   - -1
   - 47

 icon:
   # Sets the icon to the pinging player's head.
   # Using the avatar image could potentially have a drastic effect on response speed, depending on connection.  If your server has a slow connection, this is not recommended.
   enableAvatarIcon: true
   # Adds an overlay to the head image. Can be used independently from the avatar icon.
   enableOverlayImage: false
   imagePath: 'C:/Users/BillyBobJoe/Pictures/billyBobJoeIcon.jpg'

 #The text to display when hovering over the server in the server list.
 playerMessage:
   enabled: true
   playerMessage:
   - 'Hello, line 1;Variable Test %servername% %playername%'
   - 'Hello, line 2;&7Color &aTest &rw/reset code'

 # Replaces the online and max player counts with custom text.  Color codes and variables work with this.
 fakeVersion:
   enabled: false
   fakeVersion: 'Hell yeah! Players: %onlineplayers%'

 # The default name to display in place of %playername% when the ping's IP address isn't logged.
 defaultPlayerName: 'New Player'

 # Whether or not to log when a player pings and the connection is closed.
 pingLogging: true

 # Create custom variables here. Custom variables can be used like any of the default SexyMotdBungee variables.
 # MAKE SURE to place apostrophes around all components of the custom variable as they are all read as String objects from the configuration.
 variables:
   largeplayercount:
     variable: 'onlineplayers'
     operator: '>'
     condition: '10'
     value: '&aIts sure getting popular around %servername%!'
     negValue: '&cGotta step up that recruiting skill! %servername%'

Custom Variables:

Custom variables are just the same as the built in variables that come with the plugin, except you create them yourself! Here is some basic info on custom variables and how they work, so you can make your Motd even more sexy!

Example Custom Variable:

variables:
  isnewplayer:
    variable: newplayer
    operator: '='
    condition: 'true'
    value: '&bWelcome to &servername%!'
    negValue: '&bNice to see you again!'

Example Usage:

Motd:
- "&aHi %playername&! &b%isnewplayer%"

Every variable you create will reside as its own section in the variables section of the config. To begin creating a variable, start by creating a section in the variables section named after what you want the variable name to be. In order to have a fully functioning variable, you need every subsection displayed above.

"varable":

The variable section of your custom variable should contain one of the built in variables that are provided with the plugin. Some examples of what could go here are: playername, newplayer, banned, whitelisted, groupname, online_players, and max_players.

"operator":

The operator section should contain the conditional operator that you want to use to compare the value of "variable" and "condition". Valid operators include: =, >, <, >=, <=. If the "variable" subsection is a text based or boolean (true or false) variable, you can only use the = operator. If it is an integer based variable, you can use any of the operators. Remember to put apostrophes around the operator!

"condition":

The condition section should contain the value you want to compare to the "variable" subsection. For instance, if you wanted to check if online_players was greater than 20, the "variable" section would contain "online_players, the "operator" section would contain ">", and the condition section would contain "20". For Boolean variables, the condition section must either contain true or false, and for integer variables, the condition section must contain an integer.

"value":

The value section should contain the text you want displayed in place of the %variable_name% string in the case that the condition evaluates true to the variable and operator. For instance, if I wanted to display a special message to new players, the "value" section of the variable in the example would be a good fit.

"negValue":

The negValue section should contain the text you want displayed in place of the %variable_name% string in the case that the condition evaluates false to the variable and operator. For instance, if I wanted to display a special message for players who weren't new, the %isnewplayer% example above would display the negValue string if the player pinging the server wasn't a new player.

Use your new variable:

To use your new custom variable, simply surround the name you chose in "%" symbols and place it in the Motd like any other variable.

Additional Info:

The variable system is designed to allow the built in variables that come with SexyMotd to be used in the value and negValue sections of custom variables (Ex. negValue: '&bNice to see you back %playername%!'), but you cannot use custom variables in the value and negValue sections of other custom variables.


Comments

Posts Quoted:
Reply
Clear All Quotes