thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: FlagStats  (Read 4146 times)

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
FlagStats
« on: October 29, 2010, 10:20:59 PM »
This plugin as been made to show flag stats.
It counts the time between the flag is taken and the flag is capture.
It counts the number of flag captures by player.
At the map end it shows the best flag capturer by team and his best time.
This version requires parser iourt41 v1.5.0 or above


http://forum.bigbrotherbot.net/downloads/?sa=downfile&id=46
« Last Edit: December 12, 2011, 05:19:05 PM by Beber888 »
Python, Php, UrT SourceCode

Offline grosbedo

  • Former Dev. (senate)
  • Sr. Member
  • *****
  • Posts: 258
Re: FlagStats
« Reply #1 on: October 30, 2010, 01:19:05 PM »
Hello Beber,

Ive made some updates to your plugin, to extend its functionnalities and to make it supported by other games than UrT (EVT_GAME_FLAG_RETURNED is no more needed and actions are more generic).

Most notably, Ive included some guidelines to make any parser support this plugin.

As I do not own all the games that are supported by B3, if someone is interested by this plugin for another game than currently fully supported one (ie: UrT and OpenArena), I can try to include the support for your game but you'll have to test it.

Here is the changelog of my changes :

Code: [Select]
2010-10-22 - v0.5.1 - GrosBedo
 * fix a small bug when no flag is captured and issuing a !flag
2010-10-23 - v0.6.0 - GrosBedo
 * added support for oa081 and generic flag_taken event
 * added !topstat
 * adapted config parsing and commands to the last convention
 * shortened a LOT messages spawned by this plugin
 * separate_awards setting to show CTF awards for all teams at once or separated
2010-10-25 - v0.6.1 - GrosBedo
 * Reworked the code
 * Added more stats (flag taken and flag returned)
 * Removed the FlagStats Class, stats are now normalized and accessible as standard variables (use playerinfo.py to list them)
2010-10-26 - v0.6.2 - GrosBedo
 * a few bugfixes
 * added flagcarrierkill stats
 * added Best Defender award which is flagreturns + flagcarrierkill
2010-10-26 - v0.6.3 - GrosBedo
 * Reworked the code a lot, decreased the number of lines and cut code redundancy
 * Management of teams events is now more generic
 * Stats are now erased at round start, instead of round end
 * Added Def stat (flagreturns + flagcarrierkills) and Best Defender Award
2010-10-28 - v0.6.4 - GrosBedo
 * Fixed a little bug that made !topflags pm results to the wrong player (or pm when it should be public awards show)
2010-10-29 - v0.6.5 - GrosBedo
 * Fastest Cap award is now converted into hours, minutes and seconds if necessary
 * Fixed a few bugs
 * Added instructions in the Readme to implement compatibility for Flagstats in parsers
2010-10-30 - v0.6.6 - GrosBedo
 * EVT_GAME_FLAG_RETURNED is really no longer needed for a parser to be supported by flagstats
2010-10-30 - v0.6.7 - GrosBedo
 * Fixed a small bug in show_awards that made it be repeated twice (at the end, and at the beginning of next map)

Beber, if you agree, I can update your plugin with this version in the download section, and move it from UrT to the general repository.

You can find it attached to this thread if you're willing to test it out.

[attachment deleted by admin]
« Last Edit: October 30, 2010, 06:07:53 PM by grosbedo »

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: FlagStats
« Reply #2 on: October 30, 2010, 06:09:07 PM »
Ok I will try it now, i will tell you if you can update after test
Python, Php, UrT SourceCode

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: FlagStats
« Reply #3 on: October 30, 2010, 06:19:17 PM »
When people capturz a flag the console show :

Quote
101030 18:14:35   VERBOSE   RCON sending (127.0.0.1:27960) Jonix^3 captured ^5<b3.clients.ClientVar object at 0x01A9F450>^3 flag in ^510.80^3 sec
101030 18:14:36   VERBOSE   RCON sending (127.0.0.1:27960) tell 6 ^1(^5Zebulon^1)^7: ^3[pm]^7 ^3Jonix: New personnal record for flag capture ! (^510.80^3 sec)
Python, Php, UrT SourceCode

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: FlagStats
« Reply #4 on: October 31, 2010, 01:28:56 AM »
I find :

You have to replace
Quote
flagcaptured = client.var(self, 'flagcaptured', 0)
by
Quote
flagcaptured = client.var(self, 'flagcaptured', 0).value
.

Your modifications are very great !!
I'have not finish to test all the event but it look like very good.

When you have tested have you find an error of time (for exemple : sometime at the 1flag captured the bot say that you have capture the flag in 898.6 seconds....

I never found why an error like that because I init value of timer when we are in ctf !!
Python, Php, UrT SourceCode

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: FlagStats
« Reply #5 on: October 31, 2010, 05:52:32 PM »
New version of flagstats, with modifications by grosdebo and corections of some and improvement.

Tell me is some problems

http://www.bigbrotherbot.net/forums/downloads/?sa=view;down=46
Python, Php, UrT SourceCode

Offline grosbedo

  • Former Dev. (senate)
  • Sr. Member
  • *****
  • Posts: 258
Re: FlagStats
« Reply #6 on: November 01, 2010, 03:15:41 PM »
When you have tested have you find an error of time (for exemple : sometime at the 1flag captured the bot say that you have capture the flag in 898.6 seconds....

I never found why an error like that because I init value of timer when we are in ctf !!

No I never found such a bug neither, but this should not happen anymore anyway, I changed the default value from 999 to -1, and added a few more conditionnal cases to handle this new behaviour.

Quote
New version of flagstats, with modifications by grosdebo and corections of some and improvement.

Ok, cool ! :) I will try it out on my production server as soon as Ive finished to update a few more plugins ;)

Offline grosbedo

  • Former Dev. (senate)
  • Sr. Member
  • *****
  • Posts: 258
Re: FlagStats
« Reply #7 on: November 01, 2010, 03:42:55 PM »
Ok I updated the package with the readme (you inadvertently removed it, but it contains instructions to implement support for your plugin in other parsers), I added the conversion of seconds into minutes for best time beat too, I updated the description of the download and finally I moved it into the general 3rd Party plugins category, since it is not anymore only aimed at UrT.

Offline Beber888

  • Moderator
  • Sr. Member
  • *
  • Posts: 179
Re: FlagStats
« Reply #8 on: November 01, 2010, 04:03:16 PM »
Fine i'll try your new new last version...
Python, Php, UrT SourceCode

 


Rate this page +1 at Google Search

anything