Advertisement

Announcement

Collapse
No announcement yet.

Tutorial: Coding your own basic mIRC bot for your twitch channel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tutorial: Coding your own basic mIRC bot for your twitch channel

    Hello everyone, The purpose of this post is to teach you the basics of creating your own mIRC bot for your twitch channel.

    Starting Out: Connecting to your chat and making your bot

    The first thing you will need to do is go onto http://www.twitch.tv and make a new account, keep in mind this is the account that will be your bot. Once you have created and activated the account, sign out and back in to your regular account.

    Now go ahead and open up mIRC


    Once you have mIRC open the first thing you're going to want to do is make sure you're able to connect to your twitch chat as your bot. To do so first go to File and click "Select server", you will be brought to this screen. (Normally there will be a ton of default channels, I just have them removed)


    Next click "Add" you will be brought to this screen, on this screen you will put your bot name in the description, add the IRC server as "irc.twitch.tv" and then ENTER THE PASSWORD OF YOUR BOT ON TWITCH! (VERY IMPORTANT)


    After you have finished that click "Connect" in the left hand column and enter your info of your bot.


    Once you have finished entering all that info you can click OK, make sure you have selected your server on the server list, after that all you have to do is click the little lightning bolt icon and you should get a screen that looks like this. (ignore the one of my chat, won't be here for you YET)


    Just press the red X on the window that says "mIRC Favorites", we don't need to do anything there. Go to the Status window and in the text area type "/join #Inserttwitchusernamehere" so for me it would be "/join #mrsinji". This will connect you to your chat.



    Now a little helpful pointer here, If you want mIRC to automatically connect to your chat every time you connect to irc.twitch.tv click on "Tools > Options" and you will be brought back to this screen.


    Now click on Perform, enable "Enable perform on connect" then in the text box type in your join variable. For me that is "/join #mrsinji" so it would look like this. This will make mIRC automatically connect to your chat.


    Congratulations! Your bot is now in your channel and ready to be scripted.

    Basic Commands & Scripting

    Awesome, now that your bot is in your channel we can begin some basic scripting for your bot. To begin scripting click the little scroll icon on mIRC


    Once you have this open click "remote" and this is where you will be writing your scripts.

    The most basic command you can make your bot use is a simple text trigger, this is when someone says a certain line of text your bot will respond.

    This is what a sample looks like, I'll break it down in a moment.
    Code:
    on *:TEXT:!commands:#: { msg $chan My current commands are !commands !sinjiiz !mst, !norbaww, !rba, !wrongwarp !youtube !twitter !100% }


    If i were to go into my chat and type !command i would get this result


    Another example which goes a bit more in depth in this command here
    Code:
    on *:TEXT:SinjiZ:#: { msg $chan SinjiZ $nick SinjiZ }
    If i got into chat and type this i will get this message


    What is happening here is i'm applying a new variable called the "$nick" variable. This variable will replace $nick with whoevers name said the command.

    Applying Anti-Spam to a command
    Now you won't want people spamming your commands of course but how do you make that impossible?

    The idea is very simple, i wont get into details but the code you can use is as follows (Just copy/paste and adjust variables)

    Code:
    on *:TEXT:!commands:#: {  
      if ((%floodcommands) || ($($+(%,floodcommands.,$nick),2))) { return }
      set -u10 %floodcommands On
      set -u30 %floodcommands. $+ $nick On
    msg $chan My current commands are !commands !sinjiiz !mst, !norbaww, !rba, !wrongwarp !youtube !twitter }
    Simply put, The first "set -10 %floodcommands On" will stop the anyone from using the command again within 10 seconds and the second "set -30" will stop the same user using it within 30 seconds. This is essential because people could get you banned from twitch chat by spamming your bot with commands.

    The thing you have to note here is where is says "Floodcommands" change the "commands" to whatever you command is named.

    For example here is my MST command
    Code:
    on *:TEXT:!mst:#: { 
      if ((%floodmst) || ($($+(%,floodmst.,$nick),2))) { return }
      set -u10 %floodmst On
      set -u30 %floodmst. $+ $nick On
    
    msg $chan MST Stands for Medallions, Stones and Trials.  This category aims to complete the game as fast as possible as well as collected all the Child Stones, Adult Medallions and completing the trials in Ganons castle. My Person Best in this category is 2:40:38 }
    I will continue to update this guide later, I have to leave right now.
    Personal Bests
    Ocarina of Time
    MST-J - 2:35:15
    Any%-J - 23:30
    No RBA/WW-J - 1:44:16
    100%-J - 6:58:09

    Majoras Mask
    Any% (English) - 2:24:29

    Grand Theft Auto III
    Any% - 1:49:22

    sigpic

  • #2
    sick sinji thanks!!!!
    sigpic

    Comment


    • #3
      Great guide, looking forward for more, thanks.

      Comment


      • #4
        Great place to go for .mrc scripts.

        Just a little resource I use for my "IAmTAS" framework.

        Having your own bot is nice though, you can have features and commands that aren't available on the usual bots. My bot framework is currently on quite a few channels, nice to help out my friends who also stream.
        My Twitch.TV | Leave a follow

        Comment


        • #5
          Sinji should update this
          My stream
          Personal Bests
          Spyro the Dragon
          Any% - 1:10:53

          Comment

          Working...
          X