Code Monkey home page Code Monkey logo

streamlabs_chatbot_hangman's Introduction

view a formatted version on https://github.com/mithom/streamlabs_chatbot_hangman

streamlabs_chatbot_hangman

This code is meant for use as script in streamlabs chatbot. The cloud version currently does not support scripts. You do not run this code, but import it into the scripts tab from SL chatbot.

if you like the script, you can always support me: Donate

this scripts adds the hangman minigame.

the available commands are:

  • !startHangman {word} (whisper to chatbot)
  • !startHangman {number} (whisper to chatbot)
  • !startHangman (whisper to chatbot)
  • !guess {letter}
  • !guess {word} (depending on config)
  • !guessWord {word} (other situation)

if you want to be able to use the game with random words, request an api-key at wordnik. Or mail me to get mu api-key after verification of usage.

Overlay options

They will be kept in sync in real-time

  • unsolvedWord.txt
  • turns.txt
  • solution.txt
  • usedLetters.txt
  • overlay/overlay.html

the overlay.html needs to be shown as a browser source (local file). For this to work you need to insert api key into the script by right clicking on it and selecting 'insert API_Key'. Mind! this is not the same api key as the wordnik Api Key.

Youtube compatibility mode

in the settings you can enable that !startHangman {number} can also be used in chat instead of in whisper. In addition you can fill in a word, number (or leave empty) in the settings, press save settings and then press 'start game' to start a game without the whole chat knowing the word.

lots of customisation options

  • global & user cooldown
  • command names
  • custom messages
  • min & max word length for random words
  • costs & rewards
  • max turns & what counts as turn
  • combined or separate commands
  • do/don't send info to chat that can be shown on stream
  • do/don't warn when not enough currency
  • autostart new games after previous one ends
  • do/don't use multiplier for nb occurrences of letter
  • random words retrieved from api or given file
  • color of hangman overlay
  • how long overlay lingers after finishing game
  • option to ignore already used/guessed letters
  • shown letters

requested features (in no particular order):

  • remember used words so they don't come again
  • option to lock out on wrong (word) guess
  • option to add timer before which the next guess has to happen / the words need to be found
  • add picture of streamer as head of overlay
  • option to end game if nobody found something for a while (probably not)
  • your feature request here? mail me @ [email protected]

see it in action?

streamers that are using this script:

changelog:

V 1.7.8 - thanks to GooseFuse

  • Fix dots solving the whole word bug
  • Save and load text files as utf-8 for better international support
  • Log errors instead of silently ignoring them

V 1.7.7

  • fix alpha setting for overlay color

v 1.7.6

  • fix overlay crash and wrong displaying images
  • fix randomness in chatbot
  • fix same word in same session again

v 1.7.5

  • fix youtube
  • allow to mix api & file listed words
  • allow whispering answers
  • fix ASCII issues

v 1.7.3:

  • do not reset on ascii symbols
  • ability to mix file words with api words

v 1.7.2: added shown_letters option

v 1.7.1: added option to ignore already used/guessed letters

v 1.7.0: added customisable messages

v 1.6.0: keep track of used letters

v 1.5.1: make overlay robuster in multiple ways

v 1.5.0: draw hangman as overlay (sliced for too big amount)

v 1.4.2: fix word_guess_counts_as_turn option

v 1.4.1: everything is case insensitive

v 1.4.0: add possibility to read words from file instead of api

v 1.3.0: add multiplier option

v 1.2.1: fix a lot of youtube issues + add option to remove '/me '

v 1.2.0: add 'online only option to aut_start & bugfix when no saved settings'

v 1.1.0: add option to auto start games after delay

v 1.0.3: compatibility mode for youtube

v 1.0.2: support for mixer

v 1.0.1: add max_word_length option

v 1.0.0: made public

streamlabs_chatbot_hangman's People

Contributors

goosefuse avatar mithom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

streamlabs_chatbot_hangman's Issues

Documentation help

I cannot, for the life of me, figure out how to make this work. I have the hangman_StreamlabsSystem.py script along with the overlay.html on disk on my Mac laptop. I have Streamlabs OBS set to have a browser source set to the overlay.html. I've whispered to chatbot on Twitch. I have a Wordnik API key though I understand that's not necessary for basic functionality.

I don't understand the documentation about right-clicking on the script and inserting an API key. Which script and which key?

Javascript Error in Overlay

My overlay.html is throwing a javascript exception, the overlay does not work due to this error.

I use google chrome Version 67.0.3396.87

Firefox won't trow a exception, but does not render the overlay too.

Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. at Caman.Root.Caman.Caman.reloadCanvasData (file:///D:/Stream%20Data/Streamlabs%20Chatbot/Services/Scripts/streamlabs_chatbot_hangman-master/overlay/caman.min.js:36:231) at Caman.Root.Caman.Caman.finishInit (file:///D:/Stream%20Data/Streamlabs%20Chatbot/Services/Scripts/streamlabs_chatbot_hangman-master/overlay/caman.min.js:35:6) at Caman.Root.Caman.Caman.initCanvas (file:///D:/Stream%20Data/Streamlabs%20Chatbot/Services/Scripts/streamlabs_chatbot_hangman-master/overlay/caman.min.js:28:1232) at Caman.Root.Caman.Caman.setup (file:///D:/Stream%20Data/Streamlabs%20Chatbot/Services/Scripts/streamlabs_chatbot_hangman-master/overlay/caman.min.js:28:208) at Caman.<anonymous> (file:///D:/Stream%20Data/Streamlabs%20Chatbot/Services/Scripts/streamlabs_chatbot_hangman-master/overlay/caman.min.js:19:381) at file:///D:/Stream%20Data/Streamlabs%20Chatbot/Services/Scripts/streamlabs_chatbot_hangman-master/overlay/caman.min.js:20:250

My Hangman Settings:
{"next_word": "", "guess_command": "!guess", "turn_limit_response": "the word has not been found within the turn limit, the solution was {0}", "last_letter_found_response": "{0} found the last letter {1} of the word {2} and has been rewarded {3} {4} for finishing the word.", "found_letter_response": "{0} found {1}, reward: {2} {3}.", "global_cd": 1, "hangman_color": "rgba(255,255,255,1)", "mix_api_file_word": 100.0, "send_progress_after_guess": true, "start_response": "a game of hangman has been started, start guessing now using {0} (letter)", "word_guess_counts_as_turn": true, "nb_turns": 30.0, "start_game_command": "!startHangman", "ignore_response": "{0}, the letter {1} has already been used", "progress_response": "{0}", "not_show_me": false, "api_key": "", "only_online": true, "min_word_length": 4.0, "start_game_permission": "Moderator", "use_different_guess_command": false, "end_after_x_turns": false, "user_cd": 15, "guess_word_cost": 15, "not_enough_points_response": "{0}, you don't have enough {1}, you need {2} and only have {3}", "use_multiplier": false, "vanish_delay": 10, "ignore_used": false, "max_word_length": 20.0, "max_turns_prefix": "turn {0} / {1} : ", "guess_cost": 5, "found_correct_word_response": "{0} has found the correct word {1} and has been rewarded {2} {3}.", "start_game_info": "", "shown_letters": "-", "guess_word_addition": " and {0}", "auto_delay": 5, "finish_word_reward": 50, "send_response_if_ignored": true, "letter_not_in_word_response": "{0}, {1} is not in the word, cost: {2}, {3}", "currency_name": "fritten", "no_game_running_response": "{0}, there is currently no hangman game running, pls start one using {1}", "file_name": "words.txt", "wrong_word_guess_response": "{0}, the word {1} is incorrect, better luck next time", "guess_word_command": "!guessWord", "send_message_if_not_enough_points": true, "allow_chat_message": false, "guess_vowel_cost": 15, "in_progress_response": "current game is still in progress", "auto_start_game": false, "find_letter_reward": 5}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.