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