 Hey friends, Flare here, and tonight we're going to use Streamer Bot to build a random D&D character generator for your Twitch channel. Let's get into it. I made a video a few weeks ago, I'll link to it up here, that featured a dice rolling effect that I built in Streamer Bot, and you all seem to like it quite a bit, so I've been making a few more D&D inspired effects for my channel. This one will randomly choose the three core building blocks of a D&D character. These are race, class, and background. By doing so, we'll also learn how to use Streamer Bot to randomly choose an option from a list or file, and also how to use variables within your Streamer Bot actions. The first thing I did was prepare the actual lists of options for each component. I did some digging among some of the many websites out there that aggregate D&D rules and options and found decent lists of the three things that I wanted the bot to choose from. Using these, I made three nice clean text files, with one option on each line in each file, one file for races and subraces, another file for classes, subclasses, and a third for possible character backgrounds. Next, I set out to do the main task of randomly choosing one item from each list and then compiling those choices into some kind of output. For simplicity, we'll just output some text to chat for this example, but ultimately I ended up pushing it all out to an on-screen element in my overlay as well. To get started, I made a new action named D&D character. The first sub-action reads one line randomly from the file of races. We right-click and choose Add Sub-Action, File, Read Random Line from File, and in a dialog that appears, we choose our file of races. We leave all the other options alone here. Before going further, I want to take a minute to show you something that I find really useful in longer and more complex Streamer Bot actions. Adding comments. I'm going to go ahead and make comments that describe the gist of what this action is doing. Right-click, select Sub-Action, Comment, and then just type whatever we want. These sub-actions don't actually do anything, they just make the action more readable when you come back three months later and need to figure out what the fork you did to set this up in the first place. They also help us keep on task when building the action now. Okay, now we get back to building the actual action. In this first section, which we can now see has the comment, Get a Random Line from our list of races, we do just that. Now we want to store that random line in a variable that's easy to reference later. Through this, we want to use the Set Argument Sub-Action, which we find by right-clicking, choose Add Sub-Action, Logic, Set Argument. And in the dialog that appears, we want to name our variable in the first box and put the value in the second box. In this case, the value we want is that random line we read, which we can access with an existing variable, Random Line, what was generated by the Read Random Line from File sub-action we used earlier. When you see a keyword with a percent sign before and after, that's a variable in Streamer Bot. Click OK and now the random race that was selected is stored in a variable named D&D Race. Now we want to do the same two steps for each of the other sections. We read a random line from our list of classes, store that result in a variable called D&D Class. We read a random line from our list of character backgrounds and store that result in a variable called D&D Background. The only difference here is that when we're storing the random line, we need to access it using Random Line 1 and Random Line 2 instead of just Random Line. Technically, we could do all of this without the extra steps of storing the results in new variables, but I find this to be much cleaner. And like I said earlier, I like to focus on making it so that it's easier to update and maintain when I come back to it in four months and say, I wrote this crap. Now we should have all three pieces of information we want in order to build our random D&D character. So let's output it to chat. Right click, select Add Sub-Action, Twitch, Send Message Channel, and put together a message. However we want to format it using the D&D Race, D&D Class, D&D Background variables. Boom, done. And there you have it. A random D&D character generator built using Streamerbot. I personally use this as a Channel Point Redemption and I pop up the results and are part of my overlay, but you can tinker with this and adapt it however you like. I eventually want to roll stats and randomly generate a name for these characters as well, and maybe I'll do a video series slowly enhancing this feature until we've got a full character sheet or something. Let me know in the comments if you have other suggestions or additions, something you think would be cool to add to this, or if you've used this to build something yourself, I'd love to check it out. I built the original version of this in my stream a few weeks ago and I've been trying to sneak it in Just Chatting Stream once in a while where I built something new for my channel. So come check that out, I'll put the link. I hope you enjoyed this video and please remember to spread love, not hate.