Help with *eval* [specific responses]

Hello guys, how are you all?
I saw this command in a few posts and I couldn’t understand very well, because my english is horrible. I tried it anyway and now I’m here.
I want to use a eval command in my stream that when a specific number is choosen it’s typed a specific response:
$(eval Math.floor((Math.random() * 100))

When typed:
0 - “response a”
50 - “response b”
66 - “response c”
77 - “response d”
99 - “response e”
100 - “response f”.

If that is possible, someone can help me? Or if there is a way to do it.
Thank you and have a nice day :smiley:

Hey @loldest159!

Pretty sure you’re talking about this post:

It’s pretty simple, create a Pastebin (create an account first so you can go back an edit the paste later) with the following data:

  "die": 100,
  "responses": {
    "0": "response a",
    "50": "response b",
    "66": "response c",
    "77": "response d",
    "99": "response e",
    "100": "response f"

Then copy/paste the command they wrote, replacing XXXXXXXX with the id of your paste.

$(eval z=decodeURIComponent;const a=z("$(querystring $(user))"),{die:b,responses:c}=JSON.parse(z("$(querystring $(urlfetch json")),d=(a=>Math.ceil(Math.random()*a))(b),e=((a,b)=>{const c=Object.keys(a).map(Number).sort((c,a)=>a-c);for(const d of c)if(b>=d)return a[d];throw new Error("responses")})(c,d);`${a} rolls the D${b} and hits a ${d}. ${e}`)
1 Like

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