Hi Yoshiro here again.
A game script I made after learning a bit here and there. Download is just after “Installation Instructions”.
With many people’s help, the script is currently capable of saving settings to the database and also changable via the subcommand of !challenge. If the chat gets too clog up by the script, captions can be turned off to allow only the result while points can be waged for the fight(On by default.) Details are as below.
@ArthurTheLastAncient: Bugs, features and all sorts of other stuff were truly done by him. Thank him for all the convenience feature made for it.
yxpoh: Just the base game and some small stuff
@TheRealAlixe: Web UI and a few bug fixes
Credits: The changes to the script has reached a point where I only did the base of the system.
@TheRealAlixe and @ArthurTheLastAncient have been contributing lots of stuff to the script itself.
Also, kudos to @UsernamesSuck for giving multiple comments and suggestions initially.
Example of it:
(You do not see the reply because I used the control panel to execute the reply statement as below)
Just throwing this out here for those that wants to give it a try.
Installation instructions (Easy mode)
- Shut down PhantomBot
- Download this file: challengeSystem.zip1 (6.4 KB)
- Unpack into the base directory of your PhantomBot installation
- If you want the control panel options, download this file: challengeControlPanel.zip1 (9.7 KB)
Otherwise, skip to step 7
- Close any browser windows and/or tabs with the control panel opened
- Unpack into the base directory of your PhantomBot installation.
WARNING The following three (3) files will be overwritten:
- Restart PhantomBot
- Make sure PhantomBot is running
- type into (twitch)chat: “!module delete ./custom/games/challenge.js” (Don’t worry, this is because the file is renamed. Your settings won’t be touched)
- Shut down Phantombot
- Delete .\scripts\custom\games\challenge.js
- Delete .\scripts\lang\custom\games-challenge.js
- Continue with installation instructions
Version 1.8.2 (Updated Files only)
challengeSystem.zip (7.3 KB)
challengeSystem.zip (16.6 KB)
More Details: The Challenge! Automated, Randomized Fighting Chat Game!
Format to change settings: (Editable from web as well) (Will be updated soon)
!challenge - Challenges another user to a fight
!challenge set - Base settings command, displays all options changeable through the command
!challenge set minDamage - Sets the minimum damage for an attack
!challenge set maxDamage - Sets the maximum damage for an attack
!challenge set attackRate - Sets the success (hit/miss) rate of an attack
!challenge set health - Sets the starting health (HP) of each player
!challenge set timeout - Sets the time the challenger has to accept the challenge in seconds
!challenge set wager - Sets the bet/wager to fight for. Set to 0 to disable the use of currency
!challenge set messageInterval - Sets the seconds of delay between messages in chat.
!challenge set captions - Sets the maximum of attack/dodge descriptions to show. Set to 0 to go straight to the results
!challenge reset - Resets the challenge module and reloads all data. Use it when you change attack/dodge descriptions and don’t want to restart your bot, or when you want to clear an ongoing challenge. (Does not affect settings)
Adding new move sets
Follow the format of ‘challenge.fight.’ or 'challenge.dodge.’ where * is a set of continuous number you can see in the file.
$1,$2,$3 are required in fight, while $1,$2 are required in dodge,
(where $1=attacker, $2=defender, $3=damage dealt.)
Note: Ensure that * is always continuous, as it will keep all other numbers that are off the consecutive list.
For anyone who do tried my game, please give me your views on it too.
Changelog: (Will update when ready)
- Added check if challenged user actually is seen before by the bot with appropriate language string.
- Added check if pointSystem is enabled before checking wager/currency, will issue a log.warning if the pointSystem is off and disable any wager functionality. (But does not touch the current wager setting)
- “!challenge set wager” won’t allow changing of wager if the pointSystem is disabled and informs the user of this with appropriate language string. Setting of wager is still doable from the control panel, although it won’t have any effect.
- Cleaned up some language strings
- Accidentally included my custom moves in the last update. Restored the original moveset.
- Bugfixes by @ArthurTheLastAncient
- Fixed a bug where you could challenge yourself, including sassy message
- Added User Cooldown/Recoverytime option in Minutes.
- Added the appropriate language lines
- Added the new setting to the control panel
Version 1.7 and earlier (Will be making a quick summary. I hope.)
-Too much to keep track. Thanks to @TheRealAlixe and @ArthurTheLastAncient.