Today I want to know if you are lucky or unlucky.
I do not know how it.

first time
!todaylucky
\$(user)\$(eval words = [“lucky”, “normal”, “unlucky”]; words[Math.floor(Math.random() * words.length)])

second time
!todaylucky
\$(user)I’m sorry today is already over, so I’ll do it again tomorrow.

I want you to tell me how.

I have a command for luck % and its different from you -:
\$(user) has \$(eval a=Math.ceil(Math.random()*100);if(a>50){b=`😄`;}else if(a<50){b=`🙁`;}else{b=`👍`;}`\${a}% luck. \${b}`)
This works in the following way -:
user: !luck
Nightbot: user had ( _% ) luck (emoji)
and

1. If luck% > 50
2. If luck% < 50
3. If luck% = 50

If you want lucky unlucky and normal output with luck % you can use this -:

``````\$(user) has \$(eval a=Math.ceil(Math.random()*100);if(a>50){b=` He is lucky`;}else if(a<50){b=`He is unlucky`;}else{b=`His luck is normal`;}`\${a}% luck. \${b}`)
``````

If luck% > 50 then he is lucky
If its < 50 then unlucky
For 50 he is normal.

You can change the luck range by changing the no(after a) in command.
Make changes here -: if(a>your range for lucky) and else if(a<your range for unlucky). If there is gap b/w lucky and unlucky it will be counted as normal
Use this if you want and name your command whatever you want.
However for command to work 2nd time according to your needs, someone need to edit these.

And if someone is creating his command can you please edit my commands also so that a user cant find his luck more than once in a day. Also, if he uses the commands second time then he will get the same luck % as before.

1 Like

@capricorn

Click this link. It will generate three links and two tokens, a public token (8 characters long) and a private token (16 characters long). The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after `token=` and before `&data=\$(querystring)` Copy them down and keep them somewhere safe!

I have set up 2 commands below, !luck and _luck which work in tandem to output a luck response to the user depending on whether the user has already used the command today (only !luck is meant to be used directly). Copy and paste each setup into chat one by one to add the commands. Replace `PUBLIC_TOKEN` with your public token and `PRIVATE_TOKEN` with your private token. Replace `COOLDOWN` with your desired cooldown in seconds; in your case it will be `86400`.

``````!addcom -cd=5 !luck -a=_luck \$(eval z=COOLDOWN;d=Date.parse(Date());a=`\$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/~\$(user)~\d+~/g);`PRIVATE_TOKEN`+(!a||d-parseInt(a[a.length-1].split(`~`)[2])>=z*1000?`&data=~\$(user)~\${d}~`:`e`)+` `+z)

!addcom -cd=5 _luck \$(eval d=decodeURIComponent;a=`\$(urlfetch https://twitch.center/customapi/addquote?token=\$(1))`;z=[`lucky`,`normal`,`unlucky`];d(`\$(querystring)`).includes(`PRIVATE_TOKEN`)?(a.includes(`Successfully added entry`)?`\$(user) is \${z[Math.floor(Math.random()*z.length)]}`:`@\$(user), you must wait \${d(`\$(querystring \$(2))`)} seconds until you can use this command again!`):`Use !ucd`)``````
2 Likes

Sorry I was short of my explanation.
The information I want is YouTube.

Command response for !luck and replace `PUBLIC_TOKEN` with your public token and `PRIVATE_TOKEN` with your private token. Set this as an alias of _luck

``````\$(eval a=`\$(user)~\$(time EST "M~D~Y")`;!`\$(urlfetch https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.includes(a)?`PRIVATE_TOKEN&data=\${a}`:`PRIVATE_TOKEN ~`)
``````

Edited response for _luck to fit within YouTube’s 200 character limit.

``\$(eval a=`\$(urlfetch https://twitch.center/customapi/addquote?token=\$(query))`;u=`\$(user)`;b=decodeURIComponent(`\$(querystring \$(2))`);\$(urlfetch json https://pastebin.com/raw/P4PySqhQ))``
1 Like

Thank you very much !!
By the way, I want to try other things.
Can I edit a sentence like https://pastebin.com/raw/P4PySqhQ?

Yes
Just go here.
In new paste area paste your edited command.
Then save it with a title(and don’t change other settings).