-
-
Notifications
You must be signed in to change notification settings - Fork 356
ChatControlRed as TownyChat replacement instructions
Note 1: ChatControlRed currently only supports Town, Nation and Alliance chats.
Note 2: TownyChat will have to be uninstalled for this to work properly.
Go to home/commands.yml file in your root folder and create these custom commands:
command-block-overrides: []
ignore-vanilla-permissions: false
aliases:
g:
- channel send standard $1-
tc:
- channel send town $1-
nc:
- channel send nation $1-
ac:
- channel send ally $1-
Commands: /g for General/Global chat, /tc for Town Chat, /nc for Nation Chat and /ac for Alliance Chat respectively.
Go to home/plugins/ChatControlRed/settings.yml and create the channels:
Note: In my case, I use the default standard channel as the General/Global chat, but you can use the global channel or any other really if you prefer that already exists in the default settings.yml file of ChatControlRed, up to you!
List:
standard:
Format: chat
Format_Spy: '@noprefix chat'
town:
Format: town-chat
Party: towny-town
nation:
Format: nation-chat
Party: towny-nation
ally:
Format: ally-chat
Party: towny-ally
The Party values correspond to the appropriate faction of the chat itself and it's an existing feature in ChatControlRed "towny-town" is for Town Chat, "towny-nation" is for Nation Chat & "towny-ally" is for Alliance Chat respectively.
Now that you have created the channels, you'll notice that in the Format: we've declared a different format for each one of them. The format files don't exist with the exception of the default chat of ChatControlRed.
What you can do is to duplicate this file, rename it to the appropriate channel (e.g. town-chat) and set the prefix (how the chat will look when a user types in the channel) with how you want it to. Example given below for the Town Chat:
home/plugins/ChatControlRed/formats/town-chat.yml
prefix:
Message: '&7[&bTC&7] '
Personally I made it look similar (not completely identical though) to how TownyChat itself looks
Now go to home/plugins/ChatControlRed/rules/command.rs in order to create the rules for the commands that we created on Step 1 to work properly and add these:
Note: I use the names of the channels as they were created in Step 2 for the rules to work, if you use different names, you'll need to edit the rules below accordingly.
# -------------------------------------------------------------------------------
# Create /g, /tc, /nc & /ac commands that toggle & sends messages to those channels.
# -------------------------------------------------------------------------------
#Catch "/g" and join the standard channel.
match ^([/]g)$
dont verbose
strip colors false
strip accents false
then command channel join standard
then deny
#Catch "/tc" and join the town channel.
match ^([/]tc)$
dont verbose
strip colors false
strip accents false
then command channel join town
then deny
#Catch "/nc" and join the nation channel.
match ^([/]nc)$
dont verbose
strip colors false
strip accents false
then command channel join nation
then deny
#Catch "/ac" and join the ally channel.
match ^([/]ac)$
dont verbose
strip colors false
strip accents false
then command channel join ally
then deny
#Catch "/g <message>" and redirect to the standard channel.
match ^([/]g) (.*)
dont verbose
strip colors false
strip accents false
then command channel send standard $2
then deny
#Catch "/tc <message>" and redirect to the town channel.
match ^([/]tc) (.*)
dont verbose
strip colors false
strip accents false
then command channel send town $2
then deny
#Catch "/nc <message>" and redirect to the nation channel.
match ^([/]nc) (.*)
dont verbose
strip colors false
strip accents false
then command channel send nation $2
then deny
#Catch "/ac <message>" and redirect to the ally channel.
match ^([/]ac) (.*)
dont verbose
strip colors false
strip accents false
then command channel send ally $2
then deny
Now when you execute for example the command /tc, you will join the town channel and you execute the command /tc message it will redirect the message to the town channel but won't make you join in it.
Credit to mindifirollneed and plonkatronix who figured this out.
- Home
- FAQ
- How Towny Works - Comprehensive guide for admins & players.
- Video Tutorials - Watch and learn with Major Graft.
- TownyAPI - Guide for plugin developers.
- Discord - Get involved with other Towny Admins, Plugin Developers, Testers. Support, General Discussion welcome.
- Troubleshooting
- Github Tickets
- Sponsor LlmDl - Support your developer.