Raised This Month: $32 Target: $400
 8% 

[ANY] Universal Chat Filter (Version 1.2.2, 2019-01-05)


Post New Thread Reply   
 
Thread Tools Display Modes
kriz_cold
Junior Member
Join Date: Mar 2016
Location: Chile
Old 06-18-2017 , 14:39   Re: [ANY] Universal Chat Filter (Version 1.0.1, 2016-12-25)
Reply With Quote #31

Quote:
Originally Posted by almostagreatcoder View Post
Oh sorry for letting you wait so long! I haven't been active here for a while - but I will look into this in the next days.

OK, this one is a litte bit tough, because it leads to the question: what should happen, when a replacement exceeds the max. no. of characters? If the plugin would always ignore this very replacement rule, it would probably not be the expected behaviour (e.g. when you want to filter out bad language). So, I could try to implement this only for color flows: when the resulting string is too long, don't do anything. But due to the logic of replacements, this is not an easy thing to do. Will take some time... :cry:

First, changing "COLORFLOW" and "/COLORFLOW" with something short you will increase the text lenght limit, using something like "CLF" and "/CLF"

Also, you can add an option like:
"no limit" "1"
Code:
//I'm not sure how C++ and Pawn works, but the code must look like this
If (TEXT < textlimit - 7) // asuming textlimit is the default chat limit lenght and 7 the "CLF" + "/CLF" characters size
{continue}
kriz_cold is offline
almostagreatcoder
Member
Join Date: Oct 2015
Old 06-18-2017 , 15:07   Re: [ANY] Universal Chat Filter (Version 1.0.1, 2016-12-25)
Reply With Quote #32

Quote:
Originally Posted by kriz_cold View Post
First, changing "COLORFLOW" and "/COLORFLOW" with something short you will increase the text lenght limit, using something like "CLF" and "/CLF"

Also, you can add an option like:
"no limit" "1"
Code:
//I'm not sure how C++ and Pawn works, but the code must look like this
If (TEXT < textlimit - 7) // asuming textlimit is the default chat limit lenght and 7 the "CLF" + "/CLF" characters size
{continue}
Thank you for your suggestions! Using a shorter command for colorflows may be useful for writing rules in the config file, but this should not be needed to solve the problem. Since the expression 'COLORFLOW' does not appear in the resulting chat message itself, the character limit of a chat message does not apply here. I will have a look over the next days - so stay tuned...
almostagreatcoder is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 10-17-2017 , 00:51   Re: [ANY] Universal Chat Filter (Version 1.0.1, 2016-12-25)
Reply With Quote #33

This is not working with latest Chat-Processor by redwerewolf: https://forums.alliedmods.net/showthread.php?t=286913
Ejziponken is offline
almostagreatcoder
Member
Join Date: Oct 2015
Old 03-31-2018 , 06:50   Re: [ANY] Universal Chat Filter (Version 1.1.0, 2018-03-31)
Reply With Quote #34

After some time of not looking into this plugin I finally released a new version 1.1.0 today!

The problems with the color flow are fixed now (no messages are cut off any more) plus the plugin is compatible with drixevel's chat-processor.

Have fun with it!
almostagreatcoder is offline
kriz_cold
Junior Member
Join Date: Mar 2016
Location: Chile
Old 07-22-2018 , 03:09   Re: [ANY] Universal Chat Filter (Version 1.1.0, 2018-03-31)
Reply With Quote #35

Quote:
Originally Posted by almostagreatcoder View Post
After some time of not looking into this plugin I finally released a new version 1.1.0 today!

The problems with the color flow are fixed now (no messages are cut off any more) plus the plugin is compatible with drixevel's chat-processor.

Have fun with it!
It works!!!
The plugin works smoothly (by the moment) and the colorflow don't show the {/COLORFLOW} thing when the text is too long!

Anyway the text is being cut sometimes
BUT!!
For some weird reason if you put 7 spaces after the colorflow in the replacement like this:
Code:
	"Kriztalknicerthanothers"
	{
		"mode"			"2"				// mode 2 means that the complete expression shall be replaced
		"penalty"		"0"
		"find"			"{Group:KRIZ}(.*){EXIT}"		// {EXIT} means that the chat processing shall stop after a match
		"replacement"		"{COLORFLOW:FF120F-FFFFFF-FFB90F}$1{/COLORFLOW}       "	// That's really cool: make a nice color flow!
	}
Code:
$1{/COLORFLOW}       "<---[Notice that 7 spaces!]
The problem is gone !

Sadly this means that if your chat text is 7 characters close to the limit that 7 characters will be cutted off, but holy cow who's gonna write that much! just avoiding that fixes the cutting problem

Last edited by kriz_cold; 07-22-2018 at 03:11.
kriz_cold is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 08-12-2018 , 10:11   Re: [ANY] Universal Chat Filter (Version 1.1.0, 2018-03-31)
Reply With Quote #36

I have a request, could you implement the option to display a web page if the matching string is found?

https://forums.alliedmods.net/showthread.php?t=173334

I use this plugin as a lite word filter, but it only catches words at the very start of the message, and not in the middle, and is case sensitive.

Ability to make the filter only work during specified date ranges would be cool too.

PHP Code:
enum                                       //  For IsDate()
{
    
Month_None 0,
    
Month_Jan,
    
Month_Feb,
    
Month_Mar,
    
Month_Apr,
    
Month_May,
    
Month_Jun,
    
Month_Jul,
    
Month_Aug,
    
Month_Sep,
    
Month_Oct,
    
Month_Nov,
    
Month_Dec
}

/*
    Returns true if the current date is within bounds.

    Omit StartDay = Check if month matches

    If end values are ommited, it'll go from the start date to the end of the month.

    OnMapStart,
    IsDate(.bForceRecalc = true);
    to recalculate the date

    IsDate(Month_Mar, 25, Month_Apr, 20) == IsEasterHoliday()
    IsDate(Month_Oct, 15) == IsHalloweenHoliday()
    IsDate(Month_Dec, 15) == IsDecemberHoliday()

    TODO: Check logic, it might be wrong?
*/
stock bool:IsDate(StartMonth Month_NoneStartDay 0EndMonth Month_NoneEndDay 0bool:bForceRecalc false)
{
    static 
iMonth;
    static 
iDate;
    static 
bool:bFound false;

    if (
bForceRecalc)
    {
        
bFound false;
        
iMonth 0;
        
iDate 0;
    }

    if (!
bFound)
    {
        new 
iTimeStamp GetTime();
        
decl String:szMonth[MAX_DIGITS], String:szDate[MAX_DIGITS];

        
FormatTime(szMonthsizeof(szMonth), "%m"iTimeStamp);
        
FormatTime(szDatesizeof(szDate),   "%d"iTimeStamp);

        
iMonth StringToInt(szMonth);
        
iDate StringToInt(szDate);
        
bFound true;
    }

    return (
StartMonth == iMonth && StartDay <= iDate && !EndMonth && !EndDay) || (EndMonth && EndDay && (StartMonth <= iMonth && iMonth <= EndMonth) && (StartDay <= iDate && iDate <= EndDay));

__________________

Last edited by Chdata; 08-14-2018 at 23:00.
Chdata is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 11-18-2018 , 13:26   Re: [ANY] Universal Chat Filter (Version 1.1.0, 2018-03-31)
Reply With Quote #37

This plugin breaks with https://forums.alliedmods.net/showthread.php?t=303671
Ejziponken is offline
depthbomb
Junior Member
Join Date: Jul 2014
Old 11-21-2018 , 23:57   Re: [ANY] Universal Chat Filter (Version 1.1.0, 2018-03-31)
Reply With Quote #38

After installing this plugin with simple-chatprocessor already installed, my simple config which would allow just one person (me) have rainbow text would not work (though that may be related to the config itself and not the plugin). Here is the config I used.

The status command shows that I am in the group but it does nothing with my text.
__________________

Last edited by depthbomb; 11-22-2018 at 00:14. Reason: Updating
depthbomb is offline
kriz_cold
Junior Member
Join Date: Mar 2016
Location: Chile
Old 11-28-2018 , 11:07   Re: [ANY] Universal Chat Filter (Version 1.1.0, 2018-03-31)
Reply With Quote #39

Quote:
Originally Posted by depthbomb View Post
After installing this plugin with simple-chatprocessor already installed, my simple config which would allow just one person (me) have rainbow text would not work (though that may be related to the config itself and not the plugin). Here is the config I used.

The status command shows that I am in the group but it does nothing with my text.
This could happen because by default the cvar
Code:
sm_chatfilter_admins
is OFF, and it will return to 0 every time the plugin starts (That means, every map change), just try :
Code:
sm_chatfilter_admins 1
(If this cvar is set on 0, the plugin will ignore admins, and that includes the rainbow thingy)

Also, I recommend you to put 7 spaces in between the last colorflow string and the last quotes, just like this:
Code:
replacement"		"{COLORFLOW:9400D3-4B0082-0000FF-00FF00-FFFF00-FF7F00-FF0000}$1{/COLORFLOW}       "
I'm not 100% sure if that last one works with such large ammount of values, but this fixes a text-cutting glitch that could happen with some text lenghts

Edit: Or, you can edit the .SP, change the default value from there and compile it.

Last edited by kriz_cold; 11-28-2018 at 11:09. Reason: adding a second option
kriz_cold is offline
almostagreatcoder
Member
Join Date: Oct 2015
Old 12-30-2018 , 16:57   Re: [ANY] Universal Chat Filter (Version 1.2.0, 2018-12-30)
Reply With Quote #40

I just found the time to take another look into my plugin and here we are with version 1.2.1 today!

I added two things:
  1. You can now specify a "valid from" and/or a "valid to" value for each section. (Chdata's request). Have a peek into the default config file to find an example how to use these settings.
  2. You can display any URL (also a request of Chdata). This plugin now enables the command 'sm_showurl', that can be used as a regular action. Find an example of this in the default config file.

Have fun with this!

Last edited by almostagreatcoder; 12-31-2018 at 05:09.
almostagreatcoder is offline
Reply



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 00:43.


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