I have a command for luck % and its different from you -: @RokettoJanpu made this command -:
$(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
If luck% > 50
If luck% < 50
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.
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`)
Yes
Just go here.
In new paste area paste your edited command.
Then save it with a title(and don’t change other settings).
Fill Captcha.
Then you will get your saved file.
Copy the link and add /raw after https://pastebin.com
(Your edited link will look like this https://pastebin.com/raw/P4PySqhQ)
Use the edited link in your command.