Cuberite Forum
Chatter - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+--- Thread: Chatter (/thread-1231.html)

Pages: 1 2 3


Chatter - NiLSPACE - 08-23-2013

Chatter
Is a plugin I worked on for a while. It basicly allows you to change the way chat is shown.

Note:
  • It's recommended to load this plugin as one of the latest in case you have other plugins that might block/change the chat message.

Config:
  • UsePlayerColor
    If set to true then the player color will be the color defined in the player's rank.
  • UseRankColor
    The same as UsePlayerColor but then for the {RANK} tag.
  • ChatPerWorld
    If this is set to true then the chat will only be displayed to players who are in the same world as the talking player.
  • ColorSymbol
    With this you can set the symbol that says if there is a color.
  • Prefix
    This is the main feature of this plugin. It allows you to change the way chat is shown. Default is '<{PLAYERNAME}> {MESSAGE}' but you can change it completly how you want. You can use:
    • {PLAYERNAME}
      The name of the player
    • {GROUP}
      The groups where a player is in. If multiple it seperates them with a ','
    • {RANK}
      The rank where a player is in.
    • {WORLD}
      The world the player is in.
    • {WORLDINITIAL}
      The first letter of the world the player is in.
    • {MESSAGE}
      The message the player sends.


  • PersonalPrefixes
    A list with names of players who get their own personal prefix.
    An example can be found by pressing on the Example button below.

  • RankPrefix
    A list with ranks to give to a certain rank.
    An example can be found by pressing on the Example button below.

    Example:

    Prefix         = "@7[{WORLD}]@f<{PLAYERNAME}> {MESSAGE}",
    UsePlayerColor = true,
    UseRankColor   = false,
    ChatPerWorld   = true,
    ColorSymbol    = "@",
    
    PersonalPrefixes =
    {
    	-- You can add a player by using ["PlayerName"] = "Custom Prefix",
    	["STR_Warrior"] = "[{RANK}] <{PLAYERNAME}> {MESSAGE}",
    },
    
    RankPrefixes =
    {
    	-- You can add a specific prefix for a certain rank by using ["Rank"] = Custom Prefix
    	["Admin"] = "@c[Admin]@f {MESSAGE}",
    },
    


API:
API:

Other plugins can hook into Chatter. They can use the RegisterPlugin function using the cPluginManager:CallPlugin function
You use the RegisterPlugin(Tag, PluginObject, FunctionName) function. Here is an example:
--This goes in the OnPluginsLoaded function:
cPluginManager:CallPlugin("Chatter", "RegisterPlugin", "Faction", cPluginManager:Get():GetCurrentPlugin():GetName(), "MessageFunction")

--And this is an example of how the MessageFunction could look like:
function MessageFunction(a_Player)
      local PlayerName = a_Player:GetName()
      if Faction[PlayerName]~= nil then
            return Faction[PlayerName]
      else
            return "Fairy Tail"
      end
end
In this case when Chatter finds "{FACTION}" in the prefix it calls the given function with the player object as parameter. The given function should then return a string that shall replace "{FACTION}".

Note that Chatter automaticly adds the braces around the tag and capitalizes it.


Source: https://github.com/NiLSPACE/Chatter
Download: https://github.com/NiLSPACE/Chatter/archive/master.zip


RE: Chatter - NiLSPACE - 11-25-2013

Hurray, Update. Other plugins are now able to hook into chatter.


RE: Chatter - NiLSPACE - 08-29-2014

Oh god. I have to rewrite this after the Ranks update. I'll do that in the weekend if I remember it Wink. I have a barbecue tomorrow with everyone from my elementary school ;D


RE: Chatter - NiLSPACE - 08-31-2014

There. Updated it. It also has a new Rank tag.

Please note that this is a complete rewrite, because the old code was horrible. The old config file should work if you rename PlayerColor to UsePlayerColor, GroupColor to UseRankColor and BroadcastToServer to ChatPerWorld (And make it true if it was false and vice versa).


RE: Chatter - job_123 - 01-02-2015

Is Chatter For More Users Cuz If I Put A Prefix On My Name But If I Save It All The Other Players In My Minecraft Server Got The Same Prefix As My


RE: Chatter - NiLSPACE - 01-04-2015

Ok. I'm currently changing the plugin so that you can give individual players a different prefix.


RE: Chatter - NiLSPACE - 01-04-2015

Done. I had the change the config file layout so you'll have to reconfigure it. An example can be found in the main thread if you press the Example button.

I'm planning on adding a webadmin interface to make it easier to change the settings and add personal/rank prefixes.


RE: Chatter - NiLSPACE - 05-03-2015

I uploaded the code to Github instead of an attachement here.


RE: Chatter - Serial - 05-16-2015

will this get integrated to the cms so we can manage it there instead of locally? be much easier than giving admins and ops local access to the files.


RE: Chatter - NiLSPACE - 05-16-2015

It should be possible, but I probably have to split the per-player and per-rank stuff from the config for that.