A guessing ghost game

Hey guys,

I was wondering if anyone could help me out with as im trying to get a command to work where everyone will put in a guess like “spirit, oni, poltergist, etc.” plus what room the ghost is in and for them to be only able to enter in their guess once for stream but so far I cant find the info I need to make this store inside a list with first command and with the second command have the mods be able to enter in say “Oni in bathroom” it can tell me who guessed correctly from the first command

Edit: i’ve worked out how I’m going to get people to add their guesses and i’ll get the mods to monitor the list to ensure that nobody cheats the list

To add and remove guesses I plan to use the quote system

$(eval z=`$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(user)|$(querystring)|)`;`$(user): guess registered.`)

$(eval z=`$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`;`Guesses cleared.`)

The only thing i cannot work out is how to get nightbot to announce all the people that have guessed it right without going through the list manually

Thanks in advance

Hey @hoodlumkira!

For that you’ll have to fetch the quote list, then make an array, look at each elements and get the usernames of the ones who guessed it right:

$(eval q=`$(query)`.toLowerCase().split(` `); g=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.toLowerCase().split(`|`); u=[]; for(i=0;i<g.length-1;i++){if(g[i].includes(q[1])&&g[i].includes(q[2])){u.push(g[i-1])}} `Congratulations to ${u.join(`, `)} for guessing it right!`)

Quick notes:
Your mods can enter the items (hopefully no more than a word) in any order, but there shouldn’t be any word in between:
:white_check_mark: !commandName creature room
:white_check_mark: !commandName room creature
:x: !commandName creature is in room
In case the room or the creature is more than a word long, put it in last, only the first word of the 2+ will be used:
!commandName creature 2+_words_room
!commandName room 2+_words_creature
If both are more than a word long it won’t work.
Don’t include adjectives to complete the name of a creature or a room.
If you think this will be too much of an issue, I can write you a work around.

If you want to have an automatic control of how many guess people enter, you can, here’s an example:
Note: the reason why I wasn’t sure it would work was because I cut at /addquote, if you cut after
?token= I’m sure it works.

Also here’s a similar topic as yours: Casino guesses!

Thanks alot for your help Emily :grin: I’ve managed to get it all working thanks to you :grin:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.