I’m trying to make a custom IQ command that picks random numbers for the user. The thing is, I want floor/ceiling to be different for me than everyone else. I found a custom API that generates the number, it works except is doesn’t run the specific api for me vs other users. My code is here:
I know the if/else recognizes my name because it shows the different emoji, but the custom API isn’t showing right as I’m getting numbers outside the range I’m supposed to be in for my username.
Update: I didn’t realize that the code I pasted here just doesn’t work at all, and I seemed to have deleted the code that was working to an extent. Nonetheless, my problem is still the same. How do I get the if/else statement to grab the specific api based on the user that types the command?
Okay, I’m back to the original code I had, but it still doesn’t work the way I’m looking for. I’ll paste it below, and I’m not going to mess with it until someone else that is better at this does. It won’t let me repost the actual API, but it is the same as the original post.
!editcom !iq
$(eval
if (‘$(user)’ === “CWBibbs”)
{“$(user) has an IQ of $(customapi PogChamp”}
if your api is just getting a random number, i’d just get the random number in the code, should also give a slightly faster command response as nightbot won’t have to go bother the api and wait for the response… i’d make it look something like…
$(eval a=“$(user)”;b=300;c=150;d=" PogChamp";if(a.toLowerCase()==“cwbibbs”){b=69;c=1;d=" LUL"};e=Math.floor((Math.random()*(b-c+1))+c);a+" has an IQ of "+e+d)
of course a is the user, b is the highest random number (which if i read that right u wanted 300 highest for others and 69 highest for u), c is lowest random number (which if i read that right u wanted 150 lowest for others and 1 lowest for u), d is the emote choice and e is where it calculates the random number
yeah, for some reason it changed some of the quotes to a different kinda character just go to the quotes around $(user) and around cwbibbs delete them and type a quote back in… also put an exclamation before the double == so it says !== and u’ll be all set