Jump to content

Insane Limits - Examples


ImportBot

Recommended Posts

On 5/6/2020 at 8:25 AM, Hedius said:

Does: "( player.Kdr> 0.10 )" trigger?

enable virtual mode to see actions or write a msg to the console to see if it triggers :x

Thanks for your reply

I have virtual mode turned on and procon shows it looks up the stats and it just loads the player and does not trigger the kick. 

This is what the console shows.  It shows my player name but it does not kick me which it should because myplayer exceeds the KDR limit

[08:34:54 68] [Insane Limits] Thread(fetch): Web-Stats for Myplayer logged to: Logs\173.199.104.102_30000\20200508_battle.log
[08:34:56 27] [Insane Limits] Thread(fetch): DONE inserting 1 new players, 0 still in queue, took a total of 2 secs

Link to comment
  • Replies 1.4k
  • Created
  • Last Reply
  • 9 months later...
  • 5 months later...

Hi, I need some help with making an insane limits code, I'm totally new to Insane and how to make a code.

I have made a code in Procon rulz, but it bugs sometimes. Therefor, I want to use Insane Limits now.

This is my Procon Rulz code :
# Backup Yells
#On Say; Text Alley; TeamYell %p% Needs backup in Alley
#On Say; Text Red; TeamYell %p% Red Stairs needs Backup
#On Say; Text Ramp; TeamYell %p% Ramp needs Backup
#On Say; Text C flag; TeamYell %p% C is being captured need Backup
#On Say; Text A flag; TeamYell %p% A is being captured need Backup
#On Say; Text locker; TeamYell %p% Locker needs Backup

This I want to make with Insane Limits.  I friend for other Community made this :

//Simple on chat - auto message
//Limit evaluation - OnAnyChat
//Limit first check - Code

if ((player.LastChat).Length < 2) { return false; }

//replace "word" with the word it will trigger on if typed in the chat, but don't remove the quotation marks (")

if (Regex.Match(player.LastChat, @"word", RegexOptions.IgnoreCase).Success) {

//replace "text" on both with a word group / sentence it should display on trigger, but don't remove the quotation marks (")

plugin.SendGlobalMessage(player.Name + ":text");
plugin.PRoConChat(player.Name + ":text");

//you can replace "SendGlobalMessage" (sending it to all players) with

//SendTeamMessage(sending it to the team the player is in)
//SendSquadMessage(sending it to the squad the player is in)
//SendPlayerMessage(sending it to the player himself)

It only works with the SendGlobalMessage, when I change it to SendTeamMessage Insane gives error. I also want it to be a TeamYell message for like 5 seconds.

If possible i want it Case sensitive to.

 

I hope someone can help me.

 

Thanks

Link to comment

Hey all, been a long time.  I used to run a server for BF4 which had a KDR limit enforced but for the life of me can't even remember if I used insanelimits or proconrulz for this. I've searched but can't find what I'm looking for. Can someone point me in the right direction?

Link to comment
  • 5 months later...
  • 1 month later...

Anyone can help me fix a bug in a round restarter? I want to load the next map after 30 seconds to avoid waiting for another 30 seconds countdown... Keeps the players from leaving and avoids boredom...

Limit_1 evaluation is OnRoundOver
Second_Check is disabled
First_Check is code:

/*
Simple round restarter
*/
ThreadStart reStarter = delegate {
    Thread.Sleep(30*1000); // restart 30 seconds after round end
    plugin.ServerCommand("mapList.runNextRound");
};

Thread t = new Thread(reStarter);
t.Start();
Thread.Sleep(10);

return false;

It works fine, but after a server crash the code somehow enters a loop where it will restart over and over again because it is signalling OnRoundOver I'm guessing. So I need to add some code to check if OnRoundStart is longer than 300 seconds ago or something. Any suggestion how to best fix this issue?

Schermafbeelding 2022-03-30 220041.jpg

Link to comment
  • 4 weeks later...

Hello! Please help me to implement which plugins can be output. A message when a player logs on to the server from which country.

And also with the command A\B\C. In the chat, and to send a message to the chat and the center of the screen for the team. The order that you need to capture a specific point. On the screenshots everything is more detailed!

Screenshot Welcome from.png

Screenshot_Welcome.png

Screenshot FLAG B.png

Link to comment
1 hour ago, iamadeadpixel said:

Андрей.

Оценка = при присоединении

первая проверка = код

[код]

  {
        plugin.SendGlobalMessage(plugin.R("player.Name из страны: %k_cn% присоединяется"));
    }
    вернуть ложь;

[/код]

Thank you very much. @iamadeadpixel Can you know how to do the second limit when the player writes the command A\B\C.  In the chat, and to send a message to the chat and the center of the screen for the team. The order that you need to capture a specific point. On the screenshots everything is more detailed!

I will be very grateful to you!

Link to comment
31 minutes ago, Andrew said:

Thank you very much. @iamadeadpixel Can you know how to do the second limit when the player writes the command A\B\C.  In the chat, and to send a message to the chat and the center of the screen for the team. The order that you need to capture a specific point. On the screenshots everything is more detailed!

I will be very grateful to you!

Haven't checked yet, but it seems to me that there is no Welcome %p_n% in that code?

Link to comment
On 4/26/2022 at 12:07 AM, Andrew said:

Haven't checked yet, but it seems to me that there is no Welcome %p_n% in that code?

What iamadeadpixel had

 

 {
        plugin.SendGlobalMessage(plugin.R("player.Name from Country:%k_cn% joining"));
    }
    return false;

What you can change it to

 

 {
        plugin.SendGlobalMessage(plugin.R("Welcome player.Name from Country:%k_cn% "));
    }
    return false;

Link to comment
7 minutes ago, MrSpins said:

What iamadeadpixel had

 

 {
        plugin.SendGlobalMessage(plugin.R("player.Name from Country:%k_cn% joining"));
    }
    return false;

What you can change it to

 

 {
        plugin.SendGlobalMessage(plugin.R("Welcome player.Name from Country:%k_cn% "));
    }
    return false;

Thank you very much. @MrSpins

Link to comment

Hello  @everyone  Who know how to use A/B/C commands. In the chat, send a message to the center of the screen for the team. For which it is necessary to capture a specific point. On the screenshots everything is in more detail!

 

 

I will be very grateful for your help!

А В С in chat.png

Screenshot FLAG B.png

Link to comment
1 hour ago, Andrew said:

Hello  @everyone  Who know how to use A/B/C commands. In the chat, send a message to the center of the screen for the team. For which it is necessary to capture a specific point. On the screenshots everything is in more detail!

 

 

I will be very grateful for your help!

А В С in chat.png

Screenshot FLAG B.png

Match callout1 = Regex.Match(player.LastChat, @"^[a][A]?$", RegexOptions.IgnoreCase);
Match callout2 = Regex.Match(player.LastChat, @"^[b][B]?$", RegexOptions.IgnoreCase);
Match callout3 = Regex.Match(player.LastChat, @"^[c][C]?$", RegexOptions.IgnoreCase);

string factionName = null;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showCallout = new List<String>();
        
string msg = "[CALLOUT-SYSTEM] (" + factionName + ") " + player.Name + ": ";
  
if (callout1.Success) {
  showCallout.Add(msg + ">>> needs help at flag A <<<");
}

if (callout2.Success) {
  showCallout.Add(msg + ">>> needs help at flag B <<<");
}

if (callout3.Success) {
  showCallout.Add(msg + ">>> needs help at flag C <<<");
}
  
foreach (string show in showCallout) {
  plugin.SendPlayerMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[CALLOUT-SYSTEM] > TeamSay > " + show);
}

return false;

Something along those lines should work.

Link to comment
32 minutes ago, PeekNotPeak said:
Match callout1 = Regex.Match(player.LastChat, @"^[a][A]?$", RegexOptions.IgnoreCase);
Match callout2 = Regex.Match(player.LastChat, @"^[b][B]?$", RegexOptions.IgnoreCase);
Match callout3 = Regex.Match(player.LastChat, @"^[c][C]?$", RegexOptions.IgnoreCase);

string factionName = null;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showCallout = new List<String>();
        
string msg = "[CALLOUT-SYSTEM] (" + factionName + ") " + player.Name + ": ";
  
if (callout1.Success) {
  showCallout.Add(msg + ">>> needs help at flag A <<<");
}

if (callout2.Success) {
  showCallout.Add(msg + ">>> needs help at flag B <<<");
}

if (callout3.Success) {
  showCallout.Add(msg + ">>> needs help at flag C <<<");
}
  
foreach (string show in showCallout) {
  plugin.SendPlayerMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[CALLOUT-SYSTEM] > TeamSay > " + show);
}

return false;

Something along those lines should work.

Thank you very much) And will messages also be sent to the chat as in the screenshot?  and also please add the D/E/G/F/H flags to the code. Thank you in advance!

Link to comment
11 minutes ago, Andrew said:

Thank you very much) And will messages also be sent to the chat as in the screenshot?  and also please add the D/E/G/F/H flags to the code. Thank you in advance!

//limit_evaluation: OnAnyChat

Match callout1 = Regex.Match(player.LastChat, @"^[a][A]?$", RegexOptions.IgnoreCase);
Match callout2 = Regex.Match(player.LastChat, @"^[b][B]?$", RegexOptions.IgnoreCase);
Match callout3 = Regex.Match(player.LastChat, @"^[c][C]?$", RegexOptions.IgnoreCase);
Match callout4 = Regex.Match(player.LastChat, @"^[d][D]?$", RegexOptions.IgnoreCase);
Match callout5 = Regex.Match(player.LastChat, @"^[e][E]?$", RegexOptions.IgnoreCase);
Match callout6 = Regex.Match(player.LastChat, @"^[f][F]?$", RegexOptions.IgnoreCase);
Match callout7 = Regex.Match(player.LastChat, @"^[g][G]?$", RegexOptions.IgnoreCase);
Match callout8 = Regex.Match(player.LastChat, @"^[h][H]?$", RegexOptions.IgnoreCase);

string factionName = null;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showCallout = new List<String>();
        
string msg = "[CALLOUT-SYSTEM] (" + factionName + ") " + player.Name + ": ";
  
if (callout1.Success) {
  showCallout.Add(msg + ">>> needs help at flag A <<<");
}

if (callout2.Success) {
  showCallout.Add(msg + ">>> needs help at flag B <<<");
}

if (callout3.Success) {
  showCallout.Add(msg + ">>> needs help at flag C <<<");
}

if (callout4.Success) {
  showCallout.Add(msg + ">>> needs help at flag D <<<");
}

if (callout5.Success) {
  showCallout.Add(msg + ">>> needs help at flag E <<<");
}

if (callout6.Success) {
  showCallout.Add(msg + ">>> needs help at flag F <<<");
}

if (callout7.Success) {
  showCallout.Add(msg + ">>> needs help at flag G <<<");
}

if (callout8.Success) {
  showCallout.Add(msg + ">>> needs help at flag H <<<");
}
  
foreach (string show in showCallout) {
  plugin.SendGlobalMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[CALLOUT-SYSTEM] > TeamSay > " + show);
}

return false;
Link to comment
11 hours ago, PeekNotPeak said:
//limit_evaluation: OnAnyChat

Match callout1 = Regex.Match(player.LastChat, @"^[a][A]?$", RegexOptions.IgnoreCase);
Match callout2 = Regex.Match(player.LastChat, @"^[b][B]?$", RegexOptions.IgnoreCase);
Match callout3 = Regex.Match(player.LastChat, @"^[c][C]?$", RegexOptions.IgnoreCase);
Match callout4 = Regex.Match(player.LastChat, @"^[d][D]?$", RegexOptions.IgnoreCase);
Match callout5 = Regex.Match(player.LastChat, @"^[e][E]?$", RegexOptions.IgnoreCase);
Match callout6 = Regex.Match(player.LastChat, @"^[f][F]?$", RegexOptions.IgnoreCase);
Match callout7 = Regex.Match(player.LastChat, @"^[g][G]?$", RegexOptions.IgnoreCase);
Match callout8 = Regex.Match(player.LastChat, @"^[h][H]?$", RegexOptions.IgnoreCase);

string factionName = null;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showCallout = new List<String>();
        
string msg = "[CALLOUT-SYSTEM] (" + factionName + ") " + player.Name + ": ";
  
if (callout1.Success) {
  showCallout.Add(msg + ">>> needs help at flag A <<<");
}

if (callout2.Success) {
  showCallout.Add(msg + ">>> needs help at flag B <<<");
}

if (callout3.Success) {
  showCallout.Add(msg + ">>> needs help at flag C <<<");
}

if (callout4.Success) {
  showCallout.Add(msg + ">>> needs help at flag D <<<");
}

if (callout5.Success) {
  showCallout.Add(msg + ">>> needs help at flag E <<<");
}

if (callout6.Success) {
  showCallout.Add(msg + ">>> needs help at flag F <<<");
}

if (callout7.Success) {
  showCallout.Add(msg + ">>> needs help at flag G <<<");
}

if (callout8.Success) {
  showCallout.Add(msg + ">>> needs help at flag H <<<");
}
  
foreach (string show in showCallout) {
  plugin.SendGlobalMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[CALLOUT-SYSTEM] > TeamSay > " + show);
}

return false;

Thank you very much! May God grant you good health.

 

I don't have a server yet, because there is a "WAR" in my country right now. As soon as possible, I will immediately check this limit. Thank you again!

Link to comment
Quote

Match callout1 = Regex.Match(player.LastChat, @"^[a][A]?$", RegexOptions.IgnoreCase);
Match callout2 = Regex.Match(player.LastChat, @"^[b][B]?$", RegexOptions.IgnoreCase);
Match callout3 = Regex.Match(player.LastChat, @"^[c][C]?$", RegexOptions.IgnoreCase);
Match callout4 = Regex.Match(player.LastChat, @"^[d][D]?$", RegexOptions.IgnoreCase);
Match callout5 = Regex.Match(player.LastChat, @"^[e][E]?$", RegexOptions.IgnoreCase);
Match callout6 = Regex.Match(player.LastChat, @"^[f][F]?$", RegexOptions.IgnoreCase);
Match callout7 = Regex.Match(player.LastChat, @"^[g][G]?$", RegexOptions.IgnoreCase);

string factionName = null;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showCallout = new List<String>();
        
string msg = "[Team-Help] (" + factionName + ") " + player.Name + ": ";
 
if (callout1.Success) {
  showCallout.Add(msg + ">>> Flag A <<<");
}

if (callout2.Success) {
  showCallout.Add(msg + ">>> Flag B <<<");
}

if (callout3.Success) {
  showCallout.Add(msg + ">>> Flag C <<<");
}

if (callout4.Success) {
  showCallout.Add(msg + ">>> Flag D <<<");
}

if (callout5.Success) {
  showCallout.Add(msg + ">>> Flag E <<<");
}

if (callout6.Success) {
  showCallout.Add(msg + ">>> Flag F <<<");
}

if (callout7.Success) {
  showCallout.Add(msg + ">>> Flag G <<<");
}
 
foreach (string show in showCallout) {
  plugin.SendPlayerMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[Team-Help] > TeamSay >" + show);
}

return false;


The problem is still if someone writes in chat "All" "a/b/c..." in the chat, the opposing team can see it, or think I wrong?
Link to comment
14 minutes ago, sabotaGe said:

The problem is still if someone writes in chat "All" "a/b/c..." in the chat, the opposing team can see it, or think I wrong?

Well in your code only the player and the team of this player receive messages, you can replace 
 

plugin.SendPlayerMessage 

with

plugin.SendTeamMessage 

 

so it also displays that message to the team instead of only to the player 

But i do in fact made a mistake in the first one 

plugin.SendGlobalMessage needs to be replaced with either plugin.SendTeamMessage or plugin.SendPlayerMessage

Link to comment
Thank you for your help 
I'm a total beginner, don't hit me when I make mistakes

 

Is it correct that way?
foreach (string show in showCallout) {
  plugin.SendTeamMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[Team-Help] > TeamSay >" + show);
}
Link to comment
5 minutes ago, sabotaGe said:
Thank you for your help 
I'm a total beginner, don't hit me when I make mistakes

 

Is it correct that way?
foreach (string show in showCallout) {
  plugin.SendTeamMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[Team-Help] > TeamSay >" + show);
}

Yes it’s correct, also plugin.PRoConChat is not necessary, just a info message on your layer 

Link to comment
Quote

Match callout1 = Regex.Match(player.LastChat, @"^[a][A]?$", RegexOptions.IgnoreCase);
Match callout2 = Regex.Match(player.LastChat, @"^[b][B]?$", RegexOptions.IgnoreCase);
Match callout3 = Regex.Match(player.LastChat, @"^[c][C]?$", RegexOptions.IgnoreCase);
Match callout4 = Regex.Match(player.LastChat, @"^[d][D]?$", RegexOptions.IgnoreCase);
Match callout5 = Regex.Match(player.LastChat, @"^[e][E]?$", RegexOptions.IgnoreCase);
Match callout6 = Regex.Match(player.LastChat, @"^[f][F]?$", RegexOptions.IgnoreCase);
Match callout7 = Regex.Match(player.LastChat, @"^[g][G]?$", RegexOptions.IgnoreCase);
Match callout8 = Regex.Match(player.LastChat, @"^[h][H]?$", RegexOptions.IgnoreCase);

string factionName = null;

if (server.GetFaction(player.TeamId) == 0) factionName = "US";
else if (server.GetFaction(player.TeamId) == 1) factionName = "RU";
else if (server.GetFaction(player.TeamId) == 2) factionName = "CN";

List<String> showCallout = new List<String>();
        
string msg = "[Team-Help] (" + factionName + ") " + player.Name + ": ";
 
if (callout1.Success) {
  showCallout.Add(msg + ">>> Flag A <<<");
}

if (callout2.Success) {
  showCallout.Add(msg + ">>> Flag B <<<");
}

if (callout3.Success) {
  showCallout.Add(msg + ">>> Flag C <<<");
}

if (callout4.Success) {
  showCallout.Add(msg + ">>> Flag D <<<");
}

if (callout5.Success) {
  showCallout.Add(msg + ">>> Flag E <<<");
}

if (callout6.Success) {
  showCallout.Add(msg + ">>> Flag F <<<");
}

if (callout7.Success) {
  showCallout.Add(msg + ">>> Flag G <<<");
}

if (callout8.Success) {
  showCallout.Add(msg + ">>> Flag H <<<");
}
 
foreach (string show in showCallout) {
  plugin.SendTeamMessage(player.Name, show);
  plugin.SendTeamYell(player.TeamId, show, 5);
  plugin.PRoConChat("[Team-Help] > TeamSay >" + show);
}

return false;

 

now I get the following error message. did I miss something?

[19:51:35 15] [Insane Limits] Thread(settings): ERROR: 2 errors compiling Code
[19:51:35 15] [Insane Limits] Thread(settings): ERROR: (CS1502, line: 79, column: 15):  The best overloaded method match for 'PRoConEvents.PluginInterface.SendTeamMessage(int, string)' has some invalid arguments
[19:51:35 15] [Insane Limits] Thread(settings): ERROR: (CS1503, line: 79, column: 38):  Argument 1: cannot convert from 'string' to 'int'

 

Link to comment
6 minutes ago, sabotaGe said:
now I get the following error message. did I miss something?

[19:51:35 15] [Insane Limits] Thread(settings): ERROR: 2 errors compiling Code
[19:51:35 15] [Insane Limits] Thread(settings): ERROR: (CS1502, line: 79, column: 15):  The best overloaded method match for 'PRoConEvents.PluginInterface.SendTeamMessage(int, string)' has some invalid arguments
[19:51:35 15] [Insane Limits] Thread(settings): ERROR: (CS1503, line: 79, column: 38):  Argument 1: cannot convert from 'string' to 'int'

 

replace player.Name with player.TeamId in plugin.SendTeamMessage 

Link to comment
everything is going very well so far. but if you write in chat for "all" a/b/c/..., will the opponents see it too, won't they? Isn't it better if the flags are evaluated in the chat for "team"?
then the opponent does not see which flag is to be attacked

 

 

Link to comment

Archived

This topic is now archived and is closed to further 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.