Jump to content

Insane Limits - Examples


ImportBot

Recommended Posts

Originally Posted by Singh400*:

 

Can someone check my code for me please? I tested it briefly and it works fine, but having someone else checking it over always helps.

 

I had this limit before:-

 

Posted Image

 

As you can see it would spam global chat one time for every new player on the server.

 

I wanted to change this into a private yell action so only the player could see it. This is what I came up with:-

 

Posted Image

 

I used ...* (by PapaCharlie9) to help me write some of the admin.yell.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 1.4k
  • Created
  • Last Reply

Originally Posted by spitfire007*:

 

hi can you help me? Insane limits is spaming me the error: "bf3 does not support individual player messages."

i tried once to make a individual player message but im pretty sure that its in not in my limits anymore.

Now the problem: i cant set the evaluation to "onInterval". if i click at it it sets it each time to "OnIntervalPlayers" :/

how can i fix it?

Has anyone got an answer for this .. the spam is driving me nuts too !
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Has anyone got an answer for this .. the spam is driving me nuts too !

The spam comes from an Action set to Say with say_audience set to Player. Check all your Actions on all your connections/servers and make sure you don't have any set to Player.

 

OnInterval is no longer supported on Version 0.8, that's why you can't select it. Use OnIntervalServer instead (for any example limit that says use OnInterval) and leave the default interval unchanged.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Can someone check my code for me please? I tested it briefly and it works fine, but having someone else checking it over always helps.

 

I had this limit before:-

 

Posted Image

 

As you can see it would spam global chat one time for every new player on the server.

 

I wanted to change this into a private yell action so only the player could see it. This is what I came up with:-

 

Posted Image

 

I used ...* (by PapaCharlie9) to help me write some of the admin.yell.

That code is okay. Personally, I'd make the yells be at least 10 seconds and also send chat with the first yell, particularly since the first 5 second yell might be missed by the player when they spawn. Some of that first yell is spent in the fade to black/fade-in time when a player spawns. They can't see the yell during that time.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Snowy*:

 

Limit request.

 

Hi guys, I am no programmer so I won't kid anyone. :smile:

Can someone show me how to write a limit?

I would like to yell a message to the team killer on each team kill.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by spitfire007*:

 

The spam comes from an Action set to Say with say_audience set to Player. Check all your Actions on all your connections/servers and make sure you don't have any set to Player.

 

OnInterval is no longer supported on Version 0.8, that's why you can't select it. Use OnIntervalServer instead (for any example limit that says use OnInterval) and leave the default interval unchanged.

Humm.. I don't seem to have that code anywhere ...

 

I have this ...

 

Code:

plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("%p_n%, this is your %p_x_th% profanity warning, next time you are gone!"));
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Snowy*:

 

Oh, I have seen that. Actually, I got !slap-ped and !insult-ed, but not killed. Same plugin, I guess. I'll leave this one to micovery, since he's the Insane Punisher.

Yep!

got that one, but I would like to yell to the TK'er "Don't forget to say sorry!" and it does not do that...:cool:

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Limit request.

 

Hi guys, I am no programmer so I won't kid anyone. :smile:

Can someone show me how to write a limit?

I would like to yell a message to the team killer on each team kill.

Happy to help, but next time, give us a clue what you want the message to be. :smile: If you've never made a limit before, it would be a good idea to watch the video in the OP of this thread. The video uses an old version of Insane Limits, so it won't look exactly the same as what you have, but close enough.

 

Create a new limit to evaluate OnTeamKill.

 

Set first_check to this Code:

 

Code:

String msg = "Your message here";
plugin.ServerCommand("admin.yell", msg, "10", "player", killer.Name);
return false;
If you want the time the yell is shown to be something other than 10 seconds, change that number to something else.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by S69Dessy*:

 

NO it works after last change :smile:

Maybe someone will need it. Working code:

 

Code:

if (limit.Activations() > 5) return false;

if(server.NextMapFileName == "MP_Subway" && server.NextGamemode == "ConquestSmall0")
{
    plugin.ServerCommand("vars.gameModeCounter", "200");
    plugin.ConsoleWrite("Next map is "+server.NextMapFileName+" with game mode "+server.NextGamemode+". Tickets set for next map");
    return false;
}

if(server.NextMapFileName == "MP_Subway" && server.NextGamemode == "TeamDeathMatch0")
{
    plugin.ServerCommand("vars.gameModeCounter", "350");
    plugin.ConsoleWrite("Next map is "+server.NextMapFileName+" with game mode "+server.NextGamemode+". Tickets set for next map");
    return false;
}


/* Conquest maps tickets */
String conquest = "200";
String tdmMP_Subway = "350"; 
String tdmMP_011 = "350"; 
String tdmMP_017 = "350";
String tdmMP_018 = "350";

/* If map is a conquest  */
if (server.Gamemode == "ConquestSmall0")
    {
        plugin.ServerCommand("vars.gameModeCounter", conquest);
    }
else if (server.MapFileName == "MP_Subway") 
	{ 
    plugin.ServerCommand("vars.gameModeCounter", tdmMP_Subway);
	} 
else if (server.MapFileName == "MP_011") 
	{ 
     plugin.ServerCommand("vars.gameModeCounter", tdmMP_011);
	} 
else if (server.MapFileName == "MP_017") 
	{ 
     plugin.ServerCommand("vars.gameModeCounter", tdmMP_017);
	} 
else if (server.MapFileName == "MP_018") 
	{ 
     plugin.ServerCommand("vars.gameModeCounter", tdmMP_018);
	}

return false;
I have tried to copy this and change the TDM to Conquest but it does not work ? We would like to run all Conquest maps at 500 Tickets , but as they have different tickets as default , what do I need to change to get Karg , Caspian, Oman and strike at Karkand to work ?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Snowy*:

 

Happy to help, but next time, give us a clue what you want the message to be. :smile: If you've never made a limit before, it would be a good idea to watch the video in the OP of this thread. The video uses an old version of Insane Limits, so it won't look exactly the same as what you have, but close enough.

 

Create a new limit to evaluate OnTeamKill.

 

Set first_check to this Code:

 

Code:

String msg = "Your message here";
plugin.ServerCommand("admin.yell", msg, "10", "player", killer.Name);
return false;
If you want the time the yell is shown to be something other than 10 seconds, change that number to something else.
Thanks!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by )RAG()N*:

 

This limit sends a shame message to the server when a player is meleed, or knifed.

 

Set the limit evaluation to OnKill, and set the action to Say

 

Set the fist_check to this Expression:

 

 

 

Code:

Regex.Match(kill.Weapon, "(Melee|Knife)").Success
And set these action specific parameters:

 

Code:

say_audience = All
                say_message = %k_n% just sliced %v_n%'s throat, what a shame!

If I put this in second_check would it yell the message..? or is there another way

 

 

Code:

plugin.ServerCommand("admin.yell", %k_n% just sliced %v_n%'s throat, what a shame!);
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by S69Dessy*:

 

If I put this in second_check would it yell the message..? or is there another way

 

 

Code:

plugin.ServerCommand("admin.yell", %k_n% just sliced %v_n%'s throat, what a shame!);
I've put the below into the second check and set action to none .... it works a treat.

 

{

plugin.SendGlobalMessage(plugin.R("%k_n% just sliced %v_n%'s throat, what a shame!"));

plugin.ServerCommand("admin.yell", plugin.R("%k_n% just sliced %v_n%'s throat, what a shame!"));

 

}

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by S69Dessy*:

 

I have tried to copy this and change the TDM to Conquest but it does not work ? We would like to run all Conquest maps at 500 Tickets , but as they have different tickets as default , what do I need to change to get Karg , Caspian, Oman and strike at Karkand to work ?

Can anyone help? I have tried this but still can not get it to work.

 

Evaluation = OnIntervalPlayers

Evaluation_interval = 30

 

Second check = code and I have tried this code .

 

 

 

if (limit.Activations() > 5) return false;

 

/* Conquest maps tickets */

String ConquestSmall0 = "500";

String ConquestLarge0 = "500";

String XP_002 = "500";

String XP_001 = "500";

 

 

/* If map is a conquest */

if (server.Gamemode == "ConquestSmall0")

{

plugin.ServerCommand("vars.gameModeCounter", ConquestSmall0);

}

else if (server.MapFileName == "XP_002")

{

plugin.ServerCommand("vars.gameModeCounter", XP_002);

}

else if (server.MapFileName == "XP_001")

{

plugin.ServerCommand("vars.gameModeCounter", XP_001);

}

 

plugin.ConsoleWrite("Next map mode is "+server.NextGamemode+". Tickets set for next map");

 

return false;

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

If I put this in second_check would it yell the message..? or is there another way

 

 

Code:

plugin.ServerCommand("admin.yell", %k_n% just sliced %v_n%'s throat, what a shame!);
Don't use that old example. Use this newer one instead:

 

myrcon.net/...insane-limits-v08r2-meleeknife-death-shame-from-message-list#entry23856

 

Post #42 (link below) shows how to add/change to use yell.

 

myrcon.net/...insane-limits-v08r2-meleeknife-death-shame-from-message-list#entry23897

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Can anyone help? I have tried this but still can not get it to work.

 

Evaluation = OnIntervalPlayers

Evaluation_interval = 30

 

Second check = code and I have tried this code .

 

 

 

if (limit.Activations() > 5) return false;

 

/* Conquest maps tickets */

String ConquestSmall0 = "500";

String ConquestLarge0 = "500";

String XP_002 = "500";

String XP_001 = "500";

 

 

/* If map is a conquest */

if (server.Gamemode == "ConquestSmall0")

{

plugin.ServerCommand("vars.gameModeCounter", ConquestSmall0);

}

else if (server.MapFileName == "XP_002")

{

plugin.ServerCommand("vars.gameModeCounter", XP_002);

}

else if (server.MapFileName == "XP_001")

{

plugin.ServerCommand("vars.gameModeCounter", XP_001);

}

 

plugin.ConsoleWrite("Next map mode is "+server.NextGamemode+". Tickets set for next map");

 

return false;

Maybe you didn't read the original post on this example? It's here:

 

myrcon.net/...insane-limits-examples#entry19463

 

In short, you have to do research to discover what the base line ticket counts are for each map. Either do some Google searching or set your server up to gameModeCounter 100 on an empty server (set it with a password) and spawn into each round and write down on a piece of paper the starting tickets for each map you want. Scrim servers are great for this purpose. Note that some maps (usually Assault type) start with one team having more tickets than the other.

 

Also, use OnIntervalServer, not OnIntervalPlayer.

 

A gameModeCounter value of 500 on a map with a base line of 300 tickets is going to be 1500 tickets. Is that what you really want?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Humm.. I don't seem to have that code anywhere ...

 

I have this ...

 

Code:

plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("%p_n%, this is your %p_x_th% profanity warning, next time you are gone!"));
What version of Insane Limits are your running? I searched all the Insane Limits code for version 0.8/p3 and couldn't find that message. I also search parts of the PRoCon code and still couldn't find it.

 

Reply to this post with a copy & pasted portion of your plugin.log that has the spam. Include at least 3 instances (lines) of error message. Make sure your debug level for Insane Limits is set to 3 when you capture the log for this analysis. I'll take a look and try to figure out where that is coming from.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Yep, thx, I've read the list before asked my question. Let me re-phrase it: Can be another level of stat gathering added and what is required to progress? I understand that there may be a lot of reasons "why not. (For example) some stats EA would not share with 3rd party or share exclusively, or some performance limitations, or something else.

 

Obvious, that extra stats will make cheat-detection more automate, that is, in principal, what I wish to achieve.

 

 

 

That is easy, thanks for you willing to help.

 

Pre-conditions are the following:

1. We have report of potentially suspicious player behavior, EA GUID and PB GUID are known.

2. The player was not captured by any of implemented Insane cheat-detecting filter

3. We want to watch the player, and assume that admin can not be online 24/7, but on alert

 

What filter should do:

a) have an input for watched GUID (either)

B) look through any mechanism (console log, Battlelog) to match this GUID

c) alert admin about the match (that, I think, can be done same was as described in Admin Request Notification example, TaskbarNotify/Mail)

 

I understand that a) and B) can be easily done using Insane capabilities almost similar way how it works with auto-bans. Unfortunately programming is my missing skill.

 

Thanks

Sorry for the delay. After thinking about how to do this, I realized I needed more information.

 

For part (a), how many GUIDs are we talking about? If it is around 10 or less, I can use a custom list. If it is more, I'll have to build it into the code. Can you post an example of 3 or 4 GUIDs and which type they are, EA or PB?

 

For part ©, are you sure you want TaskbarNotify? That only helps if someone is actually using the Windows PC that PRoCon is running on and I'm not even sure it works if you are using a layer host. The Mail part I can do easily. How about logging? I can easily add some logging info to the plugin.log.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by )RAG()N*:

 

I've put the below into the second check and set action to none .... it works a treat.

 

{

plugin.SendGlobalMessage(plugin.R("%k_n% just sliced %v_n%'s throat, what a shame!"));

plugin.ServerCommand("admin.yell", plugin.R("%k_n% just sliced %v_n%'s throat, what a shame!"));

 

 

}

thanks mate that works perfecty on older version 0.6
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by )RAG()N*:

 

Don't use that old example. Use this newer one instead:

 

myrcon.net/...insane-limits-v08r2-meleeknife-death-shame-from-message-list#entry23856

 

Post #42 (link below) shows how to add/change to use yell.

 

myrcon.net/...insane-limits-v08r2-meleeknife-death-shame-from-message-list#entry23897

Will I need to update my insane limits I have 0.6 still on?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DrRectalPain*:

 

Sorry for the delay

Absolutely no worries, mate, and thanks for helping me, really appreciate.

 

For part (a), how many GUIDs are we talking about? If it is around 10 or less, I can use a custom list. If it is more, I'll have to build it into the code. Can you post an example of 3 or 4 GUIDs and which type they are, EA or PB?

I would guess we are talking about no more than 5-10 GUIDs at one time. For example, currently we are tracking two. Always EA (to be tight to Metabans). Examples: EA_C11C7D6C4238915E59959DC78F12BB6F and EA_612575A04461D30633D0DE5AB7AFEB8C

 

For part ©, are you sure you want TaskbarNotify? That only helps if someone is actually using the Windows PC that PRoCon is running on and I'm not even sure it works if you are using a layer host. The Mail part I can do easily. How about logging? I can easily add some logging info to the plugin.log.

Logging is absolutely essential. Prefer to log it to plugin.log (I thought it is automatically done ones limit activated).

 

TaskbarNotify, actually, never worked for me (may be I just simple do not understand how the feature works). The best way (for me) is to trigger e-mail with custom message body. (Honestly, I still have a trouble to set up Mail Action, there are three config lines and I have no idea which one should have smtp information - server, port, protocol, login and passwd. UPD - found how to configure it now).

 

**********

 

Add. Have additional question about expression player.LastChat.StartsWith("word"). Is there an option to replace StartsWith with a value to detect the 'word' located at any place of the sentence (not only at start)?

 

 

***********

 

Add #2. Do not know how, but I managed to write the limit to trigger e-mail if particular PB GUID joined the server.

 

The idea came from Simple Country Kicker example.

evaluate OnJoin, and set action to Mail

Set first_check to this Expression:

Regex.Match(player.PBGuid, "5623-----PB_GUID here ----- b49", RegexOptions.IgnoreCase).Success

 

Now 2 questions

1. how to expand the number of GUIDs to, say, five

2. how to trigger EA GUID (somehow none of the OnJion evaluations does the capture of EA GUID, but PB)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by aduh*:

 

I need code for Protect Name.

I want to kick players with specified nick. Something similar to the PB premium code:

pb_sv_protectname 1 NAME

any suggestions ?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Will I need to update my insane limits I have 0.6 still on?

Sorry, yes, the newer example requires Version 0.0.0.8.

 

You really ought to upgrade to at least 0.0.0.7.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

I need code for Protect Name.

I want to kick players with specified nick. Something similar to the PB premium code:

pb_sv_protectname 1 NAME

any suggestions ?

Uh, why don't you just Ban them? Since players can't have names that aren't unique anyway, there is no need for pb_sv_protectname.

 

If you really want to kick a player with a specific name when they join, that's easy. Let's assume two names, Dummy and Moron.

 

Create a limit to evaluate OnJoin. Set Action to Kick.

 

Set first_check to this Expression

 

Code:

(player.Name == "Dummy" || player.Name == "Moron")
To add another name, just follow the same pattern, use || to separate. The || symbol means OR. For example, to add micovery, you end up with this:

 

Code:

(player.Name == "Dummy" || player.Name == "Moron" || player.Name == "micovery")
For just one name, do this:

 

Code:

(player.Name == "Dummy")
Setting up the Kick action should be obvious, so I won't explain it.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

I am using this Battlelog KDR kicker with great results: myrcon.net/...insane-limits-examples#entry18408

 

I currently have it set to Tweet and Say, but I don't want it to say to all, just admins with a certain tag. I have a list set called admin_tag. Can anybody help me with the proper code? Admins only is not an option under the say to audience.

 

I also want to exclude players who have that tag, how is this done.

 

Great plugin! Thank you for your efforts.

I'm assuming Version 0.0.0.8 Insane Limits and your Expression was (player.Kdr > 4.0), but change that to whatever you have or want. Make sure your admin_tag custom list is set to CASE SENSITIVE.

 

Set limit to evaluate OnJoin, and Action to Tweet. We will do the say in Code in second_check.

 

Set first_check to this Code (NOTE: first_check is now CODE, not EXPRESSION)

 

Code:

if (plugin.isInList(player.Tag, "admin_tag")) return false;

if (player.Kdr > 4.0) return true;  // Use whatever other Expression you want here

return false;
Set second_check to this Code

 

Code:

// Send chat only to players whose tag matches admin_tag list
List<PlayerInfoInterface> admins = new List<PlayerInfoInterface>();
foreach (PlayerInfoInterface p in team1.players) {
    if (plugin.isInList(p.Tag, "admin_tag")) admins.Add(p);
}
foreach (PlayerInfoInterface p in team2.players) {
    if (plugin.isInList(p.Tag, "admin_tag")) admins.Add(p);
}
foreach (PlayerInfoInterface p in team3.players) {
    if (plugin.isInList(p.Tag, "admin_tag")) admins.Add(p);
}
foreach (PlayerInfoInterface p in team4.players) {
    if (plugin.isInList(p.Tag, "admin_tag")) admins.Add(p);
}

String msg = plugin.R("player.FullName joining with KDR player.Kdr > 4.0"); // Set this message to whatever you want

if (admins.Count > 0) foreach (PlayerInfoInterface a in admins) {
    plugin.ServerCommand("admin.say", msg, "player", a.Name);
}
return true;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

thx and if I want to add also info to the kicked player for example:

"Making room for member"

?

You are using the Kick Action, right? Just fill in the form with the message you want.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Absolutely no worries, mate, and thanks for helping me, really appreciate.

 

 

I would guess we are talking about no more than 5-10 GUIDs at one time. For example, currently we are tracking two. Always EA (to be tight to Metabans). Examples: EA_C11C7D6C4238915E59959DC78F12BB6F and EA_612575A04461D30633D0DE5AB7AFEB8C

 

 

Logging is absolutely essential. Prefer to log it to plugin.log (I thought it is automatically done ones limit activated).

 

TaskbarNotify, actually, never worked for me (may be I just simple do not understand how the feature works). The best way (for me) is to trigger e-mail with custom message body. (Honestly, I still have a trouble to set up Mail Action, there are three config lines and I have no idea which one should have smtp information - server, port, protocol, login and passwd. UPD - found how to configure it now).

 

**********

 

Add. Have additional question about expression player.LastChat.StartsWith("word"). Is there an option to replace StartsWith with a value to detect the 'word' located at any place of the sentence (not only at start)?

 

 

***********

 

Add #2. Do not know how, but I managed to write the limit to trigger e-mail if particular PB GUID joined the server.

 

The idea came from Simple Country Kicker example.

evaluate OnJoin, and set action to Mail

Set first_check to this Expression:

Regex.Match(player.PBGuid, "5623-----PB_GUID here ----- b49", RegexOptions.IgnoreCase).Success

 

Now 2 questions

1. how to expand the number of GUIDs to, say, five

2. how to trigger EA GUID (somehow none of the OnJion evaluations does the capture of EA GUID, but PB)

That's great progress, well done!

 

For the chat, use Regex.Match. For matching the guid, use ==, as in

 

Code:

(player.PBGuid == "5623xxxxxxxxxxxxxxxxx")
Actually, I'm going to change that to use a list.

 

Post all of your code and I'll modify it to do the remaining things you need. You should us OnSpawn instead of OnJoin, since the EA GUID info isn't available yet.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DrRectalPain*:

 

PB_GUID-based player join watch works perfectly for single GUID in following setup:

 

Set limit to evaluate OnJoin, Set action to Mail

Set first_check to this Expression:

Code:

Regex.Match(player.PBGuid, "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", RegexOptions.IgnoreCase).Success
replace xxxxxxxxxxxxxxxxxxxxxxxxxxxx with PB_GUID, which you want to track.

Set second_check to Disabled

 

As soon as reports are obviously coming with both GUIDs, it really does not matter if you are tracking EA of PB. If on any reason you want to track EA_GUID, set limit to evaluate OnSpawn and use the Expression

Code:

Regex.Match(player.EAGuid, "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", RegexOptions.IgnoreCase).Success
************************************************

I've used Bad Words Kicker example to make on-request announcement about temporary ban Dart.

 

Set limit to evaluate OnAnyChat, Set action to None

Set first_check to Code:

 

Code:

List<String> rules_calls = new List<String>();
	
	rules_calls.Add("m26");
	rules_calls.Add("mass");
	rules_calls.Add("dart");
	
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	
	foreach(String chat_word in chat_words)
	    foreach(String rules_call in rules_calls)
		    if (Regex.Match(chat_word, "^"+rules_call+"$", RegexOptions.IgnoreCase).Success)
			{
                            plugin.ConsoleWarn(plugin.R("%p_n% mention M26 in chat"));
                            plugin.SendGlobalMessage(plugin.R("M26 MASS is not allowed in any setup"));
                            plugin.SendGlobalMessage(plugin.R("This is temporary untill the bug fix by EA"));
                            plugin.SendGlobalMessage(plugin.R("Do not be darted, or be banned"));
			}	

	return false;
There are two questions for me for this limit:

1. How to match Regex with (single or multiple) question mark and exclamation mark in the end (Example: Player asking in chat "what are the rules for M26"_, or saying "No Mass!!!"

 

2. Some people like abusing auto-admin features, continuously repeating same matching word in chat.

What is the was to Say third and following repeats of matching work to only this player / squad and kick player after 10 repeats?

 

Thanks for the help!

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

PB_GUID-based player join watch works perfectly for single GUID in following setup:

 

Set limit to evaluate OnJoin, Set action to Mail

Set first_check to this Expression:

Code:

Regex.Match(player.PBGuid, "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", RegexOptions.IgnoreCase).Success
replace xxxxxxxxxxxxxxxxxxxxxxxxxxxx with PB_GUID, which you want to track.

Set second_check to Disabled

 

As soon as reports are obviously coming with both GUIDs, it really does not matter if you are tracking EA of PB. If on any reason you want to track EA_GUID, set limit to evaluate OnSpawn and use the Expression

Code:

Regex.Match(player.EAGuid, "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", RegexOptions.IgnoreCase).Success
************************************************

I've used Bad Words Kicker example to make on-request announcement about temporary ban Dart.

 

Set limit to evaluate OnAnyChat, Set action to None

Set first_check to Code:

 

Code:

List<String> rules_calls = new List<String>();
	
	rules_calls.Add("m26");
	rules_calls.Add("mass");
	rules_calls.Add("dart");
	
	String[] chat_words = Regex.Split(player.LastChat, @"\s+");
	
	foreach(String chat_word in chat_words)
	    foreach(String rules_call in rules_calls)
		    if (Regex.Match(chat_word, "^"+rules_call+"$", RegexOptions.IgnoreCase).Success)
			{
                            plugin.ConsoleWarn(plugin.R("%p_n% mention M26 in chat"));
                            plugin.SendGlobalMessage(plugin.R("M26 MASS is not allowed in any setup"));
                            plugin.SendGlobalMessage(plugin.R("This is temporary untill the bug fix by EA"));
                            plugin.SendGlobalMessage(plugin.R("Do not be darted, or be banned"));
			}	

	return false;
There are two questions for me for this limit:

1. How to match Regex with (single or multiple) question mark and exclamation mark in the end (Example: Player asking in chat "what are the rules for M26"_, or saying "No Mass!!!"

 

2. Some people like abusing auto-admin features, continuously repeating same matching word in chat.

What is the was to Say third and following repeats of matching work to only this player / squad and kick player after 10 repeats?

 

Thanks for the help!

Are you concerned about matching case (upper vs. lower case) for the GUID? Is that why you are using Regex.Match?

 

There is a simpler way to deal with that. This is how I would also use a custom list.

 

Create a custom list called watch_guids. Set it Enabled and set the comparison to CaseInsensitive. Set its value to a comma separated list of guids, either PB or EA, for example:

 

Code:

EA_C11C7D6C4238915E59959DC78F12BB6F, 2b4872d46527c42aa6d66b02f3a8f62a
In second_check Code, do this:

 

Code:

if (plugin.isInList(player.PBGuid, "watch_guids") || plugin.isInList(player.EAGuid, "watch_guids")) {
     // Whatever actions you want to take go here, including logging, e.g.,
     plugin.ConsoleWrite("^b[GUID]^n " + player.FullName + " is joining with EA/PB guids: " + player.EAGuid + "/" + player.PBGuid);
     // THIS IS IMPORTANT, make sure you return true, so that your Mail or Tweet action will happen:
     return true;
}
return false;
The modification of the bad words kicker looks good. Note, if your message doesn't contain replacements, you don't have to use plugin.R(), but it is safe to use if you want to.

 

1. How to match Regex with (single or multiple) question mark and exclamation mark in the end (Example: Player asking in chat "what are the rules for M26"_, or saying "No Mass!!!"

This is a little tricky, since ? is a reserved symbol in Regex. The pattern would be:

 

Code:

[\_]+
So for example:

 

Code:

rules_calls.Add("m26"); // no question marks
rules_calls.Add("m26[\_]+"); // followed by one or more question marks
Exclamation is easier since it is not a special character:

 

Code:

rules_calls.Add("m26"); // no question marks
rules_calls.Add("m26[\_]+"); // followed by one or more question marks
rules_calls.Add("m26!+"); // followed by one or more exclamation points
To combine them both into one pattern, do this:

 

Code:

rules_calls.Add("m26"); // no question marks
rules_calls.Add("m26[\_!]+"); // followed by any combination of one or more question or exclamation marks
So that will also match m26_!_!_!!!___!.

 

You will need similar seperate Adds for "dart" and "mass".

 

2. Some people like abusing auto-admin features, continuously repeating same matching word in chat.

What is the was to Say third and following repeats of matching work to only this player / squad and kick player after 10 repeats?

This has to be in second_check Code, since you are testing limit.Activations.

 

Code:

String msg;
if (limit.Activations(player.Name) > 10) {
    // Do whatever you want here, like:
    msg = "Stop spamming the admin commands!";
    plugin.KickPlayerWithMessage(player.Name, msg);
    return false;
}

if (limit.Activations(player.Name) >= 3) {
    // Send only to player
    msg = "whatever";
    plugin.ServerCommand("admin.say", msg, "player", player.Name);
    return false;
}

// Otherwise, put your normal code here for activations 1 and 2
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by DrRectalPain*:

 

Are you concerned about matching case (upper vs. lower case) for the GUID? Is that why you are using Regex.Match?

Using it, mainly, because I am a noob and have no idea how to do that right :smile:

 

Will try the way you described.

 

Code:

rules_calls.Add("m26[\_]+"); // followed by one or more question marks
That return error on compilation. Does not like "\". Same for

Code:

[\_!]+
If back slash removed - all compiled OK, but now sure it works properly.
* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.