I’ve been playing around with writing Twitch bots for a while now, and I figured I learned just enough that I could create a little video series on the topic. I’m not a professional developer, but I think my videos would be helpful to people new to scripting who want to give it a shot. When I am learning a new language, I like to work towards some goal rather than just learning syntax and whatnot. My goal here was to create a Twitch bot which lets users play a slot machine in chat.
In the end we will have the following commands available to you and your users:
- !dance
- !danceparty (admin)
- !bet
- !cash
- !addStats (admin)
- !playslots
You can see the entire series here
You can download the TechaSlots Twitch bot here
Here is a complete rundown of the video series.
Twitch Bot Tutorial Setup
Before we get starting learning about writing a Twitch bot, we need to setup our environment. We go over creating your account, logging in, installing mIRC, and setting up multiple mIRC bots.
Twitch Bot Tutorial Lesson 1
Our first scripting lesson for writing a Twitch bot. We go over comments, events, how to write to the channel, and check if a user is an admin.
Twitch Bot Tutorial Lesson 2
In this video we go over aliases, how to read and write to ini files, and how to concatenate strings.
Twitch Bot Tutorial Lesson 3
In this lesson we go over timers, and we create the setStats and addStats alias.
Twitch Bot Tutorial Lesson 4
Is this lesson we add the !bet command and create a useMoney alias which goes over the isNum, round, inc, and dec commands.
Twitch Bot Tutorial Lesson 5
In this lesson we create the !playSlots user command which uses the rand command, a while loop, and we learn about dynamic variables.
Twitch Bot Tutorial Gotchas
If you are used to programming in other languages, you might get tripped up on some of these gotchas like I did.