Ah, the timeoutsec typo was my bad ^^;
Anyways, I took version 1.5 and tinkered a bit more as I kinda like the captions option, though I still like to be able to show at least some of the fight. I will call this version 1.5.1. I have made the following changes to the code:
challenge.js (11.4 KB)
- Added a proper header with credits and link to (this) source thread
- Changed “captions” option to an integer, allowing for a maximum of shown battle captions. Set to 0 to disable captions entirely. Made changes to the fight code to be able to skip the captions once the maximum is reached.
- Added automatic conversion for the captions option from earlier versions. Previous “on” defaults to 4.
- Added chat indicator for when the maximum number of shown captions is reached
- Added protection to set options to values less than 0 (and max 100 for attackRate)
- Changed default permission to change settings to moderator level, instead of admin (Previously set permissions are saved automatically and won’t be altered. Thanks to TheRealAlixe for the info)
- Fixed a bug where having only one attack or dodge move would cause an infinite loop
- Overall code cleanup
games-challenge.js (4.2 KB)
- Added “challenges.maxcaptions” for maximum captions indication
This is becoming quite the addon, thanks to everyone for the contributions and additions!