Need help with Ghost guessing game for my stream with Phasmophobia

Hi everyone.
Been seeing some folks have a !guess command on their stream, and people will put !guess [ghost] at beginning of hunt, and then at end of hunt, they can then show who guessed right.

I have a basic system, that lets them enter it, it goes to a list, but then I have to pull up list and manually see who guessed right.

I believe they are using the quote system to do this, but I cant figure it out.

This is what I have so far. (have removed my tokens and put in private or public)

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

!guesswinners
$(eval q=decodeURIComponent($(querystring));c=$(urlfetch json https://twitch.center/customapi/quote/list?token=Public Token&data&no_id=1).split(|);u=;g=;w=;for(i=0;i<g.length;i++){isNaN(c[i])?u.push(c[i]):g.push(c[i]);}if(isNaN(q)){r=Enter the bonus amount.}else{n=g.reduce((a,b)=>Math.abs(b-q)<Math.abs(a-q)?b:a);for(j=0;j<g.length;j++){if(g[j]==n){w.push(u[j])}}r=With a guess of ${n}, the winners are: ${w.join( )}. Congratulations!}r)

I am new to this and just copy and pasted a thing for casino numbers, so guessing that is part of it.

When I type !guesswinners Wraith, it will come up and say Enter the bonus amount, so guessing there is a behind the scenes thing I need to add, and change the writing a little.

Thanks for any help

Try:

!guess

$(eval $(urlfetch https://twitch.center/customapi/addquote?token=TOKEN&silent=1&data=$(user)|$(querystring)|)) $(user): guess registered.	

!guesswinners

$(eval q=decodeURIComponent(`$(querystring)`); c=`$(urlfetch json https://twitch.center/customapi/quote/list?token=TOKEN&data&no_id=1&clear=1)`.split("|"); w=[]; for(i=0;i<c.length-1;i+=2){if(c[i+1].trim().toLowerCase() === q){w.push(c[i].trim())}} r=w.length>0?`The winners who entered "${q}" are: ${w.join(", ")}. Congratulations!`:`No winners were found who entered "${q}".`; r)

Worked perfect, thanks Niq

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