The Challenge! Automated, Randomized Fighting Chat Game!

fight
random
chat
twitch
games

#41

After placing these files, I can see the options in the panel, but the headers are not working properly as seen below. Are you able to help me figure out this error?


#42

try to refresh the panel again please? also did you close the bot when doing it


#43

Also, which version of Phantombot are you using? these files were designed to go with 2.3.8 (Latest stable) or the Nightly builds


#44

I am on the stable (2.3.8). I did close the bot at the time. The following is the bot error I’m recieving:


#45

Version 1.6
Went crazy editing the text in the thread.
Added TheRealAlixe’s websource, and new version by Arthur’s.

Edited websource to use challenge instead of challange.
Added comments in websource to let people know what to copy.
Still in the midst of checking for other things.


#46

This script has suddenly gain lots of attention for some reason :stuck_out_tongue:


#47

@yxpoh I’m sorry for making you work hard :sweat_smile: but I can’t help being really hyped about this…

Currently cleaning/refactoring a lot of code and smoothing it out using proper setTimeout calls instead of locking up the entire bot between messages, as well as changing the language file naming convention to match Phantombot’s default convention.

I’m not changing any settings variable names, so those will all be backwards compatible, with the exception of the subcommand “settings” which I’m changing to “set” as every other game command uses. Also I will be removing “show” and will add in the current setting/usage for each individual setting as the overview can now be seen in the control panel.

I’ll make sure to give you a copy/pasta ready text to edit your main post though :wink:

We might just be able to get this into an official release at some point :grin:


#48

Haha yeah. I must say I lost the hype after I successfully got the system working enough.

Haven’t been a perfectionist, but glad that you got on board. You can try dragging the developers in here if you want :stuck_out_tongue: HAHAHA!


#49

oh ill be sure to see if i can give it a push after it passes more test to stand up to the standards of the rest of phantom bot also meaning a rename to the name file it should be to match


#50

I am starting to feel bad as the start-up of the script lol…


#51

why this is getting to be an awesome script and should be glad to be part of it :slight_smile: even if you couldnt be part of the main call me and @ArthurTheLastAncient had for a couple hours doing the panel <3 together

Please can you correct !challenge settings captions <on/off> as it is now a number not on and off


#52

Yep. That’s done.


#53

just looking though the scripts in the OP the main challenge.js is missing the reloadChallenge() function please can you update to the newest code or the panel will not work

challenge.js (12.5 KB)


#54

@yxpoh don’t feel bad…! It is and always will be your idea… To me, I just contributed and helped you build it up. I don’t want to be more than a contributor too. Which is why I put you as the original author in the info headers in the files.

edit:
Besides, if it weren’t for your base work, I probably wouldn’t have bothered/learned writing the whole thing


#55

Lol… You might have misunderstood about what I am feeling bad about.

I am not feeling bad that my idea seems to be taken away or something. I just feel like I didn’t contribute enough :stuck_out_tongue:

Instead, I am really happy that there are people that wants to be a part of it.

Anyway, updated with TheRealAlixe’s


#56

Oh you did contribute plenty, like I said, if it weren’t for your base, I probably wouldn’t have bothered. It was your base that got me inspired (And even with my bad back I’m still working on it, I’m having fun and being distracted from my physical stuff, soooo thanks :stuck_out_tongue: )


#57

I am glad you say that.


#58

Whelp… Here we go.

Version 1.7.0

Changelog (Buckle up tight, this is gonna be a bumpy ride):

challengeSystem.js (Core file)

  • Filenames changed to conventional PhantomBot names
  • Added comments explaining the functions as per PhantomBot conventions
  • Cleaned up command option parsing and added comments on each subcommand/option
  • Refactored/renamed different functions and sections of code to work with the setTimeout() delay method
  • Removed the Pause function as it’s no longer needed
  • Changed the “settings” option/subcommand to “set” to match other PhantomBot commands
  • Removed the “show” settings option and instead added the current value to the usage of each setting
  • Added subcommand “reset” with default administrator privilege to clear any ongoing challenge, as well as reload attack and dodge descriptions
  • Various minor optimizations

games-challengeSystem.js (Language file)

  • Renamed language strings to be consistent with PhantomBot naming conventions
  • Separated sections each with explanation/comments on what each section does and how to add or edit attack or dodge moves
  • Added separate language strings for each individual setting, with usage explanation
  • Removed language strings that were no longer needed

controlpanel (Configuration panel backend)

  • Fixed a typo (challange => challenge)
  • Fixed a bug where settings wouldn’t update correctly. There’s a new file to be downloaded and overwritten. Complete installation instructions are following below

Usage instructions

  • !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)

Update instructions

  • 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

Installation instructions (Easy mode)

  1. Shut down PhantomBot
  2. Download this file: challengeSystem.zip (6.4 KB)
  3. Unpack into the base directory of your PhantomBot installation
  4. If you want the control panel options, download this file: challengeControlPanel.zip (9.7 KB)
    Otherwise, skip to step 7
  5. Close any browser windows and/or tabs with the control panel opened
  6. Unpack into the base directory of your PhantomBot installation. WARNING The following three (3) files will be overwritten:
    ./scripts/core/panelCommands.js
    ./web/panel/games.html
    ./web/panel/js/gamesPanel.js
  7. Restart PhantomBot
  8. Profit!

Separate files (For advanced installation)
./scripts/custom/games/challengeSystem.js (18.3 KB)
./scripts/lang/custom/games-challengeSystem.js (6.1 KB)
./scripts/core/panelCommands.js (16.0 KB)
./web/panel/games.html (ZIP file, 3.4 KB)
./web/panel/js/gamesPanel.js (19.6 KB)

Phew, that was a long post…

edit
Of course I forgot something. Everything’s in there now. I think… :stuck_out_tongue_winking_eye:


#59

Most Active Thread HYPE


#60

Whelp, I know where the panel bug comes from. Apparently downloading/uploading the games.html file alters it and adds the random script garbage at the end of the file. Probably a site protection. I’ll make it a zip file instead.