Here we go, my first "Mod". While modifying some WebAdmin files to show player levels and such, I was thinking about ways to make use of the admin interface. It's not very clean code, but it get's the job done and could be extended to be a bit more power- and useful.
Project: AutoAnnouncer for Chat
Link
Download link and description on GitHub
https://github.com/wookiefriseur/KF2AutoAnnouncer
Category
Mod/Plugin for WebAdminInterface
Code
Javascript, HTML
Neccessary Tools
Tampermonkey, Greasemonkey, or Standalone
Difficulty
Medium, when using Tampermonkey - has to be installed, default variables have to be changed
Medium to Advanced when customising further
Screenshots
http://imgur.com/a/MgXnP
Current Features
Known Issues
Possibilities for Improvement
I'm not on friendly terms with Javascript. So imagine what people who know what they're doing could accomplish. I can see map and difficulty voting, workarounds for broken map cycle and several other autoresponder features being possible. See GitHub description and code comments for more. And I didn't even hook into the API that seems to be there. I'm just too dumb, but maybe someone else isn't. ^^
Let's have some fun as long as there aren't whitelisted mutators.
If you have problems with the installation or any questions I can try to help you.
Changes, current version: 0.9d (2015-10-20)
Project: AutoAnnouncer for Chat
Link
Download link and description on GitHub
https://github.com/wookiefriseur/KF2AutoAnnouncer
Category
Mod/Plugin for WebAdminInterface
Code
Javascript, HTML
Neccessary Tools
Tampermonkey, Greasemonkey, or Standalone
Difficulty
Medium, when using Tampermonkey - has to be installed, default variables have to be changed
Medium to Advanced when customising further
Screenshots
http://imgur.com/a/MgXnP
Current Features
- automatically post messages to your WebAdminInterface
- keep your server ranked, no whitelist needed
- set number of seconds the message will be posted at
- enter multiple messages in one textarea and set a delay for each post in addition to global cooldown
- extract variables from current site and post them to chat (advanced)
- let the bot autorespond to certain commands
- default commands are !help, !time, !insz (insult zeds), !insp (insult players), SC, FP (KF1 style sc and fp message), !status (current wave status in browser), !motd (current auto announce message)
- you can change current commands (medium difficulty)
- or add new commands and functions yourself (medium to advanced difficulty)
Known Issues
- default values can only be saved in code (Tampermonkey/Greasemonkey), when a page is reloaded they revert back to what you set in the source code.. but the browser doesn't ever reload unless you do it
- there may be functions without error handling, resulting in no issues at all or script crashes
- I had to implement the delay using a freeze / sleep.. the script and UI sleep during the wait, so don't set the delay too high (max is 10 seconds atm)
- when using FireFox there is an infopopup when you're in the wrong folder, instead of the builtin error message element with the horzine icon
- the left hand menus in FireFox and Chrome look different and some layout is different
Possibilities for Improvement
I'm not on friendly terms with Javascript. So imagine what people who know what they're doing could accomplish. I can see map and difficulty voting, workarounds for broken map cycle and several other autoresponder features being possible. See GitHub description and code comments for more. And I didn't even hook into the API that seems to be there. I'm just too dumb, but maybe someone else isn't. ^^
Let's have some fun as long as there aren't whitelisted mutators.
If you have problems with the installation or any questions I can try to help you.
Changes, current version: 0.9d (2015-10-20)
- fixed getAllMessages and the subprocesses it depended on (they were using an old version of a process that was no longer there)
- added autoresponder functionality (!help, !status, !insultplayer and stuff)
- added visual indicators for parsing status of messages
- improved some timings, JS is still not good for time critical applications
- Fixed !status command outputting wave and zeds only, instead of players too
- Changed to only auto announce when there are people on server (takes info from html, so it laggs a bit)
- Fixed script crashing by being called too often when game info updates
- Lowered reaction time of autoresponder to max 10 sec, could be lowered to max 5 if I knew how to parse received message immediately without flooding chat
- lowered autoresponder latency down to max 5 sec, should be more useful now
- fixed another crash issue
- new command: !dice <sides> - rolls a dice with x sides, if no parameter is given it rolls a d6
- new cmd: !slap <target> - slaps target with a random object, slaps everyone if no argument given
- new cmd: !dostuff <target> - forms a random action with target, target is random also if no argument is given
- changed commands !insz and !insp to !iz and !ip to ease access
- reduced some console output
- "streamlined" default messages a bit
Last edited: