Version 1.45 done by TheRealAlixe
Permissions can be set from web UI for settings sub-command
Version 1.45 done by TheRealAlixe
Cool game as I have seen other bots have something similar, 1 thing I have noticed is that when you set the timeout to say 180 for 3 mins it works until you stop and restart the bot (for example when your pushing a module/nightly/full update), then it will return back to the defaulted 60 seconds
Wierd that shouldnt be happen cus its ony set as $.getSetIniDbNumber which will get it but if its not there it will set it then get what was just set and it doesnt seem to do that to me and im on the nightly build… but i have a bug that doesnt force you to use a number as setings that im about to fix
challengeGame.js (11.2 KB)
fixed the bug above
I found the reason. Updated on the latest version 1.46.
Thanks for reporting it.
Did you fix it with my fix too or do i need to re do it too???
Yes, you need.
$.inidb.set(‘challengeSettings’, ‘timeoutSec’, parseInt(optionValue));
At the global/class variable, it was ‘timeoutsec’
there buddy fixed it with the must be a number for the ones that need it <3
challenge.js (11.2 KB)
Wait when you say your fix, do you mean the subcommand? It’s already included in version 1.46 if that’s what you mean.
no this Kappa it let u do none numbers for thinsg that should be numbers
Okay. Added yours as version 1.5, converted to my naming convention.
Ya sorry i just like to keep the names in order like the way that phantom bot does itself well 75% of them
Np. It’s also just my preference to keep my naming simple
But seriously, the thread just got so crowded suddenly. LOL!
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!
Thanks and the info for the mod or admin is automatically saved no need to have a save for that… and thanks for the newest update
EVERYONE Please keep in mind you may have to remove this table if you are updating just as a heads up
Thanks to a suggestion of TheRealAlixe I’ve added a new option “messageinterval” to control how fast battle captions/messages appear in chat.
usage: !challenge settings messageinterval (seconds) (Default: 5)
challenge.js (12.1 KB)
- Added messageinterval option, with settings command
games-challenge.js (4.5 KB)
- Added messages for the new setting option “messageinterval”
- Added missing usage for “timeout” option
Time for me to add this to my games area on my panel for the settings … i will post it here after but will have to add it to your own as i have a few different ones to my panel already
Added to my web panel if anyone else would like it just post here and ill teach you how to put it on yours too … you can also just discord if thats easier to contact me on
I would love to:
#1 learn how to add this to the panel
#2 adapt that to add things to the panel in the future.
Please teach me!
I can upload the files for you to replace the original ones, here you go:
Remember to turn off your bot before and restart it after replacing the files. You’ll find the web folder in your Phantombot’s base directory
If you want to learn how to make these additions to the control panel yourself, I’m afraid you’ll have to get into HTML coding, as there’s currently no simple way to add in separate files.