Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [SSGM+BRenBot Plugin] AFK Detector v2.0
[SSGM+BRenBot Plugin] AFK Detector v2.0 [message #450218] Wed, 27 July 2011 17:27 Go to previous message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma:
General (4 Stars)
This plugin is an AFK detector for SSGM, with a plugin for BRenBot (although other bots using renlog can be made to support it). It checks whether someone is AFK via both their score and their position. Inside afk_detection.ini you can configure the waiting time (interval) before a new AFK check and the amount of score that needs to be gained in between check intervals for a player not to be marked as AFK (this is the 'score_threshold' setting).

The plugin doesn't do anything when there's only one player in-game. There's an option to disable checking score if Power Plant and/or Refinery is down. And an option to PM a player if he's marked AFK (but it won't do any kicking).

The plugin marks a player AFK during a check when first:

-He hasn't gained points (with the threshold logic taken in account and the option to disable checking points when PP/Ref is destroyed).
-When his position hasn't changed within a small renefeet threshold.
-If his facing hasn't changed.

And if he doesn't do any of the following:
-When he hasn't fired any shots.
-Doesn't speak.
-Doesn't enter or exit a vehicle.
-Doesn't purchase anything.

The plugin outputs the following at most to renlog (the BRenBot plugin relays this to the admin channel), this is what's shown when EVERYTHING hasn't changed:

[AFK] PLAYER's score(X, count: X) position(count: X, near BUILDING) shots fired with infantry(count: X) facing(count X) hasn't changed.

Another example:

[AFK] PLAYER's position(count: X, near Power Plant) score (X, count: X) facing(count: X) shots fired(count: X) hasn't changed.

Where 'PLAYER' is a player name, 'count' is the count of consecutive times that score or position haven't changed (this means they get reset if position/score change appropriately). 'BUILDING' is the name or acronym of the building they're closest too, if it's the same team as the player. And where 'X' is a number.

Installation:

1. Edit afk_detector.ini to your liking.
2. Place afk_detector.ini and afk_detector.dll inside your FDS folder (where SSGM is located in).
3. Edit SSGM.ini and add an entry for 'afk_detector' under the [Plugins] section of that file.

Optionally, to add BRenBot support:

4. Place afk_detector.xml and afk_detector.pm inside the BRenBot\plugins folder.

Credits:

Reborn (the guy) - The 'closest building to player' logic is taken from his commander plugin.
(gen)Blacky - Based the BRenBot plugin on something similar he made.
zunnie - Helped me find a scripts.dll function I needed.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Thu, 25 August 2011 18:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Search Hud Yet another D6 Hud
Next Topic: Helios' Scripts.dll 2.9.2/3.4.4 installer
Goto Forum:
  


Current Time: Sun Jun 09 04:20:40 MST 2024

Total time taken to generate the page: 0.00879 seconds