Milenco's Plugin Pack v1.5

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Milenco's Plugin Pack v1.5

Post by Milenco » 28 Jan 2010 13:12

Introduction
Some time ago I began writing plugins for XAseco. My old page can be found here. However, as more and more plugins were created, it became harder to install and maintain all these different files. To solve this problem, I created this Plugin Pack which contains most of my previous plugins as well as some new ones.

This way the installation contains only two files and configuration of all plugins can be done in one place. All plugins can be enabled or disabled manually in the config section of the plugin. Also, all plugins have extensive configuration options.

I hope you enjoy this pluginpack!

Available plugins & commands
Commands:
/activity - Shows the average number of players on this server.
/aft - Away From Trackmania (same as /afk, only different message).
/avg - Displays a list of averages times on the current track. Include average time, number of finishes and difference with pb.
/clan - Displays a server chat message with link to clan website (disabled by default).
/clear - Erases chat and chatlog from memory (not from logfile.txt) so other players can't view sensitive information, when needed. Only works for Admin+ (can be configured).
/duke - Display a server chat message with random Duke Nukem quote.
/duke [1-total] - Display a server chat message with specified Duke Nukem quote.
/duke help - Display a help window with Duke Nukem quote-list.
/finishes - Display a personal chat message with your number of finishes on the current track and your server total finishes.
/finishes [player] - Display a personal chat message with number of finishes on the current track and server total finishes of specified player.
/forceplay [player] - Forces a spectating player into racemode. Only works for Operator+ (can be configured).
/google [keyword] - Displays a server chat message with searchlink to Google.
/me2 [text] - Alternative to /me
/pbs - Displays a personal chat message with your top 5 (if available) personal best times. Also shows date and time of record(s).
/pbs [player] - Displays a personal chat message with top 5 (if available) personal best times of specified player. Also shows date and time of record(s).
/played - Displays a list (top 100, if available) of your most played tracks.
/played [player] - Displays a list (top 100, if available) of specified player most played tracks.
/specced - Displays a list (top 100, if available) of your most spectated tracks.
/specced [player] - Displays a list (top 100, if available) of specified player most spectated tracks.
/topfinishes - Displays a list (top 100, if available) of people with the most finishes on the entire server. Also displays total finishes on the entire server.
/topfinishes track - Displays a list (top 100, if available) of people with the most finishes on the current track. Also displays total finishes on the current track.
/topkarma - Displays a list (top 100, if available) of people who casted the most votes on the entire server. Also displays total votes on the entire server.
/topplayed - Displays a list (top 100, if available) of tracks with the most combined playtime. When 2 people play a track for 5 minutes, combined playtime is 10 minutes.
/topplayers - Displays the top 100 most active players on this server.
/topspecced - Displays a list (top 100, if available) of tracks with the most combined spectate-time. When 2 people spectate a track for 5 minutes, combined spectate-time is 10 minutes.
/topspeccers - Displays the top 100 most active spectators on this server.
/whoplayed - Displays a list (top 100, if available) of people with most playtime on the current track. Also shows track total combined playtime.
/whokarma - Displays a list of what people voted (++ or --) on the current track.
/whospecced - Displays a list (top 100, if available) of people with most spectate-time on the current track. Also shows track total combined spectate-time.

Slap plugin:
-/acid [player] - Displays a 'acid' server chat message.
-/block [player] [object] - Displays a 'block' server chat message.
-/burn [player] - Displays a 'burn' server chat message.
-/catch [player] [object] - Displays a 'catch' server chat message.
-/crash [player] - Displays a 'crash' server chat message.
-/dildo [player] - Displays a 'dildo' server chat message.
-/donut - Displays a 'donut' server chat message.
-/duck [player] [object] - Displays a 'duck' server chat message.
-/face [player] - Displays a 'face' server chat message.
-/fail [player] [object] - Displays a 'fail' server chat message.
-/genius [player] - Displays a 'genius' server chat message.
-/giggle [player] [object] - Displays a 'giggle' server chat message.
-/hello [player] - Displays a 'hello' server chat message.
-/hide - Displays a 'hide' server chat message.
-/hug [player] - Displays a 'hug' server chat message.
-/hurt [player] - Displays a 'hurt' server chat message. (disabled by default)
-/laugh [player] - Displays a 'laugh' server chat message.
-/kill [player] [object] - Displays a 'kill' server chat message.
-/kneel [player] [object] - Displays a 'kneel' server chat message.
-/loser [player] - Displays a 'loser' server chat message.
-/pity [player] [object] - Displays a 'pity' server chat message.
-/poke [player] - Displays a 'poke' server chat message.
-/protect [player] [object] - Displays a 'protect' server chat message.
-/seek [player] - Displays a 'seek' server chat message.
-/slap [player] - Displays a 'slap' server chat message.
-/spank [player] - Displays a 'spank' server chat message.
-/spit [player] [object] - Displays a 'spit' server chat message.
-/sorry [player] [object] - Displays a 'sorry' server chat message.
-/wink [player] [object] - Displays a 'wink' server chat message.

Plugins:
Antishout - Triggers a jfreu badwords action (warning/kick) when people shout (use lots of capital letters) in the server chat. Triggers badwords action on minimum letters, minimum capital letters and/or capital letters percentage (can be configured). (plugin is disabled by default)

Changelog
v1.5 (8-may-2010)
- New plugin: /topplayers (shows the top 100 most active players).
- New plugin: /topspeccers (shows the top 100 most active speccers).
- New plugin: /me2 (Alternative to /me).
This plugin replaces logins or numbers (get using /players) by nickname.
Example: "/me2 says hi to woutere and 2".
Becomes: "DRS Milenco says hi to DRS Bonzai and DRS Timmy".
- Added plugin usage messages to INFO on EndRace (can be disabled and modified).
- Plugin /topplayed, /topspecced, /played and /specced now have clickable tracks to jukebox.
- Plugin /topplayed, /topspecced, /whoplayed, /whospecced /played and /specced now show
an error message instead of an empty window on no result.
- Plugin /topplayed, /topspecced, /played and /specced now only show tracks in tracklist.
- Plugin /specced and /played have a total playtime counter included.

v1.4 (30-apr-2010)
- Moved settings to separate XML file.
- Check for new version on startup.
- Checks if XAseco version is over v1.09 to run.
- New plugin: /forceplay <login> (opposite of /admin forcespec) (thanks Max!).
You can specify the required admin-level for this plugin to work.
- New plugin: /aft (Away From Trackmania) (same as /afk, only different message).
- New plugin: /activity (shows average number of players on this server).
- New plugin: /topspecced (shows top spectated tracks).
- New plugin: /whospecced (shows top spectating players on current track).
- New plugin: /specced <login> (shows top spectated tracks for specified login).
- Plugin /whokarma now supports undef.de's new Karma-Plugin.
- Plugin /avg now has an option to ignore 25% best and worst times (enabled by default).
- Plugin /topplayed now also shows playtime activity (see above) at the end.
- Plugin /hurt disabled by default because of abuse potential.
- Added extra fields to save creation date and playmode on table 'challenges_playtime'.
- Both play-time and spec-time are written as seperate values to database.
- Previous collected playtime data is now unusable because of extra information added.

v1.3 (10-mar-2010)
- Added 'days' in all other counters in /played, /whoplayed and /topplayed
- Added sanity-check before writing playtime to database for /played, /whoplayed and /topplayed
- Removed setting where spectators would not have playtime added
- Added slaps: /fail, /kneel, /pity, /spit, /wink, /giggle and /sorry
- /pbs, /finishes and /played now accept offline players as parameter (online was already available)

v1.2.2 (14-feb-2010)
- Added 'days' in total counter in /whoplayed and /topplayed plugin

v1.2.1 (6-feb-2010)
- Some minor bug-fixes

v1.2 (6-feb-2010)
- Removed custom MySQL connection so pack uses XAseco's internal SQL connection.
This caused a crash when using a command which needed the custom connection, when
connection got timed out.
- Added new slap: /seek.

v1.1 (31-jan-2010)
- Changed plugin: /played is now /whoplayed.
- New plugin: /played (Shows top 100 list of most played tracks of specified player).
- Added setting to specify /duke return line.
- Added setting to specify /google return line with nickname (colors included).
- Added setting to specify /pbs return line with nickname (colors included).
- Added setting to AntiShout plugin to set punishment level. Default is 0.5.
This means players only get a warning every two 'hits'.
- Added Stunts gamemode support for /pbs and /avg commands.

v1.0d (29-jan-2010)
- Fixed critical bug where challenges_playtime table would not be created
- Oops: /duke messages were only send to player instead of main chat. Fixed.

v1.0c (29-jan-2010)
- Changed /clan plugin so requester name can be parsed in color
- Fixed some small bugs

v1.0b (28-jan-2010)
- Changed anti-shout plugin to recognize special capital characters (like ËÂÚ)
- Fixed some Trackmania font code ($w $000, etc.) issues when applying to return lines

v1.0 (28-jan-2010)
- First public release
- Added extra table 'challenges_playtime' to xaseco database to log
player playtime on tracklevel (can be disabled)
- New plugin: /played (uses new table 'challenges_playtime')
- New plugin: /topplayed (uses new table 'challenges_playtime')
- New plugin: /clan (disabled by default)
- New plugin: /clear
- New plugin: /duke
- New plugin: Anti-shout (disabled by default)
Note: Works even when badwords in disabled.
Note: If used in combination with jfreu badwords filter,
player will be warned twice when cursing in capitals.

v0.9 (26-jan-2010)
- Added total finishes to topfinishes plugin
- Some minor bugfixes in finishes and topfinishes plugin
- Added score-date in pbs plugin
- Made slap plugin more unisex compatible for female players

v0.8 (25-jan-2010)
- Converted the following plugins to the plugin pack:
-averages
-finishes and topfinishes
-topkarma
-whokarma
-pbs
-google
-slap

Installation
1. Download the plugin here.
2. Extract the plugin.milenco.php file into your xaseco root folder.
3. Add "<plugin>plugin.milenco.php</plugin>" (without the quotes) to plugins.xml (in xaseco root folder).
4. Open milenco.settings.xml with your favorite text editor and change the settings to your wishes.
5. Restart XAseco.
6. Enjoy the plugin!

Screenshots
Image
Average, Played and Topplayed plugin

Image
Duke and all the Slap plugin slaps

Image
Topfinishes, Finishes, Topkarma, Whokarma, Antishout and some other plugins.

Credits and compatibility notes
Credits:
-The antishout plugin triggers a jfreu's badwords action. All credits for this action go to jfreu, obviously.
The antishout plugin works even when jfreu's badwords filter is disabled.
The plugin triggers 2 actions (warnings/kick) when: 1) jfreu's badwords plugin is enabled and 2) people curse in capital letters.
-The Duke Nukem plugin was Basti504's idea. He created (but I think never published) it for Aseco last year. I got his blessing for porting this plugin to XAseco.
-The slap plugin originally was x0r (admin at Under The Minute/Kreukelzone) his idea. He and fastfwd originally created this plugin. I remade it and added some extra slaps.
-The aft plugin was DRS Timmy's idea
-The forceplay was partly created by DRS Max

Compatibility notes:
-All plugins only work in Trackmania Forever
-I've tested these plugins on TrackmaniaServer_2009-08-01 and XAseco v1.10. However, this pack should work on all TMF dedicated servers and all XAseco versions >1.09.
Last edited by Milenco on 07 May 2010 21:26, edited 23 times in total.
Image

User avatar
TheM
Pit Crew
Pit Crew
Posts: 286
Joined: 25 Feb 2009 16:43
Owned TM-games: TMU(F), TMN(F), TM2
Location: Brabant, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by TheM » 28 Jan 2010 13:30

Nice one Milenco :)

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Milenco's Plugin Pack

Post by Ant » 28 Jan 2010 15:54

Very nice work man, I got one problem though. The clan plugin doesn't seem to be working properly for me, I have this in the config part:

Code: Select all

	//Clan plugin (Displays a link in chat to clan website)
	// Enable this plugin? Options are 'true' or 'false'.
	$mpp_clan_enabled = true; 
	// Change the website URL
	$mpp_clan_url = "http://walesxxx.awardspace.com/";
	// Change the website name
	$mpp_clan_name = "$w$f00XXX";
	// Change the return line with the following options:
	//  {1} = Website URL (link).
	//  {2} = Website name (link to URL).
	//  {3} = Website name (plain text).
	//  {4} = Requester name
	$mpp_clan_result = "{#server}>> {#highlite}{4}{#record} suggests the clan website: {#highlite}{2}!";
All that gets returned in game is:

Code: Select all

>> XXX-Ant suggests the clan website: !
Is there anything wrong that I have entered ??

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by Milenco » 28 Jan 2010 16:00

You should apply the colorcoding in the $mpp_clan_result line. Because I used double quotes " instead of single quotes ', PHP think your color is a variable. I have changed this and uploaded v1.0b. This is how your config should look:

Code: Select all

  //Clan plugin (Displays a link in chat to clan website)
   // Enable this plugin? Options are 'true' or 'false'.
   $mpp_clan_enabled = true; 
   // Change the website URL
   $mpp_clan_url = 'http://walesxxx.awardspace.com/';
   // Change the website name
   $mpp_clan_name = 'XXX';
   // Change the return line with the following options:
   //  {1} = Website URL (link).
   //  {2} = Website name (link to URL).
   //  {3} = Website name (plain text).
   //  {4} = Requester name
   $mpp_clan_result = '{#server}>> {#highlite}{4}{#record} suggests the clan website: $w$f00{2}{#highlite}!';
Replace the double quotes with single quotes and move the color-coding to $mpp_clan_result. That should work :)
Image

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Milenco's Plugin Pack

Post by Ant » 28 Jan 2010 16:20

Ok, I get the link with that now, but all is shown in green, no red XXX :(

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by Milenco » 28 Jan 2010 16:23

XXX-Ant wrote:Ok, I get the link with that now, but all is shown in green, no red XXX :(
What do you exactly want, the entire line in red?

Try this:
$mpp_clan_result = '{#server}>> $w$f00{4} suggests the clan website: {2}!';

Otherwise my above code should show only the XXX in red.

{#server}, {$record}, etc. are build-in colorformats. If you want to use custom colors, be sure to add those after these build-in colorformats.
Image

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Milenco's Plugin Pack

Post by Ant » 28 Jan 2010 16:45

ok I used the code that you showed me while you were on my server, and it works nicely now :thumbsup:

EDIT--> It works now with this code man. Decided to use white colour for the message in the end.

Code: Select all

$mpp_clan_result = '>>{4} $z$fffsuggests the clan website: $w$f00{2}';
Last edited by Ant on 28 Jan 2010 22:02, edited 1 time in total.

dukez30
sunday driver
sunday driver
Posts: 59
Joined: 23 Aug 2008 14:26
Owned TM-games: TMU

Re: Milenco's Plugin Pack

Post by dukez30 » 28 Jan 2010 19:24

Ok nice work :thumbsup: , i had most of these plugins already so i obviously had to disable them, but i have a strange error:

[PHP Warning] Invalid argument supplied for foreach() on line 474 in file C:\Users\PC1\Desktop\Xaseco 1.10\plugins\plugin.milenco.php.

[01/28,19:58:55] [MPP] Error: Could not insert row in table challenges_playtime!



:ftw:

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by Milenco » 28 Jan 2010 22:44

dukez30 wrote:Ok nice work :thumbsup: , i had most of these plugins already so i obviously had to disable them, but i have a strange error:

[PHP Warning] Invalid argument supplied for foreach() on line 474 in file C:\Users\PC1\Desktop\Xaseco 1.10\plugins\plugin.milenco.php.

[01/28,19:58:55] [MPP] Error: Could not insert row in table challenges_playtime!



:ftw:
Obviously this should not happen. What did you configure in the plugin? Could you send me your version of plugin.milenco.php in PM so I can examine it? Also, what version of Xaseco and PHP are you using?
Image

dukez30
sunday driver
sunday driver
Posts: 59
Joined: 23 Aug 2008 14:26
Owned TM-games: TMU

Re: Milenco's Plugin Pack

Post by dukez30 » 28 Jan 2010 23:56

Using PHP 5.2.6.6 and Xaseco 1.10, also i havn't changed anything at all in your code.

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by Milenco » 29 Jan 2010 01:01

Okay, I've added some fail-safes. Could you re-download the plugin and try again?

BTW, you say you didn't change anything at all in the code. Does this mean you are using the default plugin settings? (just asking so there is no misunderstanding)
Image

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by Milenco » 29 Jan 2010 17:54

I think I finally found the real problem: The database wasn't created at startup, so it couldn't write the playtimes. I noticed it on another server of mine, it should be fixed now :)

Anyone _not_ having problems with my plugin? :? (if so, please re-download first)
Image

dukez30
sunday driver
sunday driver
Posts: 59
Joined: 23 Aug 2008 14:26
Owned TM-games: TMU

Re: Milenco's Plugin Pack

Post by dukez30 » 29 Jan 2010 17:56

Ok replaced with your updated version,and yes im using everything as default, so far no errors :thumbsup:

again nice work.

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Milenco's Plugin Pack

Post by Ant » 29 Jan 2010 18:01

Well, I haven't updated since your last post, but I am having no problems - only edited things for the clan plugin as you suggested before.

User avatar
Milenco
happy cruiser
happy cruiser
Posts: 150
Joined: 07 Oct 2008 09:38
Owned TM-games: TMN, TMNF
Location: Enschede, Netherlands
Contact:

Re: Milenco's Plugin Pack

Post by Milenco » 29 Jan 2010 18:16

Oke good news. :) I released this plugin a little too fast without proper testing, so a few critical bugs were still in the code. As we speak I found another bug where the extra table isn't created properly (I'm working on it now, but I have to leave the computer in a bit). I'll update the plugin and edit this post when I fixed it! :)

Edit: Fixed and re-uploaded. :)
Image

Post Reply