Code Monkey home page Code Monkey logo

genshin_gacha's Introduction

Genshin Impact Wish Simulator

GitHub

DISCLAIMER

This is not sponsored in any way by Hoyoverse and I do not gain any profit from this project.

Integration to Twitch chat was made possible and easy-to-use by integrating ComfyJS maintained by @Instafluff.

INTRODUCTION

The [Genshin Wish Simulator] lets the viewers simulate a genshin wish by typing the !wish command in chat.

Sample Wish

This is my first-ever project which I have done outside of work and it is bound to have some issues. If you do happen to encounter an issue, you can contact me by visiting me on my twitch channel at https://twitch.tv/xivalex. (For reference, I speak both English and (mostly) Tagalog on-stream)

Also, I do accept (and/or request) contributions in terms of the videos that can be used for the gacha. Unfortunately.. I cannot pull for EVERY SINGLE CHARACTER OR WEAPON that can be showcased in the simulator..

Pre-requisite

Account information linked in Streamelements

Current implementation makes use of StreamElements to manage the chats and/or points. I could consider adding a version or parameter so that JWT Token will not be required if there will be a demand for it

  1. Go to StreamElements Dashboard and click the account icon in the upper-right of the display

AccountInfo

  1. In the CHANNELS tab, click the Show secrets button to display account-specific information

Needless to say, information in this section is PRIVATE and should not be shared to anyone. The Account ID and JWT Token will be required by the program to give access to your StreamElements

Secrets

Instruction

  1. In your preferred broardcasting software (e.g. OBS), add a browser source and use the link: https://xivalex.github.io/genshin_gacha

  2. The following are the URL parameters that can be used to customize the behavior of the simulator

  • [Required] jwt : Your JWT Token
  • [Required] id : Your Account ID
  • [Required] channel : Your Twitch channel name
  • volume : Adjust the volume of the video (Default: 100)
  • sr : Adjust the percentage on winning a 5★ against a 4★ (Default: 1% to get a 5★)
  • c : Adjust the percentage on winning a 3★ against a 4★ (Default: 90% to get a 3★)
  • three : Adjust the prize when user wins a 3★ (Default: 0)
  • four : Adjust the prize when user wins a 4★ (Default: 300)
  • five : Adjust the prize when user wins a 5★ (Default: 2000)
  • cost : Adjust the cost to use the command (Default: 160)
  • points : Adjust the points name used in your channel (Default: Primogems)
  • check : Output the current setting of the program in your chat
  • pity : Adjust the pity before a guaranteed 5★ (Default: 30 pity to get a guaranteed 5★)
Sample Browser Source URL

*********************************************************************
https://xivalex.github.io/genshin_gacha?jwt=<JWT Token>&id=<Account ID>&channel=xivalex&volume=50&sr=50&c=90&three=100&four=200&five=300&cost=10&points=test&check=true&pity=50
*********************************************************************

By using the sample URL, it sets the program to have:
  - Volume is adjusted to 50%
  - Winning a 5★ against a 4★ has a 50% chance
  - Winning a 3★ against a 4★ has a 90% chance
  - The Prize for 3★ is 100
  - The Prize for 4★ is 200
  - The Prize for 5★ is 300
  - The Cost on using the command is only 10
  - Points name is set to "test"
  - The above settings will be displayed in chat once you refresh the browser source
  - The Pity for a guaranteed 5★ is 50
  1. Test the program by typing !wish or !wish <1~10> in your chat. Video should load and the following is displayed in chat. If video does not load, try refreshing the browser source or re-check the parameters in the URL.

sample_output

multi_sample

Features

Queue

  • Only one wish session at a time is displayed on stream. A queue is implemented so that when multiple viewers type !wish in chat, they will be placed in a queue (first-in, first-out) while waiting for the current wish on-stream to finish

queue_sample

Database

  • Characters and weapons are saved in a database. You can check your current inventory using !wishcheck <3/4/5/charname/weapname> command

  • Information is saved to the database every minute, if there will be any connection issues during this minute, wishes are not saved. Sorry for any inconvenience

Pity System

  • Pity is the number of times the user has wished.
  • The default value is 30 and if a user has wished for atleast 30 times without any 5★, the next wish will be a guaranteed 5★

"No Gamble" system (TBD)

  • If streamer does not want to make use of StreamElements and just show a wish video on-stream

Other commands

Note: There is a 5-second delay for common commands to avoid spamming the chat

!wishqueue

  • Displays the current queue of users who typed !wish in chat
  • Usable only by Streamer and Moderators

wishqueue

!wishinfo

  • Displays the current setting
  • Usable only by Streamer and Moderators

!wishreset

  • Reset the gacha to possibly fix any issues (if gacha still does not work, try refreshing the source)
  • Usable only by Streamer and Moderators

!wishlist [3/4/5]

  • Displays all available characters and weapons
  • Usable only by Streamer and Moderators

wishlist

!wishcheck [3/4/5/charname/weapname]

  • Displays list of characters and/or weapons owned by the user and its corresponding constellation
  • e.g. !wishcheck Yanfei, !wishcheck 5

wishcheck

wishcheck-2

!wishpity

  • Displays the current pity of the user

wishpity

!wishcommand

  • Displays the list of available commands to be used

!wishconfig (TBD)

  • Lets the Streamer or Moderators to modify the settings on-stream without the need to modify the URL parameters
  • Changes done with this command are not permanent. Once browser source is refreshed, the URL parameters will take priority

Credits

@Instafluff for providing and maintaining the ComfyJS package


The following are the list Genshin Weapons and Characters and its availability in the simulator

If you want to contribute, please do inform me through my @Twitch (sorry I do not have other socials. . .)

For items with to be updated contibutor, you may still contribute a video for it

If you found your video in below and you do not want it to be used, please do inform me and I will remove it immediately. Sorry for any inconvenience.

For video contributions, some guidelines for it:

  • You can send a the whole/full wish session, but please provide timestamps so I can easily find the part I need to edit-out
  • Please do avoid having stuffs which blocks the video (e.g. chat and/or notification overlays)
  • Video should be full-screen (maybe no need for a specific resolution since I convert it anyway)
Name Rarity/Availability Contributor
Cool Steel 3★ shawners21
Harbinger of Dawn 3★ xivalex
Skyrider Sword 3★ shawners21
Ferrous Shadow 3★ xivalex
Bloodtainted Greatsword 3★ xivalex
Debate Club 3★ xivalex
Black Tassel 3★ shawners21
Raven Bow 3★ xivalex
Sharpshooter's Oath 3★ xivalex
Slingshot 3★ shawners21
Magic Guide 3★ xivalex
Thrilling Tales of Dragon Slayers 3★ xivalex
Emerald Orb 3★ xivalex
Favonius Sword 4★
The Flute 4★ xivalex
Sacrificial Sword 4★ shawners21
Lion's Roar 4★ st_krusconnected
The Alley Flash 4★
Favonius Greatsword 4★
The Bell 4★ xivalex
Sacrificial Greatsword 4★ xivalex
Rainslasher 4★ st_krusconnected
Lithic Blade 4★
Dragon's Bane 4★ st_krusconnected
Lithic Spear 4★
Favonius Lance 4★
Wavebreaker's Fin 4★
Favonius Warbow 4★ st_krusconnected
The Stringless 4★ st_krusconnected
Sacrificial Bow 4★
Rust 4★ xivalex
Alley Hunter 4★
Mitternachtz Waltz 4★
Mouun's Moon 4★
Favonius Codex 4★
The Widsith 4★
Sacrificial Fragments 4★
Eye of Perception 4★ xivalex
Wine and Song 4★
Xiphos' Moonlight 4★ xivalex
Makhaira Aquamarine 4★
Wandering Evenstar 4★ xivalex
Lisa 4★
Barbara 4★ Genshin Impact Wishes
Kaeya 4★ Genshin Impact Wishes
Razor 4★ Genshin Impact Wishes
Amber 4★ Genshin Impact Wishes
Xiangling 4★ Genshin Impact Wishes
Beidou 4★ Genshin Impact Wishes
Xingqiu 4★ st_krusconnected
Ningguang 4★ xivalex
Fischl 4★ Genshin Impact Wishes
Bennett 4★ xivalex
Noelle 4★ st_krusconnected
Chongyun 4★ Genshin Impact Wishes
Diona 4★ shawners21
Sucrose 4★ Genshin Impact Wishes
Xinyan 4★ xivalex
Rosaria 4★ st_krusconnected
Yanfei 4★ st_krusconnected
Thoma 4★ xivalex
Sayu 4★ Genshin Impact Wishes
Gorou 4★ Genshin Impact Wishes
Kujou Sara 4★ Genshin Impact Wishes
Shikonoin Heizou 4★
Yun jin 4★ xivalex
Kuki Shinobu 4★ Genshin Impact Wishes
Collei 4★ Genshin Impact Wishes
Dori 4★ Genshin Impact Wishes
Candace 4★ Kekvin
Layla 4★
Aquila Favonia 5★
Skyward Blade 5★ xivalex
Freedom-Sword 5★
Summit Shaper 5★
Primordial Jade Cutter 5★ Xeno Archive
Mistsplitter Reforged 5★
Haran Geppaku Futsu 5★
Skyward Pride 5★ Xeno Archive
Wolf's Gravestone 5★
Song of Broken Pines 5★
The Unforged 5★
Redhorn Stonethresher 5★
Staff of Homa 5★
Skyward Spine 5★
Vortex Vanquisher 5★
Primordial Jade-winged Spear 5★
Calamity Queller 5★
Engulfing Lightning 5★
Skyward Harp 5★
Amos' Bow 5★
Elegy for the End 5★
Polar Star 5★
Aqua Simulacra 5★
Thundering Pulse 5★
Skyward Atlas 5★
Lost Prayer to the Sacred Winds 5★
Memory of Dust 5★
Everlasting Moonglow 5★
Kagura's Verity 5★
Hunter's Path 5★
Key of Khaj-Nisut 5★ xivalex
Staff of the Scarlet Sands 5★
A Thousand Floating Dreams 5★
Kamisato Ayaka 5★ Genshin Impact Wishes
Jean 5★ Genshin Impact Wishes
Diluc 5★ Genshin Impact Wishes
Venti 5★ FriedRiceGod
Xiao 5★ Xeno Archive
Klee 5★ Yuan Chu
Zhongli 5★ Green
Tartaglia 5★ Genshin Impact Wishes
Qiqi 5★ Xeno Archive
Ganyu 5★ Genshin Impact Wishes
Albedo 5★ st_krusconnected
Mona 5★ Genshin Impact Wishes
Keqing 5★ shawners21
Hu Tao 5★ Yuan Chu
Kaedehara Kazuha 5★ Mashumaro
Yoimiya 5★ Yuan Chu
Eula 5★ xivalex
Raiden Shogun 5★ Genshin Impact Wishes
Sangonomiya Kokomi 5★ xivalex
Arataki Itto 5★ Genshin Impact Wishes
Yae Miko 5★ xivalex
Yelan 5★ Yuan Chu
Shenhe 5★ TheGamicissist
Kamisato Ayato 5★ Genshin Impact Wishes
Tighnari 5★ Syan
Nilou 5★ xivalex
Cyno 5★ Kekvin
Nahida 5★

genshin_gacha's People

Contributors

xivalex avatar

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.