NightDev Community Forums

Custom Command Help


#1

I really want to make a command, maybe someone can help me better understand so I can make them myself. I want a command that will give me a random number from an assortment of predetermined numbers. Something like

Giawiigi: !Length
Nightbot: Giawiigi has run 13 yards!

The 13 yards is the part that I want interchangeable. Any/all help is appreciated!


#2

Try using a Custom API that others have posted on the forum like `

Here is a custom thing that will fit what your looking for. Change the numbers in defstart= and &defend= to anything you want.

!commands add !length Giawiigi has run $(customapi http://2g.be/twitch/randomnumber.php?=defstart=1&defend=100) yards!


How to generate random number
I would like to make a command that does a random percentage
#3

Is there a way to make it say the name of whoever announced the command?


#4

Replace Giawiigi in the above command example with $(user)


#5

I love you. What is the fastest way to contact you? I may be asking you a LOT more questions like this <3


#6

The forum is the best way to ask a question of this nature.


#7

Hi there, I’ve been looking for something like this and I love it! thing is I want my generator to be in the range of 100-1000 problem is that it is generating numbers below 100… can this be fixed? Bare in mind I’m using this code in a timer so when there is a flurry of active chatters in my chat I’ve set up a reward timer as follows - CONGRATULATIONS VIEWERS! For being awesome you have all received $(customapi http://2g.be/twitch/randomnumber.php?=defstart=100&defend=1000) currency name!


#8

There needs to be an “&” sign before ‘defstart’ in the URL if the lowest number is anything higher than 1.

So the link for picking numbers between 100-1000 will look like this:
http://2g.be/twitch/randomnumber.php?=&defstart=100&defend=1000


#9

There does NOT need to be an “&” sign before ‘defstart’ in the URL

http://2g.be/twitch/randomnumber.php?defstart=-100&defend=100

Would output a number between -100 to 100. :joy:


#10

If you need to change the range of numbers just change the defstart= (Definite Start) number and the defend= (Definite End) number.


#11

Thank you for the swift reply. I’ll try it out when I get home to confirm the results.


closed #12