Jump to content

Photo

Insane Limits Requests


  • Please log in to reply
3196 replies to this topic

#1
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Post requests for new limits or for help with Examples that don't have their own threads here. For examples that do have their own threads, post in that thread.

I'm going to try to retire the Examples thread itself. It's getting awfully long and has diverged from its original purpose. If you have a new example, go ahead and post it there.

Old archived Examples thread is here: myrcon.net/.../insane-limits-examples
* Restored post. It could be that the author is no longer active.

#2
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by pharbehind*:

How's the "PapaCharlie9 balancer" coming along? :smile:
* Restored post. It could be that the author is no longer active.

#3
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

So playing around with an idea in my head on how to automate something on my server.

Code:
plugin.ServerCommand ( "/procon.protected.plugins.enable" "CBasicInGameInfo" "False" ) ;
or

Code:
plugin.ServerCommand ( "procon.protected.plugins.enable" "CBasicInGameInfo" "False" ) ;
I want the ability to disable a plugin (eventually after a certain time has passed and when dropped below x number of players). But I can't get the initial command to play ball. ProCon receives the command. That much I can see. But it just says "UnknownCommand".

Any ideas? Eventually the trigger will be OnIntervalServer, but for now I'm just using a manual trigger of @singh.
* Restored post. It could be that the author is no longer active.

#4
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

How's the "PapaCharlie9 balancer" coming along? :smile:

Fixed yet another bug today. I keep thinking every new test run is the last one, then I find another problem. The one I fixed yesterday was a huge bug, players intended to be moved to unstack were actually making stacking worse under certain circumstances.

I'll keep testing, but I won't post it until I'm pretty sure it's free of major bugs. Not there yet.
* Restored post. It could be that the author is no longer active.

#5
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

So playing around with an idea in my head on how to automate something on my server.

Code:

plugin.ServerCommand ( "/procon.protected.plugins.enable" "CBasicInGameInfo" "False" ) ;
or

Code:
plugin.ServerCommand ( "procon.protected.plugins.enable" "CBasicInGameInfo" "False" ) ;
I want the ability to disable a plugin (eventually after a certain time has passed and when dropped below x number of players). But I can't get the initial command to play ball. ProCon receives the command. That much I can see. But it just says "UnknownCommand".

Any ideas? Eventually the trigger will be OnIntervalServer, but for now I'm just using a manual trigger of @singh.

It's not possible to do with Insane Limits. The PRoCon API you need is not exposed to a limit. The ServerCommand function call in Insane Limits is itself a procon.protected.send. So all you are doing is "procon.protected.send procon.protected.plugins.enable CBasicInGameInfo False".

If you want to hack on Insane Limits itself, it would be very easy to add a wrapper function that just called this.ExecuteCommand with whatever parameters you wanted. If I were to do it, I'd just clone the public void ServerCommand function, rename it, and have it call this.ExecuteCommand with the array of parameters.
* Restored post. It could be that the author is no longer active.

#6
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

It's not possible to do with Insane Limits. The PRoCon API you need is not exposed to a limit. The ServerCommand function call in Insane Limits is itself a procon.protected.send. So all you are doing is "procon.protected.send procon.protected.plugins.enable CBasicInGameInfo False".

If you want to hack on Insane Limits itself, it would be very easy to add a wrapper function that just called this.ExecuteCommand with whatever parameters you wanted. If I were to do it, I'd just clone the public void ServerCommand function, rename it, and have it call this.ExecuteCommand with the array of parameters.

Whoa, that's a little bit beyond my skill at the moment! :woot:
* Restored post. It could be that the author is no longer active.

#7
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by DeviousDevil*:

If possible, I would like to see a limit that would check battle log and determine if the player has ever had their stats wiped. maybe something with the accounts creation date vrs stats/time played. If a players stats have been reset then they would be kicked from the server... I genuinely believe its better to be safe than sorry when it comes to questionable accounts...
* Restored post. It could be that the author is no longer active.

#8
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Tomgun*:

Vehicle Vote

is it possible to to program Limits or proconrulz to have a vote before the round is over wether to have vehicles next round or not? It will need to be fore the next round only unless the vote was passed on the next round aswell. Plus if its possible to have a slots counter so it the vote can be activated after a chose number of players in the server. If it could work like the map vote plugin that would be great, 1 vote per person, on/off depending on how many are in the server (low numbers will be off), time left of map before voting is displayed, can be on all game types or selected ones on the admins choice (admin will need to set it up).

I play HC but this could be handy for softcore admins aswell
* Restored post. It could be that the author is no longer active.

#9
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Realtec*:

Some weapon names appear like Weapons/m9/m9 or something like that but i want to strip the mess and make it m9 in this example.

I found some code in another thread:
Code:
Match m = Regex.Match(kill.Weapon, @"/[^/]+$");
	String wn = kill.Weapon;
	if(m.Success) wn = m.Groups[1].Value;
This works sometimes but sometimes the weapon name is empty.
How can i make this work?

Thanks in advance
* Restored post. It could be that the author is no longer active.

#10
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

If possible, I would like to see a limit that would check battle log and determine if the player has ever had their stats wiped. maybe something with the accounts creation date vrs stats/time played. If a players stats have been reset then they would be kicked from the server... I genuinely believe its better to be safe than sorry when it comes to questionable accounts...

Find me an example player link and the data that shows wiped vs. not wiped and I'll let you know if Insane Limits can detect that data. I already know it doesn't get creation date. Rank vs. time played should be possible, though.
* Restored post. It could be that the author is no longer active.

#11
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Vehicle Vote

is it possible to to program Limits or proconrulz to have a vote before the round is over wether to have vehicles next round or not? It will need to be fore the next round only unless the vote was passed on the next round aswell. Plus if its possible to have a slots counter so it the vote can be activated after a chose number of players in the server. If it could work like the map vote plugin that would be great, 1 vote per person, on/off depending on how many are in the server (low numbers will be off), time left of map before voting is displayed, can be on all game types or selected ones on the admins choice (admin will need to set it up).

I play HC but this could be handy for softcore admins aswell

Welcome to the Insane Limits community.

I'll add this to my list of examples to write up. It should be fairly easy to do, particularly since you provided a lot of detail.

I might as well do a map vote example as well. The code will be 99% the same.
* Restored post. It could be that the author is no longer active.

#12
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Some weapon names appear like Weapons/m9/m9 or something like that but i want to strip the mess and make it m9 in this example.

I found some code in another thread:
Code:

Match m = Regex.Match(kill.Weapon, @"/[^/]+$");
	String wn = kill.Weapon;
	if(m.Success) wn = m.Groups[1].Value;
This works sometimes but sometimes the weapon name is empty.
How can i make this work?

Thanks in advance

Whoops! Can you tell me where you found that code? I want to go fix the original.

The correct code is as follows:

Code:
Match m = Regex.Match(kill.Weapon, @"/([^/]+)$");
	String wn = kill.Weapon;
	if(m.Success) wn = m.Groups[1].Value;

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

#13
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by DonKim*:

Hey Guys ...

Im an absolutly noob in insane Limits ! So i need your help !!!!

I need a rule for the Map Metro with M67 Nade Kill Limit of 8 !! After 10 the player will be kicked !

So when playerA kills one or two (or maybe more) guys the counter should go +1 !

so it doesnt matter how many people he kills with one Nade ! But after 8 drafts (inclusive kills) he get a message with " Ur nade limit is reached be carefull"

After the 9 kill he get a message with " Ur Nade limit is reached ! One more kill and u will be kicked"

@ 10 kill he will kicked !

After Kick the counter get a reset


Oooh and after first draft inclusive kill it would be nice ... that he get a message with "Our Nade limit is set to 8 Kills"


THX for ur help ....
* Restored post. It could be that the author is no longer active.

#14
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

If possible, I would like to see a limit that would check battle log and determine if the player has ever had their stats wiped. maybe something with the accounts creation date vrs stats/time played. If a players stats have been reset then they would be kicked from the server... I genuinely believe its better to be safe than sorry when it comes to questionable accounts...

Find me an example player link and the data that shows wiped vs. not wiped and I'll let you know if Insane Limits can detect that data. I already know it doesn't get creation date. Rank vs. time played should be possible, though.

Example:-


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

#15
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Hey Guys ...

Im an absolutly noob in insane Limits ! So i need your help !!!!

I need a rule for the Map Metro with M67 Nade Kill Limit of 8 !! After 10 the player will be kicked !

So when playerA kills one or two (or maybe more) guys the counter should go +1 !

so it doesnt matter how many people he kills with one Nade ! But after 8 drafts (inclusive kills) he get a message with " Ur nade limit is reached be carefull"

After the 9 kill he get a message with " Ur Nade limit is reached ! One more kill and u will be kicked"

@ 10 kill he will kicked !

After Kick the counter get a reset


Oooh and after first draft inclusive kill it would be nice ... that he get a message with "Our Nade limit is set to 8 Kills"


THX for ur help ....

You're in luck. Someone recently requested a limit that was very similar, only they warned on 4 and punished on 5. You can just make the same changes to the code and change 4 to 8 and 5 to 10, and change the messages:

http://www.phogue.net/forumvb/showth...ll=1#post50502*
* Restored post. It could be that the author is no longer active.

#16
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Example:-

Good example, but I'm having a hard time finding a stat that definitively shows a reset. This guy already has all his stats back to pre-reset highs. I couldn't get the History to show Rank.
* Restored post. It could be that the author is no longer active.

#17
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

Good example, but I'm having a hard time finding a stat that definitively shows a reset. This guy already has all his stats back to pre-reset highs. I couldn't get the History to show Rank.

SPM I think is definitive enough I think...

Posted Image
* Restored post. It could be that the author is no longer active.

#18
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Clan_Grandpa*:

Hey Papa,

the code you send to Donkim causes a kick at first kill. I'm sure i made something wrong...

Can you please take a look at the code and tell me what's wrong ?

Thanks :smile:

limit_5_evaluation: OnKill
limit_5_first_check: Expression
limit_5_first_check_expression: ( Regex.Match(kill.Weapon, @"(:_M67)", RegexOptions.IgnoreCase).Success )

limit_5_second_check: Code

limit_5_second_check_code:


Code:
/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);
    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 3) {
        msg = plugin.R("FINAL WARNING %k_n%! Only 8 M67 kills allowed!"); // Second warning message
        plugin.SendGlobalMessage(msg);
		plugin.ServerCommand("admin.yell", msg, "player", killer.Name);
        plugin.PRoConChat("ADMIN > " + msg);
} else if (warnings >= 4) {
        msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.PRoConEvent(msg, "Insane Limits");
        plugin.KickPlayerWithMessage(killer.Name, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;

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

#19
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

SPM I think is definitive enough I think...

All Insane Limits will have is the latest time in game and SPM. According to the chart, that's 25 hours, 18 minutes, 39 seconds with an SPM of 2048. No logic can tell that apart from a guy that did not have a reset, that's what I meant. Of course, any SPM over 800 after 10 hours is suspect in it's own right, it just wouldn't necessarily indicate a reset.

Change the plot to Time instead of Date and you'll see what I mean. None of those curves look different at the end point because of the reset.
* Restored post. It could be that the author is no longer active.

#20
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Hey Papa,

the code you send to Donkim causes a kick at first kill. I'm sure i made something wrong...

Can you please take a look at the code and tell me what's wrong ?

Thanks :smile:

limit_5_evaluation: OnKill
limit_5_first_check: Expression
limit_5_first_check_expression: ( Regex.Match(kill.Weapon, @"(:_M67)", RegexOptions.IgnoreCase).Success )

limit_5_second_check: Code

limit_5_second_check_code:


Code:

/* Version: V0.8/R1 */
String kCounter = killer.Name + "_TreatAsOne_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;
if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);
    
/*
The first time through, warnings is zero. Whether this is an isolated
activation or the first of a sequence of activations in a short period
of time, do something on this first time through.
*/
String msg = "none";
if (warnings == 0) {
        return false;
}

/*
The second and subsequent times through, check to make sure we are not
getting multiple activations in a short period of time. Ignore if
less than the time span required.
*/

if (limit.Activations(killer.Name, time) > 1) return false;

/*
We get here only if there was exactly one activation in the time span
*/

if (warnings == 3) {
        msg = plugin.R("FINAL WARNING %k_n%! Only 8 M67 kills allowed!"); // Second warning message
        plugin.SendGlobalMessage(msg);
		plugin.ServerCommand("admin.yell", msg, "player", killer.Name);
        plugin.PRoConChat("ADMIN > " + msg);
} else if (warnings >= 4) {
        msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%!");
        plugin.SendGlobalMessage(msg);
        plugin.PRoConChat("ADMIN > " + msg);
        plugin.PRoConEvent(msg, "Insane Limits");
        plugin.KickPlayerWithMessage(killer.Name, msg);
}
server.Data.setInt(kCounter, warnings+1);
return false;

Might have been my mistake (original link_). The first_check expression needs to be changed to this:

Code:
( Regex.Match(kill.Weapon, @"(_:M67)", RegexOptions.IgnoreCase).Success )
Also, in second_check, try changing this line:

Code:
String kCounter = killer.Name + "_TreatAsOne_Count";
to this:

Code:
String kCounter = killer.Name + "_TreatAsOne_Grenade";

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

#21
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Learning-Curve*:

Well here is my first post (hope its in the right spot). I need to find a way for IL to get Kill Assist %. It's there in battle log as Kill Assist xxx (numeric value). I am sure IL can do the math for a %, if not numeric value would be better than nothing. Is there someway to get it working before it possibly becomes part of some future patch?

IL has flexiblity for many functions but current stats retrieved from battle log includes repair tool, ammo and revives all go to the kind of player subject is but it's not relevant in trying to control instances of hackers (can live without those 3 stats). Kill Assist is a very important attribute to look at when reviewing stats and would really like to find a way to get IL calculating this to simplify process.

Thanks in advance.

ps. you have True & False, when typing regex. (what ever that means lol) is there a negative or opposite for .success? I am 2 weeks new at C#...
* Restored post. It could be that the author is no longer active.

#22
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

Well here is my first post (hope its in the right spot). I need to find a way for IL to get Kill Assist %. It's there in battle log as Kill Assist xxx (numeric value). I am sure IL can do the math for a %, if not numeric value would be better than nothing. Is there someway to get it working before it possibly becomes part of some future patch?

IL has flexiblity for many functions but current stats retrieved from battle log includes repair tool, ammo and revives all go to the kind of player subject is but it's not relevant in trying to control instances of hackers (can live without those 3 stats). Kill Assist is a very important attribute to look at when reviewing stats and would really like to find a way to get IL calculating this to simplify process.

Thanks in advance.

ps. you have True & False, when typing regex. (what ever that means lol) is there a negative or opposite for .success? I am 2 weeks new at C#...

See ...*.
* Restored post. It could be that the author is no longer active.

#23
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Learning-Curve*:

Thanks for the link but with only 2 weeks of this C# stuff I just cant piece it together from the link you provided. I will save it and hope there is one post that I can get it to work & without errors. Dont know what I'm doing so could just be adding it wrong. Dont need hand holding but baby steps work lol. Thanks for trying...peace

ps. still dont know what or if there is an opposite to .success in regex.
managed to piece together 29 limits so its not all bad...
* Restored post. It could be that the author is no longer active.

#24
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

Thanks for the link but with only 2 weeks of this C# stuff I just cant piece it together from the link you provided. I will save it and hope there is one post that I can get it to work & without errors. Dont know what I'm doing so could just be adding it wrong. Dont need hand holding but baby steps work lol. Thanks for trying...peace

ps. still dont know what or if there is an opposite to .success in regex.
managed to piece together 29 limits so its not all bad...

Did it myself, you can download the modified plugin below.

You must use the key player.killAssists

Download: InsaneLimits_0.0.0.8-patch-3-singh-mod.zip
* Restored post. It could be that the author is no longer active.

#25
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Learning-Curve*:

Well I appreciate your time in doing it for me. It does infact work now so TY. Unfortunately for me I think someone is either part of the solution or part of the problem, which inturn doing it for me left me thinking I still had a problem. I didnt see a new limit so concluded you added the code directly to (.cs) [I would have never got all the right places even if I knew to add it to (.cs)]

I decided to DL note++ and play a game of "FIND WALDO" to see what exactly you did. Now I have a better understanding of the input required with limits. An example of this and correct me if I am wrong but regex is a string that only needs to be .success or you just wouldn't write the string? Where as True & False just allows the next check/action to occur or not.

I did notice input for percent on other entries and will endeavor to enable that part for kill assists so as to use it as an onjoin limit alert. It will end in a oooh-rah or oooh-help lol. Thanks again singh...peace
* Restored post. It could be that the author is no longer active.

#26
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

Did it myself, you can download the modified plugin below.

You must use the key player.killAssists

Download: Attachment 1648
Mirror: http://ge.tt/7CpXYEI/v/0

Threw together a ...* for anyone interested.

Well I appreciate your time in doing it for me. It does infact work now so TY. Unfortunately for me I think someone is either part of the solution or part of the problem, which inturn doing it for me left me thinking I still had a problem. I didnt see a new limit so concluded you added the code directly to (.cs) [I would have never got all the right places even if I knew to add it to (.cs)]

I decided to DL note++ and play a game of "FIND WALDO" to see what exactly you did. Now I have a better understanding of the input required with limits. An example of this and correct me if I am wrong but regex is a string that only needs to be .success or you just wouldn't write the string? Where as True & False just allows the next check/action to occur or not.

I did notice input for percent on other entries and will endeavor to enable that part for kill assists so as to use it as an onjoin limit alert. It will end in a oooh-rah or oooh-help lol. Thanks again singh...peace

To be honest I'm not a hot shot at REGEX either. PapaCharlie is the expert here. I'm just learning as I go along.
* Restored post. It could be that the author is no longer active.

#27
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

I'm a little nervous about you guys hacking on Insane Limits and posting the sources without micovery's buy-in. I'm okay with hacking for personal usage (I've done so myself) and I'm okay with sharing it with one or two others via PM, but posting it might end up causing problems, particularly for me. If a bunch of people start using it and reporting problems, how am I suppose to know what version they are using? I've got my hands full supporting one version of the plugin, I'm not really looking forward to supporting two versions.

At the very least, change the version number. Change the GetPluginVersion function to return something like "0.0.0.8-patch-3-singh-mod". That is, if you haven't already. I didn't look at your code.

This post has a short tutorial on Regex:

http://www.phogue.net/forumvb/showth...ll=1#post43169*

To do the opposite of a match, for example, if you want to do something for everything that does NOT match "M320", do this:

Code:
( !Regex.Match(kill.Weapon, @"M320", RegexOptions.IgnoreCase).Success )
The ! operator means logical not. So if the Success returns true, the ! makes it false. If the Success returns false, the ! makes it true.
* Restored post. It could be that the author is no longer active.

#28
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Cheezis_Chrust*:

First of all, I want to say THANK YOU PapaCharlie for everything you've provided. I have over 20 limits running regularly on my BF3 server, and it has made things SO much easier.

I've been pretty keen about taking your existing examples and tweaking them to my usage, but there's one that I can't seem to figure out, and I've finally cracked and joined up to reach out for help. (An IT guy asking for help..my pride :sad: lol)

I want tt make a warning system for campers, that is very similar to this warning system : www.phogue.net/forumvb/showth...derslung-limit*

Basically, I want it so they can say !camper after they get killed by someone hunkered down in a corner, laying down or generally not moving. The warning system would be the same - 3 strikes and youre out, sending a warning message to the camper telling them they have complaints against them each time, etc. Is this something you could test out for me? I would be eternally grateful, and even throw a donation your way for all your help, past and present.

Many many thanks!

- Cory
* Restored post. It could be that the author is no longer active.

#29
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by Singh400*:

Question what are the advantages/disadvantages (if any) of using the first_check, second_check and action?

So for example I've got this limit:-

Posted Image

But what if I just combined the entire limit into one piece of code in first_check like this?
Code:
if ( player.Spm > 1150 )
	{
		plugin.Log("Logs/InsaneLimits_SPM.csv", plugin.R("%date%,%time%,%p_n%,%l_n%,%p_pg%"));
		plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Permanent, player.Name, 0, "[Auto-Admin] Your SPM is higher than 1150");
	}

return false;
Would it decrease/increase load on the layer? Or would there be no difference at all? Are there any advantages/disadvantages to combining everything into one piece of code or is it better to have things separated out into actions, expressions and code?
* Restored post. It could be that the author is no longer active.

#30
ImportBot

ImportBot

    Advanced Member

  • Friendly Neighborhood Bot
  • 52428 posts
Originally Posted by PapaCharlie9*:

Question what are the advantages/disadvantages (if any) of using the first_check, second_check and action?
...
Would it decrease/increase load on the layer? Or would there be no difference at all? Are there any advantages/disadvantages to combining everything into one piece of code or is it better to have things separated out into actions, expressions and code?

There are only two operational differences between first_check and second_check:
1) second_check executes only if first_check returns true
2) the limit object is in scope only for second_check, you can't reference it in first_check

So if you don't use the limit object, it's fine to put everything in first_check. If you leave second_check disabled, it automatically returns true if it is executed, i.e., if first_check returns true. Thus you can combine first_check code with Actions if you want.

Putting everything in code, rather than Actions, has the advantage of making all the code available in a !dump of the limit. Actions are not saved in the !dump file.

No change in load on the layer.
* Restored post. It could be that the author is no longer active.


4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users