Jump to content

Insane Limits - Examples


ImportBot

Recommended Posts

  • Replies 1.4k
  • Created
  • Last Reply

Originally Posted by PapaCharlie9*:

 

I got this error:

 

[23:16:06 93] [insane Limits] Compiling Limit #1 - K/Dr10 SPM900 - OnJoin

[23:16:07 17] [insane Limits] ERROR: 2 errors compiling Expression

[23:16:07 17] [insane Limits] ERROR: (CS0117, line: 20, column: 51): 'PRoConEvents.PlayerInfoInterface' does not contain a definition for 'kills'

[23:16:07 17] [insane Limits] ERROR: (CS0117, line: 20, column: 118): 'PRoConEvents.PlayerInfoInterface' does not contain a definition for 'kills'

 

Any idea why?

Look in the Code or Expression parts of the limit for something like this:

 

player.kills

 

Replace it with this:

 

player.Kills

 

The property names start with an initial upper case letter.

 

 

thank you for taking your time, how would you implement this in the "announce top scoring clan limit"?

 

I am no coder, i understand the logic, but I'll just break the code...:tongue:

How much is it worth to you? Will you pay me $100 to write this code for you?

 

JUST KIDDING!

 

You didn't say which method you wanted, always "NBF" or anything that is XXX-PlayerName. I'll assume the latter. I'll also assume you want for it to work with both regular tags and no-tag patterns. If that's not what you wanted, well, I'm not a mind reader! :smile:

 

Basically, every place where player_info.Tag is used has to be replaced with new code similar to what I wrote before. Here's how I would modify the code (stuff in bold is new/changed):

 

Code:

double count = limit.Activations();
    
    if (count > 3)
        return false;

    List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
    players.AddRange(team1.players);
    players.AddRange(team2.players);
    Dictionary<String, double> clan_stats = new Dictionary<String, double>();
    
    /* Collect clan statistics */
    foreach(PlayerInfoInterface player_info in players)
    {
        [b]String tag = player_info.Tag;[/b]
        if (player_info.Tag.Length == 0) [b]{
            // Player does not have a regular tag, check for XXX-PlayerName form
            Match myMatch = Regex.Match(player_info.Name, @"^([^\s]{2,4})-");
            if (myMatch.Success) {
                tag = myMatch.Groups[1].Value;
                if (true) plugin.ConsoleWrite("^bPapaCharlie9's code^n found tag: " + tag + " in name " + player_info.FullName);
            } else {
                // No tag at all, skip it
                continue;
            }
        }[/b]
        
        if (!clan_stats.ContainsKey([b]tag[/b]))
            clan_stats.Add([b]tag[/b], 0);
        
        clan_stats[[b]tag[/b]] += player_info.ScoreRound;
    }

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
    {
        String message = "Top scoring clan this round is "+ best_clan + " with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
        plugin.ConsoleWrite(message);
        }   
    return false;
The modified code will print the following in the plugin log every time a name is found with the XXX-PlayerName pattern, for example, if the player's name is AA-ImaHacker, it will print:

 

PapaCharlie9's code found tag: AA in name AA-ImaHacker

 

This is called "debugging output". It helps to verify that the code is working. When you no longer need it and/or you are tired of looking at my name all over your plugin log, change the red word true to false.

 

If you plan to cut & paste this code into the limit, REMOVE the bold and color tags or it won't compile. Look for [ b ], [ /b ], [ color=red ] and [ /color ] (but without spaces) and remove all of them from the code before you copy&paste to Insane Limits.

 

BTW, I am working on a better version of this limit, which uses average score and average kills instead of total score. Otherwise, whoever has the most players in the round is likely going to be the top clan.

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

Originally Posted by ghostfighter777*:

 

Code:

		        double count = limit.ActivationsTotal(player.Name);

        if (count > 1)
           return false;
		   
        String CC = player.CountryCode;
		
        if (CC.Equals("us"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Welcome on Zockerstrich %p_n%!"));
        else if (CC.Equals("at"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Servus %p_n% am Zockerstrich!"));
        else if(CC.Equals("fr"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Bienvenue a Zockerstrich %p_n%!"));
        else if(CC.Equals("se"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Vaelkommen till Zockerstrich %p_n%!"));
        else if(CC.Equals("fi"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Tervetuloa Zockerstrich %p_n%!"));
        else if (CC.Equals("it"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Benvenuto al Zockerstrich %p_n% !"));
        else if (CC.Equals("de"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Willkommen am Zockerstrich %p_n%!"));
        else if (CC.Equals("be"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Willkommen/Bienvenue/Welkom am Zockerstrich %p_n%!"));
        else if (CC.Equals("ch"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Grueezi am Zockerstrich %p_n%!"));
        else if (CC.Equals("cz"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Vítejte na Zockerstrich %p_n%!"));
        else if (CC.Equals("pl"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Zapraszamy do Zockerstrich %p_n%!"));
        else if (CC.Equals("no"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Velkommen til Zockerstrich %p_n%!"));
		           else if (CC.Equals("nl"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Welkom bij de Zockerstrich%p_n%!"));
		   		           else if (CC.Equals("hu"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Uedvoezoeljuek a Zockerstrich %p_n%!"));
        else
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("Welcome on Zockerstrich %p_n% from %p_cn%!"));


        return false;
In this example you can find an entrys with:

 

Code:

else if (CC.Equals("xx"))
           plugin.SendSquadMessage(player.TeamId, player.SquadId, plugin.R("your language %p_n% say hello!"));
Also you can paste this two lines for a new country.

Coutrycodes you can find here:

http://www.uspto.gov/patft/help/helpctry.htm

 

Rucki

 

If some of my messages are wrong translated; its a mistake from google-translator. :ohmy:

in FR = Bienvenue sur Zockerstrich %p_n%!

on = sur

a = to

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

Originally Posted by droopie*:

 

This limit will check the number of players in the server at specific intervals of time, and depending on how many players are there in the server, it will enable/disable vehicle spawn by changing the value of "vars.vehicleSpawnAllowed". This change is in effect immediately, no need to wait for next round. However, this only applies to attack vehicles. Transport vehicles will still spawn.

 

 

Set limit to evaluate OnInterval, and set action to None

 

Set first_check to use this Code snippet:

 

Code:

if (server.PlayerCount < 8 )
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "false");
else
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "true");
In this case, if number of players in the server falls below 8, vehicles are disabled. As soon as it goes to or over 8, vehicles are re-enabled. You may change this value as you see fit.

 

Also note that when you turn off vehicle spawn, your server may not be listed in Battlelog as Hard-core. Additionally, disabling vehicles can reportedly interfere with Battlelog's Quick Match option.

do i have to keep adding limits? or can i just add

 

if (server.PlayerCount

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

plugin.ServerCommand("vars.idleTimeout", "0");

else

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

plugin.ServerCommand("vars.idleTimeout", "600");

 

because i get errors like that.

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

Originally Posted by PapaCharlie9*:

 

do i have to keep adding limits? or can i just add

 

if (server.PlayerCount

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

plugin.ServerCommand("vars.idleTimeout", "0");

else

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

plugin.ServerCommand("vars.idleTimeout", "600");

 

because i get errors like that.

This is micovery's fault for using bad coding style ... :ohmy::cool:

 

Every time you see indented code (a line of code with tabs or spaces to the left), make sure there is an { open curly brace at the beginning and a } close curly brace at the end.

 

Even if it is only one line of code, like this:

 

Code:

if (server.PlayerCount < 8 )
{
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "false");
}
else
{
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "true");
}
If you always write your if/else statements like that, you'll never have that compilation problem. If you don't like how that looks, a more concise style that does the same thing is:

 

Code:

if (server.PlayerCount < 8 ) {
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "false");
} else {
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "true");
}
So you see why your code has a compilation error? You have two lines of indented code twice. Each of those two line "blocks" is missing { and }. Try this:

 

Code:

if (server.PlayerCount < 16 ) {
    plugin.ServerCommand("vars.gameModeCounter", "100");
    plugin.ServerCommand("vars.idleTimeout", "0");
} else {
    plugin.ServerCommand("vars.gameModeCounter", "150");
    plugin.ServerCommand("vars.idleTimeout", "600");
}
And no, you don't need a whole new limit. You can string together as many if/else if/else clauses as you want. So the combined code would be:

 

Code:

// When 8 or more players are on, enable vehicle spawns
if (server.PlayerCount < 8 ) {
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "false");
} else {
    plugin.ServerCommand("vars.vehicleSpawnAllowed", "true");
}

// When 16 or more players are on, increase tickets by 50% (next round) and set idle timeout to 10 minutes
if (server.PlayerCount < 16 ) {
    plugin.ServerCommand("vars.gameModeCounter", "100");
    plugin.ServerCommand("vars.idleTimeout", "0");
} else {
    plugin.ServerCommand("vars.gameModeCounter", "150");
    plugin.ServerCommand("vars.idleTimeout", "600");
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by micovery*:

 

do i have to keep adding limits? or can i just add

 

if (server.PlayerCount

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

plugin.ServerCommand("vars.idleTimeout", "0");

else

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

plugin.ServerCommand("vars.idleTimeout", "600");

 

because i get errors like that.

This is micovery's fault for using bad coding style ... :ohmy::cool:

I've created a monster lol! PapaCharlie is right ... I come from a C/C++ background where curly braces around a single line of code are considered frivolous. To be safe ... always include curly braces for blocks after if ( ), else if ( ) and else . I have highlighted each block below, (braces on red).

 

Code:

[b]if ( [/b]condition1[b] )[/b]
<span class="highlight">[b]{[/b]                           
   ...                      
[b]}[/b]                           </span>
[b]else if ( [/b]condition2[b] )[/b]
<span class="highlight">[b]{[/b]                           
   ...                      
[b]}[/b]                           </span>
[b]else if ( [/b]condition3[b] )[/b]
<span class="highlight">[b]{[/b]                           
   ...                      
[b]}[/b]                           </span>
[b]else [/b]
<span class="highlight">[b]{[/b]                           
   ...                      
[b]}[/b]                           </span>
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Heads-up, I'm working on a double/triple multi-kill example this weekend. Any special feature requests? What do you want the chat text to be?

 

The limit will do the following:

 

* When someone gets a double, triple, quadruple, etc., kill, a chat message will be sent to all players looking something like this:

 

[LGN]PapaCharlie9 got a DOUBLE KILL with RPG-7 on: HemaToma, Froz3nTundra

 

micovery got a TRIPLE KILL with USAS-12 on: [LGN]PapaCharlie9, droopie, HexaCanon

 

* If a player gets more kills in one second than the maximum vehicle capacity (Vodnik carries 5_), he's kicked for suspicion of hacking, and if it's more than 8, he's banned.

 

Coding details:

 

* OnKill, check the list (see below) for multi-kill counts. Flush all pending multi-kills if conditions[1] are right.

 

* If this is the first time seeing this killer, start a multi-kill count for him, saving everything in the kill object as well as the victim's name. Add this count to the list.

 

* If we have seen this killer before, and its the same kill.Time, kill.Weapon and victim.Name, increment the kill count.

 

* If the kill count exceeds the suspicious limit (TBD), kick killer.

 

* If the kill count exceeds 8, ban killer.

 

[1] The tricky part is figuring out the conditions for flushing a multi-kill count. Certainly if the same killer shows up in an OnKill event with anything different (kill.Time, kill.Weapon, victim.Name), it's time to flush his count. But that might be a long time after the multi-kill. Ideally, what I want to do is have a condition like, "If no new OnKill multi-kill events happen for this player within 1000 milliseconds, flush". I can't think of a way to do that, though. I don't want to set OnInterval to 1 second. Testing every possible event that might happen, from OnJoin to OnInterval, is better, but still not perfect. Short of that, I can flush at the beginning of every OnKill if anything is different from the last OnKill, other than the victim. That still might delay the message for several seconds, maybe even over a minute, but unless anyone has a better idea, that's what I'll do.

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

Originally Posted by micovery*:

 

Heads-up, I'm working on a double/triple multi-kill example this weekend. Any special feature requests? What do you want the chat text to be?

 

The limit will do the following:

 

* When someone gets a double, triple, quadruple, etc., kill, a chat message will be sent to all players looking something like this:

 

[LGN]PapaCharlie9 got a DOUBLE KILL with RPG-7 on: HemaToma, Froz3nTundra

 

micovery got a TRIPLE KILL with USAS-12 on: [LGN]PapaCharlie9, droopie, HexaCanon

 

* If a player gets more kills in one second than the maximum vehicle capacity (Vodnik carries 5_), he's kicked for suspicion of hacking, and if it's more than 8, he's banned.

 

Coding details:

 

* OnKill, check the list (see below) for multi-kill counts. Flush all pending multi-kills if conditions[1] are right.

 

* If this is the first time seeing this killer, start a multi-kill count for him, saving everything in the kill object as well as the victim's name. Add this count to the list.

 

* If we have seen this killer before, and its the same kill.Time, kill.Weapon and victim.Name, increment the kill count.

 

* If the kill count exceeds the suspicious limit (TBD), kick killer.

 

* If the kill count exceeds 8, ban killer.

 

[1] The tricky part is figuring out the conditions for flushing a multi-kill count. Certainly if the same killer shows up in an OnKill event with anything different (kill.Time, kill.Weapon, victim.Name), it's time to flush his count. But that might be a long time after the multi-kill. Ideally, what I want to do is have a condition like, "If no new OnKill multi-kill events happen for this player within 1000 milliseconds, flush". I can't think of a way to do that, though. I don't want to set OnInterval to 1 second. Testing every possible event that might happen, from OnJoin to OnInterval, is better, but still not perfect. Short of that, I can flush at the beginning of every OnKill if anything is different from the last OnKill, other than the victim. That still might delay the message for several seconds, maybe even over a minute, but unless anyone has a better idea, that's what I'll do.

This is very tricky to do ... the part about when to stop counting (flush).You do not know how many kills the player made ... (ahead of time). In a earlier request, I replied that this is possible to do with a parallel thread spawned after the OnKill event. This thread sleeps for a few seconds ... letting the kills accumulate. After the sleep time expires... the thread checks how many kills have accumulated, and sends the appropriate multi-kill message.

 

A few things to consider about this approach:

 

1. I don't think I included the "using Systhem.Thread" library for LimitEvaluators ... check the function that builds the evaluator source code, and add it manually. (It will be in there by default in next version).

 

2. When you spawn the sleeper/accumulator thread, set a global flag in the limit (or player) to make a note that you have spawned a kill-sleeper thread for that player. That way you don't spawn one thread per kill. You want to spawn only one thread at the beginning of the spree.

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

Originally Posted by PapaCharlie9*:

 

1. I don't think I included the "using Systhem.Thread" library for LimitEvaluators ... check the function that builds the evaluator source code, and add it manually. (It will be in there by default in next version).

If this will be easier to do in 0.8, I'll just wait. I forgot that thread delegates were coming in 0.8.

 

Who will be responsible for the mutex? Hopefully that's in System.Thread also. I should lock a mutex around all access to all the objects, like killer, victim, kill, server, plugin, etc., right?

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

Originally Posted by supermillhouse*:

 

having probs with this regex for chat filter_?

 

bad_words.Add(".*n+ *[o0u.,*_\-\s]{2,} *[bp].*");

 

its the - that i want to use as a - and not range and \s for white space that causes it not to compile

 

 

[19:33:21 43] [insane Limits] ERROR: 2 errors compiling Code

[19:33:21 43] [insane Limits] ERROR: (CS1009, line: 25, column: 47): Unrecognized escape sequence

[19:33:21 43] [insane Limits] ERROR: (CS1009, line: 25, column: 49): Unrecognized escape sequence

 

tested in http://regexpal.com/

help

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

Originally Posted by PapaCharlie9*:

 

How can i retrieve some values from a consolle command?

Is there any example?

Thank you!

Which console do you mean? The command field in the Plugin Settings for Insane Limits? PRoCon console? PunkBuster console? In-game chat?

 

having probs with this regex for chat filter_?

 

bad_words.Add(".*n+ *[o0u.,*_\-\s]{2,} *[bp].*");

 

its the - that i want to use as a - and not range and \s for white space that causes it not to compile

 

 

[19:33:21 43] [insane Limits] ERROR: 2 errors compiling Code

[19:33:21 43] [insane Limits] ERROR: (CS1009, line: 25, column: 47): Unrecognized escape sequence

[19:33:21 43] [insane Limits] ERROR: (CS1009, line: 25, column: 49): Unrecognized escape sequence

 

tested in http://regexpal.com/

help

Short answer: put @ in front of the regex expression string. That tells the C# compiler to ignore backslash and other crap. So you want

 

@".*n+ *[o0u.,*_\-\s]{2,} *[bp].*"

 

Long answer: with regex expressions, there are two sources of errors: compilation errors, like you got, and runtime (evaluation) errors, which compile just fine but fail when the code executes. Using regexpal.com is a good way to find and fix runtime errors, but it won't help you with compilation errors.

 

Wow, you really really don't want people typing "noob" into chat, do you? :smile:

 

BTW, everywhere you have " *" ought to be "[ ]*" or "\s*". It's more readable and probably safer -- not sure if the game records TAB as a character or not.

 

Also, do you really mean to match?

 

no bs! (as in, no bullshit? people type that all the time)

 

no body at flag A (typo for nobody)

 

no buddy, i don't hack

 

It won't match "nub" though, which I've seen recently when people are too lazy to type noob. Funny story, one of my clan mate's player's name is "BearCat". The other day, I saw this trashtalk typed into chat:

 

you suck, nubcat!

 

That made me laff.

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

Originally Posted by droopie*:

 

this is not a working example just more of an idea for auto messages without needing additional plugins or pb edits but how can i do this? just by the idea of

Code:

int minutes = 15;
TimeSpan remain = TimeSpan.FromMinutes(15);

if ( remain.TotalSeconds > 0 )

plugin.SendGlobalMessage(plugin.R("Message1"));
then for it to wait another 15 minutes then go to the next plugin.SendGlobalMessage(plugin.R("Message2")); and so on..?

 

my goal is to have a every 15 minutes send the same message 5 times to fill up the chat box with the same messages. the amount of people who notice the chatbox auto messages on a 32 player server is very small. so want to make it stand out more.

 

again, the code above does not work at all or anything. just ideas i got from other examples..

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

Originally Posted by micovery*:

 

this is not a working example just more of an idea for auto messages without needing additional plugins or pb edits but how can i do this? just by the idea of

Code:

int minutes = 15;
TimeSpan remain = TimeSpan.FromMinutes(15);

if ( remain.TotalSeconds > 0 )

plugin.SendGlobalMessage(plugin.R("Message1"));
then for it to wait another 15 minutes then go to the next plugin.SendGlobalMessage(plugin.R("Message2")); and so on..?

 

my goal is to have a every 15 minutes send the same message 5 times to fill up the chat box with the same messages. the amount of people who notice the chatbox auto messages on a 32 player server is very small. so want to make it stand out more.

 

again, the code above does not work at all or anything. just ideas i got from other examples..

This is not a working example either, ( I have not tested it to make sure it compiles) but it would go something like this.

 

This limit would send a message every 15 minutes ... well not exactly every 15 minutes, maybe longer, depending on how much activity there is in the server. Basically what it does is ... the first time it runs it sends the message, and saves the time-stamp of the last message sent. Then, every-time it runs, it checks ... how long has it been since the last message? If it has been 15 minutes or longer ... it sends message again, and resets the time-stamp of the last message.

 

Set limit to evaluate on any event that happens frequently ... OnKill would be a good one.

 

Set first_check to this Code:

 

Code:

     int minutes = 15;

     if (limit.Data.issetObject("last_message_time") == false)
         limit.Data.setObject("last_message_time", DateTime.Now);
     
     DateTime lastMessageTime =  (DateTime) limit.Data.getObject("last_message_time");
     
     DateTime now = DateTime.Now;
     if (now.Subtract(lastMessageTime).TotalMinutes >= minutes)
     {
         limit.Data.setObject("last_message_time", now);
         plugin.SendGlobalMessage("Message1");
     }

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

Originally Posted by droopie*:

 

This is not a working example either, ( I have not tested it to make sure it compiles) but it would go something like this.

 

This limit would send a message every 15 minutes ... well not exactly every 15 minutes, maybe longer, depending on how much activity there is in the server. Basically what it does is ... the first time it runs it sends the message, and saves the time-stamp of the last message sent. Then, every-time it runs, it checks ... how long has it been since the last message? If it has been 15 minutes or longer ... it sends message again, and resets the time-stamp of the last message.

 

Set limit to evaluate on any event that happens frequently ... OnKill would be a good one.

 

Set first_check to this Code:

 

Code:

     int minutes = 15;

     if (limit.Data.issetObject("last_message_time") == false)
         limit.Data.setObject("last_message_time", DateTime.Now);
     
     DateTime lastMessageTime =  (DateTime) limit.Data.getObject("last_message_time");
     
     DateTime now = DateTime.Now;
     if (now.Subtract(lastMessageTime).TotalMinutes >= minutes)
     {
         limit.Data.setObject("last_message_time", now);
         plugin.SendGlobalMessage("Message1");
     }

     return false;
ERROR: (CS0103, line: 30, column: 22): The name 'limit' does not exist in the current context

 

but i kinda see how its setup. if anyone else finds a fix ill come back to check. ill work on it to see if i can figure this out lol

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

Originally Posted by micovery*:

 

ERROR: (CS0103, line: 30, column: 22): The name 'limit' does not exist in the current context

 

but i kinda see how its setup. if anyone else finds a fix ill come back to check. ill work on it to see if i can figure this out lol

Bah, it's my mistake, the limit object is only available in the second_check.

 

Set the first_check to this Expression:

 

Code:

true
And set second_check to this Code:

Code:

double minutes = 15;
   
     DateTime now = DateTime.now;
    
     if (limit.Data.issetObject("last_message_time") == false)
         limit.Data.setObject("last_message_time", now);
     
     DateTime lastMessageTime =  (DateTime) limit.Data.getObject("last_message_time");
     
     double minutes_since_last = now.Substract(lastMessageTime).TotalMinutes;

     if (minutes_since_last == 0 || minutes_since_last >= minutes)
     {
         limit.Data.setObject("last_message_time", now);
         plugin.SendGlobalMessage("Message1");
     }

     return false;
By the way, my original description is wrong ... the first message will be sent after 15 minutes. I have changed the code so it matches if the time difference is 0 ... ( the first time), it also sends the message.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by WaxMyCarrot*:

 

Can anyone write me a limit to change server from Softcore to hardcore and then back again based on number of players in the server?

 

EXAMPLE: When it reaches 20 players switch to HC and then when it drops back below 16 players go back to SC.

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

Originally Posted by TMiland*:

 

How much is it worth to you? Will you pay me $100 to write this code for you?

 

JUST KIDDING!

Hehe! It's worth what you say it is :biggrin:

 

You didn't say which method you wanted, always "NBF" or anything that is XXX-PlayerName. I'll assume the latter. I'll also assume you want for it to work with both regular tags and no-tag patterns. If that's not what you wanted, well, I'm not a mind reader! :smile:

Well, you figured out what i wanted, so nothing more to add here...

 

Basically, every place where player_info.Tag is used has to be replaced with new code similar to what I wrote before. Here's how I would modify the code (stuff in bold is new/changed):

 

Code:

double count = limit.Activations();
    
    if (count > 3)
        return false;

    List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
    players.AddRange(team1.players);
    players.AddRange(team2.players);
    Dictionary<String, double> clan_stats = new Dictionary<String, double>();
    
    /* Collect clan statistics */
    foreach(PlayerInfoInterface player_info in players)
    {
        [b]String tag = player_info.Tag;[/b]
        if (player_info.Tag.Length == 0) [b]{
            // Player does not have a regular tag, check for XXX-PlayerName form
            Match myMatch = Regex.Match(player_info.Name, @"^([^\s]{2,4})-");
            if (myMatch.Success) {
                tag = myMatch.Groups[1].Value;
                if (true) plugin.ConsoleWrite("^bPapaCharlie9's code^n found tag: " + tag + " in name " + player_info.FullName);
            } else {
                // No tag at all, skip it
                continue;
            }
        }[/b]
        
        if (!clan_stats.ContainsKey([b]tag[/b]))
            clan_stats.Add([b]tag[/b], 0);
        
        clan_stats[[b]tag[/b]] += player_info.ScoreRound;
    }

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
    {
        String message = "Top scoring clan this round is "+ best_clan + " with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
        plugin.ConsoleWrite(message);
        }   
    return false;
The modified code will print the following in the plugin log every time a name is found with the XXX-PlayerName pattern, for example, if the player's name is AA-ImaHacker, it will print:

 

PapaCharlie9's code found tag: AA in name AA-ImaHacker

 

This is called "debugging output". It helps to verify that the code is working. When you no longer need it and/or you are tired of looking at my name all over your plugin log, change the red word true to false.

 

If you plan to cut & paste this code into the limit, REMOVE the bold and color tags or it won't compile. Look for [ b ], [ /b ], [ color=red ] and [ /color ] (but without spaces) and remove all of them from the code before you copy&paste to Insane Limits.

 

BTW, I am working on a better version of this limit, which uses average score and average kills instead of total score. Otherwise, whoever has the most players in the round is likely going to be the top clan.

Thank you so much for doing this, much appreciated! I'll keep an eye out for the updated version. :ohmy:

 

PS: It works like a charm! Whatever charm is :tongue:

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

Originally Posted by supermillhouse*:

 

[13:36:44 01] [insane Limits] could not determine value for player.isInWhitelist in replacement

[13:36:44 01] [insane Limits] could not determine value for victim.inPlayerWhitelist in replacement

[13:36:44 02] [insane Limits] could not determine value for killer.isInWhitelist in replacement

 

i occasionally get this come up in plugin log but i dont know were from

 

the only whitelist check i use is for admin anouncer but it only checks that on spawn and thats a player not a victim?

 

any ideas

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

Originally Posted by supermillhouse*:

 

Which console do you mean? The command field in the Plugin Settings for Insane Limits? PRoCon console? PunkBuster console? In-game chat?

 

 

Short answer: put @ in front of the regex expression string. That tells the C# compiler to ignore backslash and other crap. So you want

 

@".*n+ *[o0u.,*_\-\s]{2,} *[bp].*"

 

Long answer: with regex expressions, there are two sources of errors: compilation errors, like you got, and runtime (evaluation) errors, which compile just fine but fail when the code executes. Using regexpal.com is a good way to find and fix runtime errors, but it won't help you with compilation errors.

 

Wow, you really really don't want people typing "noob" into chat, do you? :smile:

 

BTW, everywhere you have " *" ought to be "[ ]*" or "\s*". It's more readable and probably safer -- not sure if the game records TAB as a character or not.

 

Also, do you really mean to match?

 

no bs! (as in, no bullshit? people type that all the time)

 

no body at flag A (typo for nobody)

 

no buddy, i don't hack

 

It won't match "nub" though, which I've seen recently when people are too lazy to type noob. Funny story, one of my clan mate's player's name is "BearCat". The other day, I saw this trashtalk typed into chat:

 

you suck, nubcat!

 

That made me laff.

this is my current work in progress an still needs to be tested a bit

 

Code:

List<String> bad_words = new List<String>();

    bad_words.Add(@".*n+[ .,*_!]*e+[ .,*_!]*w+[ .,*_!]*b.*");
    bad_words.Add(@".*b+[ .,*_!]*[o0 ]{2,}[ .,*_!]*n.*");
    bad_words.Add(@".*n+[ .,*_!]*[aiu]+[ .,*_!]*b.*");
    bad_words.Add(@".*n+[ .,*_!]*[o0u.,*_!]+[ .,*_!]*[o0u.,*_!]+[ .,*_!]*[bp].*");
    bad_words.Add(@".*n+[ .,*_!]*a+[ .,*_!]*b.*");
    bad_words.Add(@".*n+[ .,*_!]*a+[ .,*_!]*b.*");
    bad_words.Add(@".*n+[ .,*_!]*[o0u]+[ .,*_!]*[bp]{2,}.*");

        foreach(String bad_word in bad_words)
            if (Regex.Match(player.LastChat, "^"+bad_word+"$", RegexOptions.IgnoreCase).Success)
                return true;

    return false;
i take it the @ doesnt disable the * for optional or + for required once or more_?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Mootart*:

 

[21:09:22 37] [insane Limits] Thread(enforcer): could not determine value for server.MapFileName in replacement

[21:09:22 37] [insane Limits] Thread(enforcer): could not determine value for server.Gamemode in replacement

[21:09:22 37] [insane Limits] Thread(enforcer): EXCEPTION: : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

i got this error what is it?

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

Originally Posted by NameMe*:

 

Hello micovery

 

sorry to bother you, but i keep getting a message over and over again in my procon parent control layer

Code:

[15:06:41 15] [Insane Limits] Thread(fetch): Queue exhausted, will insert now a batch of 1 player
[15:06:41 15] [Insane Limits] Thread(fetch): no new players, will wait
[15:06:43 51] [Insane Limits] EXCEPTION: System.ArgumentException: Must specify valid information for parsing in the string.
[15:06:43 51] [Insane Limits] Extra information dumped in file InsaneLimits.dump
[15:06:43 54] [Insane Limits] EXCEPTION: System.ArgumentException: Must specify valid information for parsing in the string.
[15:06:43 54] [Insane Limits] Extra information dumped in file InsaneLimits.dump
and here is a cutout of my InsaneLimits.dump

 

Code:

at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:29 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:30 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:32 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:34 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:36 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:36 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:36 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:38 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:43 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:45 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:46 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:47 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:49 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:49 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:50 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:51 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:54 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:57 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:57 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:57 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:57 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:01:58 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:02:01 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:02:01 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:02:02 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:02:02 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E

-----------------------------------------------
Version: InsaneLimits 0.0.0.6
Date: 1/21/2012 7:02:04 AM
System.ArgumentException: Must specify valid information for parsing in the string.

Stack Trace: 
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at PRoConEvents.InsaneLimits.CustomList.get_Comparison()
   at PRoConEvents.InsaneLimits.CustomList.Contains(String item)
   at PRoConEvents.InsaneLimits.isInList(String item, String list_name)

MSIL Stack Trace:
    System.Object Parse(System.Type, System.String, Boolean), IL: 0x0
    ListComparison get_Comparison(), IL: 0x0
    Boolean Contains(System.String), IL: 0x6
    Boolean isInList(System.String, System.String), IL: 0x5E
can you help me out with this error ?

 

Edit1: Fixed this with removing my Admin Welcome Messages config

 

Edit2:

 

i also found this code from you, to limit weapons

 

Code:

Regex.Match(kill.Weapon, @"(RPG|SMAW)").Success && server.MapFileName.StartsWith("XP1") && server.Gamemode.StartsWith("TeamDeathMatch")
but i need i to work on more weapons, so i edited it alittle, but dont know if the weapon codes it the right ones, and it cant seem to get it to work. got killed a couple of times by claymore, but no action taken ?

 

Code:

Regex.Match(kill.Weapon, @"(RPG-7|SMAW|Claymore|C4|USAS-12|M224MORTAR)").Success && server.MapFileName.StartsWith("XP1") && server.Gamemode.StartsWith("TeamDeathMatch")
Code:
double count = limit.Activations(player.Name);
	
	if (count == 1)
	    plugin.SendGlobalMessage(plugin.R("%p_n%, do not use %w_n%!"));
	else if (count == 2)
	{
	    plugin.SendGlobalMessage(plugin.R("%p_n%, was slayed for using %w_n% %p_x% times!"));
		plugin.KillPlayer(player.Name);
	}
	else if (count >= 3)
	{
	    plugin.SendGlobalMessage(plugin.R("%p_n%, was kicked for using %w_n% %p_x% times!"));
            plugin.KickPlayerWithMessage(player.Name, plugin.R("%p_n%, you were kicked for using %w_n% %p_x% times"));		
	}

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

Originally Posted by Mootart*:

 

[21:09:22 37] [insane Limits] Thread(enforcer): could not determine value for server.MapFileName in replacement

[21:09:22 37] [insane Limits] Thread(enforcer): could not determine value for server.Gamemode in replacement

[21:09:22 37] [insane Limits] Thread(enforcer): EXCEPTION: : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

i got this error what is it?

Why do i keep having this?

[21:40:17 78] [insane Limits] Thread(settings): WARNING: Battlefield 3 does not support individual player messages

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

Originally Posted by droopie*:

 

Can anyone write me a limit to change server from Softcore to hardcore and then back again based on number of players in the server?

 

EXAMPLE: When it reaches 20 players switch to HC and then when it drops back below 16 players go back to SC.

i had the same question just in different modes from hardcore to custom and here is the answer...

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

 

u just have to set the settings for softcore/hardcore.

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

Originally Posted by WaxMyCarrot*:

 

i had the same question just in different modes from hardcore to custom and here is the answer...

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

 

u just have to set the settings for softcore/hardcore.

Ahh.. so just need to add all the vars for HC in the top part and vars for SC after the else command.. cool ty.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Thank you so much for doing this, much appreciated! I'll keep an eye out for the updated version. :ohmy:

 

PS: It works like a charm! Whatever charm is :tongue:

Here's a better version of the Regex. It also handles =XXX=PlayerName, XXX_PlayerName and -XXX-PlayerName. I noticed those patterns on my server, so I added code to handle those patterns too.

 

I also cleaned out the bold and color, to make this easier to paste:

 

Code:

double count = limit.Activations();
    
    if (count > 3)
        return false;

    List<PlayerInfoInterface> players = new List<PlayerInfoInterface>();
    players.AddRange(team1.players);
    players.AddRange(team2.players);
    Dictionary<String, double> clan_stats = new Dictionary<String, double>();
    
    /* Collect clan statistics */
    foreach(PlayerInfoInterface player_info in players)
    {
        String tag = player_info.Tag;
        if (player_info.Tag.Length == 0) {
            // Player does not have a regular tag, check for [_-=]XXX[=-_]PlayerName form
            Match myMatch = Regex.Match(player_info.Name, @"^[=_\-]_([^=_\-]{2,4})[=_\-]");
            if (myMatch.Success) {
                tag = myMatch.Groups[1].Value;
                if (true) plugin.ConsoleWrite("^bPapaCharlie9's code^n found tag: " + tag + " in name " + player_info.FullName);
            } else {
                // No tag at all, skip it
                continue;
            }
        }
        
        if (!clan_stats.ContainsKey(tag))
            clan_stats.Add(tag, 0);
        
        clan_stats[tag] += player_info.ScoreRound;
    }

    /* Find the best scoring clan */
    String best_clan = String.Empty;
    double best_score = 0;
    
    foreach(KeyValuePair<String, double> pair in clan_stats)
        if (pair.Value > best_score)
        {
             best_clan = pair.Key;
             best_score = pair.Value;
        }
    
    if (best_clan.Length > 0)
    {
        String message = "Top scoring clan this round is "+ best_clan + " with " + best_score + " points!";
                plugin.SendGlobalMessage(message); 
        plugin.ConsoleWrite(message);
        }   
    return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

[13:36:44 01] [insane Limits] could not determine value for player.isInWhitelist in replacement

[13:36:44 01] [insane Limits] could not determine value for victim.inPlayerWhitelist in replacement

[13:36:44 02] [insane Limits] could not determine value for killer.isInWhitelist in replacement

 

i occasionally get this come up in plugin log but i dont know were from

 

the only whitelist check i use is for admin anouncer but it only checks that on spawn and thats a player not a victim?

 

any ideas

Look for plugin.R(".... isInWhitelist ...") in your code, where ... is some other text that I can't possibly know. The error is telling you that plugin.R() doesn't recognize the property called "isInWhitelist". Not sure if that's intentional or just an oversight in the Insane Limits code. Given the initial lower case letter of the name, I'm not sure it's supposed to be treated as a property.

 

You can work around this limitation by breaking up the string message. Suppose you have this:

 

plugin.R("killer.Name is okay: killer.isInWhitelist, victim.Name is okay: victim.isInWhitelist")

 

Because you want an output text line like this:

 

micovery is okay: true, PapaCharlieNiner is okay: false

 

You can rewrite the string as follows to get the formatting you want:

 

plugin.R("killer.Name is okay: ") + killer.isInWhitelist + plugin.R(", victim.Name is okay: ") + victim.isInWhitelist

 

i take it the @ doesnt disable the * for optional or + for required once or more_?

No, it doesn't disable anything. It just tells the compiler to make no changes to the string. If you don't use @, the compiler will look for \ and treat that as an "escape code" for a special character. For example:

 

"Line 1\nLine 2\nTab\tTab"

 

would print out as:

 

Line 1

Line 2

Tab Tab

 

Where \n becomes a new line and \t becomes a tab. Without the @, the compiler will see stuff like \s and think it's a special code which it doesn't understand and gives an error.

 

Compare to:

 

@"Line 1\nLine 2\nTab\tTab"

 

which would print out as:

 

Line1\nLine2\nTab\tTab

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

Originally Posted by micovery*:

 

[13:36:44 01] [insane Limits] could not determine value for player.isInWhitelist in replacement

[13:36:44 01] [insane Limits] could not determine value for victim.inPlayerWhitelist in replacement

[13:36:44 02] [insane Limits] could not determine value for killer.isInWhitelist in replacement

 

i occasionally get this come up in plugin log but i dont know were from

 

the only whitelist check i use is for admin anouncer but it only checks that on spawn and thats a player not a victim?

 

any ideas

I think this is a bug in the code ... the way those replacements work is different than usual. The plugin does not scan your string to see what you are using, and replace it. Instead, it takes a brute-force (replace-all) approach ... it iterates through all of the properties of those objects, and blindly tries to replace them. If they appear on the string, well then that's good, but if it does not appear it does not hurt ... since nothing will be replaced (it just wastes a few milliseconds).

 

The problem is that they way I coded I expected all the "Properties" to be numeric .. and those properties are "Boolean" ... which I did not handle correctly.

 

Note that the error says ... "it could not determine the value" ... which is not the same as it could not find the property.

* 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.