Raised This Month: $87 Target: $400
 21% 

Simple Chat Colors (Old Version)


Post New Thread Reply   
 
Thread Tools Display Modes
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 08-18-2011 , 18:35   Re: Simple Chat Colors
Reply With Quote #431

http://forums.alliedmods.net/showthread.php?p=1531975

This is the plugin. It intercepts chat and produces a sm_say2 chat response if the chat string matches a specific trigger.

It works perfectly if the Simple Chat Colors plugin is loaded after but if the Chat Colors plugin is loaded 1st then the triggers are ignored.

Unfortunately the creator of this plugin doesn't appear to have time to develop it further to accomodate the changes I've requested so I can't rely on his support in fixing this issue.

OFC I appreciate that I could use your overrides but I have created literally loads! of chat triggers so was hoping I wouldn't have to make all of these appear in the overrides.

I hope you can provide me with an elegant solution.


If you tell me that overrides is the only solution then I do understand.

Thanks in advance.
__________________

Last edited by Extreme_One; 08-18-2011 at 18:44.
Extreme_One is offline
ShankNinja
Junior Member
Join Date: Feb 2011
Old 08-18-2011 , 18:51   Re: Simple Chat Colors
Reply With Quote #432

I'm now facing a new problem. When I don't have any flags at all, it goes to admins.
When I delete admins and mods, I come up as donator.
If I have z, I go to Owner, but anything else will just go to whatever is after owner.


Code:
"admin_colors"
{
	"owner"
	{
		"flag"				"z"
		"tag"					"[Owner] "
		"tagcolor"		"{olive}"
		"namecolor"		"{green}"
		"textcolor"		"{lightgreen}"
	}
	"admin"
	{
		"flag"				"bcdefgjklo"
		"tag"					"[Admin] "
		"tagcolor"		"{olive}"
		"namecolor"		"{teamcolor}"
		"textcolor"		"{default}"
	}
	"mod"
	{
		"flag"				"bcdfjo"
		"tag"					"[Mod] "
		"tagcolor"		"{olive}"
		"namecolor"		"{teamcolor}"
		"textcolor"		"{default}"
	}
	"donator"
	{
		"flag"				"o"
		"tag"					"[Donator] "
		"tagcolor"		"{default}"
		"namecolor"		"{teamcolor}"
		"textcolor"		"{default}"
	}
	"Overrides"
	{
		"rank"				""
		"testcommand"	""
		"rtv"					""
		"nominate"		""
	}
}
ShankNinja is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 08-18-2011 , 18:53   Re: Simple Chat Colors
Reply With Quote #433

Quote:
Originally Posted by Extreme_One View Post
http://forums.alliedmods.net/showthread.php?p=1531975

This is the plugin. It intercepts chat and produces a sm_say2 chat response if the chat string matches a specific trigger.

It works perfectly if the Simple Chat Colors plugin is loaded after but if the Chat Colors plugin is loaded 1st then the triggers are ignored.

Unfortunately the creator of this plugin doesn't appear to have time to develop it further to accomodate the changes I've requested so I can't rely on his support in fixing this issue.

OFC I appreciate that I could use your overrides but I have created literally loads! of chat triggers so was hoping I wouldn't have to make all of these appear in the overrides.

I hope you can provide me with an elegant solution.


If you tell me that overrides is the only solution then I do understand.

Thanks in advance.
Holy bad coding batman.

There are four possible solutions:

1. Add the words that create that message in the overrides group
2. I parse that file if it exists and add them to the overrides group
3. I add that feature to this plugin
4. I re-write that plugin to work correctly
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 08-18-2011 , 18:57   Re: Simple Chat Colors
Reply With Quote #434

Quote:
Originally Posted by ShankNinja View Post
I'm now facing a new problem. When I don't have any flags at all, it goes to admins.
When I delete admins and mods, I come up as donator.
If I have z, I go to Owner, but anything else will just go to whatever is after owner.
Directly from the .cfg file.

Quote:
// --------ORDER OF OPERATIONS--------
//
// The order in which you place items in the config file matters. Here is what determins what color they get:
// 1. SteamID
// If there is a steamid present, it will always override everything. If you put a steamid in twice
// then the first entry (top to bottom) will be used. (I think, just don't do it!)
// 2. Groups
// The plugin will search (top to bottom) for a postitive match for the flag string. The player' flags
// will be compared with the group flag string, and if the player has all the flags, it will stop there.
// For example. Admins with the "ad" flags and donators with the "a" flag. If you place the "a" flag group
// above the "d" group then the admin will get the "a" colors. Order matters.
// You can use more than 1 flag for the group. You could have made the admin group with the "ad" flag,
// but it will always take the first match.
// 3. "everyone" Group
// This should ALWAYS be the last item in the config, and should ONLY be used if you actually change the color.
// Don't use it if you put name: {teamcolor} text: {default}. You would be intercepting chat for no reason.
// DO NOT INTERCEPT CHAT FOR NO REASON
If you give yourself the 'z' flag, you have, by definition, all the other flags.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 08-18-2011 , 18:58   Re: Simple Chat Colors
Reply With Quote #435

Quote:
Originally Posted by Antithasys View Post
Holy bad coding batman.

There are four possible solutions:

1. Add the words that create that message in the overrides group
2. I parse that file if it exists and add them to the overrides group
3. I add that feature to this plugin
4. I re-write that plugin to work correctly
haha

Thanks loads for taking the time to take a look.

Want to guess which I'd really prefer?

OK you guessed it, number 4 is the best solution! Actually 3 is equally preferable.

I have attached the chat responses config file I've created...

Look, I know you're busy so I don't want to make any presumptions.

Do you think you have time to help out with this?
Attached Files
File Type: txt chat_responses.txt (21.4 KB, 63 views)
__________________
Extreme_One is offline
ShankNinja
Junior Member
Join Date: Feb 2011
Old 08-18-2011 , 19:01   Re: Simple Chat Colors
Reply With Quote #436

Quote:
Originally Posted by Antithasys View Post
Directly from the .cfg file.



If you give yourself the 'z' flag, you have, by definition, all the other flags.
I understand how it works enough;
What I am saying is I have the flags for Moderator. I don't have all required flags for admin. So it should skip over admin and give me Moderator right? No, it doesn't.
Then, I set myself to no flags. I'm like a player joining for the first time. I have the Admin tag, yet I have no flags for it.
ShankNinja is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 08-18-2011 , 19:06   Re: Simple Chat Colors
Reply With Quote #437

Quote:
Originally Posted by Extreme_One View Post
haha

Thanks loads for taking the time to take a look.

Want to guess which I'd really prefer?

OK you guessed it, number 4 is the best solution! Actually 3 is equally preferable.

I have attached the chat responses config file I've created...

Look, I know you're busy so I don't want to make any presumptions.

Do you think you have time to help out with this?
Option 3 I think it best. I was done with v1.3.0 and was asking around for more features if people wanted it. v1.3.0 already has a word checker built-in to check for banned words (word filter) so to add a check for a word that requires a response would not be hard at all. It seems thou it is an entire phrase and not just a single word... have to think about how to properly code it, but should be very possible.

EDIT:
BTW... The original plugin parses that file for every word said... adding a lot of overhead
__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 08-18-2011 at 19:09.
Antithasys is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 08-18-2011 , 19:07   Re: Simple Chat Colors
Reply With Quote #438

Quote:
Originally Posted by ShankNinja View Post
I understand how it works enough;
What I am saying is I have the flags for Moderator. I don't have all required flags for admin. So it should skip over admin and give me Moderator right? No, it doesn't.
Then, I set myself to no flags. I'm like a player joining for the first time. I have the Admin tag, yet I have no flags for it.
PM me the server ip.

EDIT:

When I joined the server my chat was displayed exactly as it should be. The problem lies with how the flags were applied to the users.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 08-18-2011 at 22:43.
Antithasys is offline
Extreme_One
Veteran Member
Join Date: Nov 2006
Old 08-18-2011 , 19:10   Re: Simple Chat Colors
Reply With Quote #439

Quote:
Originally Posted by Antithasys View Post
Option 3 I think it best. I was done with v1.3.0 and was asking around for more features if people wanted it. v1.3.0 already has a word checker built-in to check for banned words (word filter) so to add a check for a word that requires a response would not be hard at all. It seems thou it is an entire phrase and not just a single word... have to think about how to properly code it, but should be very possible.
I (and my TF2 community) would be extremely grateful if you would take the time to make this happen.

If you look at the config file I'm using you can see how integral it is to our server. I think a great deal of other server admins will also find this functionality very useful. (if you could look at the last post in the chat repsonse thread then it would be really cool if you could include the requested features)

Please feel free to have me test stuff before you release if you wish.
__________________
Extreme_One is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 08-18-2011 , 19:24   Re: Simple Chat Colors
Reply With Quote #440

Alright. I will look into it and update you this weekend.

EDIT:

What a pain in the a$$. Gonna need more beer for this!

EDIT EDIT:

Try this...

<link removed> See this Post for latest beta.

Notice the two additional .cfg files. One is just a list of banned words for the new filter feature... the other is the auto responses. It uses a 'contains' feature. So it basically will try to find a the phrase in the message. The phrases file was also updated.

I believe it would act exactly like you suggested.

There was also some cvar spelling fixes. Should delete the file in /cfgs/sourcemod/plugin.simple-chatcolors.cfg and let it recreate it. In addition, the reload command was renamed to sm_reloadscc.

This is beta v1.3.0... use for testing purposes only. Please post any bugs.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 08-20-2011 at 22:55. Reason: link removed
Antithasys is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:43.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode