Help Randomizing Nightbot Reply in YouTube

So, I have been trying to find a way to randomize a reply from Nightbot in my YouTube chat. Everything I find is Twitch…
What I want to do is:
1 - Create a a custom file that can be done as a webpage (php maybe?) and then number each entry in that file. (Example - random jokes)
2- Have a command to have Nightbot pick a random number and then read out that slot of messages when I call on the command.
I have tried and researched for hours on this forum, and have found out-dated API’s… I think I need to know how to make an API, can ANYONE please :pray: help me?

Any help is appreciated :heart:

Separate your jokes by ; and upload them to https://pastebin.com like this: https://pastebin.com/raw/3EswB51V

Then enter this into your chat (replace my raw Pastebin link with yours):

!commands add !randomjoke $(eval jokes = `$(urlfetch json https://pastebin.com/raw/3EswB51V)`.split(";"); jokes[Math.floor(Math.random() * jokes.length)])

You can use a different character to separate your jokes as long as you change ; in the command.

1 Like

Thank you so much, I will try that!!! You are amazing!

Only other one that I wanted help with was creating a command for people to be able to play Slots in my room. So having your regular SPIN for 3 emojis and there are some that hit, I do not know if there is a script that already exists for that or not, but if there is, I would be eternally grateful. My viewers love playing these games and if I can make it more entertaining for them then great.

Solutions for the Slot Machine idea anyone? I can not find tutorials anywhere… Twitch stuff everyone, not for YouTube!

Just switch the emoji to whichever you want to use (separate them by spaces). If you pick too many, the chances of winning will be very low.

!commands add !emojislots $(eval e="👓 🕶 👔 👕 👖 🧣 🧤 🧥 🧦 👗 👘 👙 👚 👛 👜 👝 🎒 👞 👟 👠 👡 👢 👑 👒 🎩 🎓 🧢 ⛑ 💄 💍 🌂 💼".split(" ");function r(){return e[Math.floor(Math.random()*e.length)]}r()+" "+r()+" "+r())

I will probably only use 6 different ones total… so I just delete the other ones from the list you sent?

And for some reason, I am having issues getting my bot to pick up on who wins. So if someone wins, do I need to set a separate command to have bot give them coins through fussbot? I know I am asking a lot… But I am just trying to understand this…

Yes, just use however many emoji you want.

Sorry, I’m not familiar with that bot, and I don’t have a YouTube chat to test with. But it looks like that bot has a !reward channelid amount command. So the Nightbot command could just type that command in chat when the slots player wins.

Before I try adding that to the command, could you first try out this command and tell me if it works:

!commands add !rewardtest !reward $(userid) 100
1 Like

Yes, it rewarded me with coins. When I did the command.

What about this?

!commands edit !rewardtest !reward $(userid) 100 EXTRA MESSAGE

Does it still reward the coins when I add that message to the end?

No. It did not reward after that. With Fussbot you have to do !reward USER amount in that order. If that helps any…

That means that when a user wins the slots, then they won’t actually see which emoji they won with. All they will see is Nightbot typing “!reward ID 100”. Are you okay with that?

Yes, I am fine with that. As long as they get the reward im good… But they will get to see the 3 Emojis on the screen though, right? it will look like :cherries::cherries::cherries: or :cherries::tangerine::strawberry: Correct? I just want to make sure they can see something…

No. Only viewers who lose would see the emojis.

Ok. then there may be ONE other possibility… IF there is a match… instead of a reward… I can have the otherbot issue the reward… but if the match occurs, nightbot can reply with “Slot Win USER” and that will trigger a reward command either through nightbot OR fussbot… I know that is adding to the complexity of it, but I am fine with that.

I don’t think that bot is complex enough to do something like that. That bot has a $ADDCOINS(numberhere) variable, but it only works for the viewer that executed the command. Also, that bot doesn’t appear to have a way to separate a message into parts.

1 Like

Either way, it is fine. I have seen other rooms that have it do it, so there is something between the bots, but again I am basically asking you to visualize it. You have helped me more than anyone else has, you solved my main questions, and it brings the game to my room, so I appreciate that. I will work on getting the Emojis added in, I will update how it goes… Thank you @am_1 - You are very appreciated!!!

we havent figured out the command in total to add rewards to the winner…

Introducing SLOTS into YOUTUBE LIVE CHAT and Nightbot and/or Fussbot

I am having a hard time… I am trying to get an Emoji Slots game on YouTube Live Chat with Nightbot. I have used paste bin, but I want it to respond with:
USERID (then the 3 emojis) (if the 3 match id like it to send command to reward the user with say 300 coins)
So… it would show up like this:
Nightbot - Christin :heart: :heart: :heart: You Win!
That would then trigger a reward from Fussbot… so it would !reward Christin 300
Fussbot !reward Christin 300
But I am not sure how to get this implemented, someone had me to do a line in Nightbot where I entered slots, but I had the emojis in the command line… not in Pastebin where it pulled a result, but we never figured out how to get the reward to the winner, and that is what I am having a hard time with… so that may be PHP scripting or pastebin? I can show you my pastebin file so you can see how I set it up and maybe help me add in from there?
I will include the command line that was offered to me.

**!commands add !emojislots $(eval e="👓 🕶 👔 👕 👖 🧣 🧤 🧥 🧦 👗 👘 👙 👚 👛 👜 👝 🎒 👞 👟 👠 👡 👢 👑 👒 🎩 🎓 🧢 ⛑ 💄 💍 🌂 💼".split(" ");function r(){return e[Math.floor(Math.random()*e.length)]}r()+" "+r()+" "+r())** This was the command line listed to me.... 

Then the pastebin I used is this… https://pastebin.com/NQSmhwYJ
That is what I have… 2 different ways…
So now I am trying to get it to respond to the winner, we never got to that point…

Can someone help me? Please! I would be very appreciative!
Christin

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