mIRC identifyer not working correctly

By Ari Anne Sorensen on Nov 28, 2014

Hey guys :)
Hope some of you can help me out on this... I am currently scripting my Twitch bot, and one of the functions needs to be simply changing some the command from to output through the bot (to avoid giving 30 people mod/editor rights in for multi-gaming community stream channel, we work with authorized broadcaster stream keys). I have made abreviations ( such as !gameLL) so I can just turn to my members and let them type in that so that the game played is spelled correctly etc, just easy usage basically.

Just to make it clear, I am linked to the Twitch account (broadcaster) through mIRC and the command works perfectly fine, aka the channel name will be changed, however I would only like specific people to edit this - and at the moment everyone that is a registered user can use the command. However - If i only have one user in line 2, it works, so I am guessing it has something to do with || ?

Example:
[01:18:45] warfrogable: !gamesc
[01:18:45] tawtv: !game StarCraft II: Heart of the Swarm
[01:18:45] nightbot: tawtv -> Game updated to: StarCraft II: Heart of the Swarm

Here's my script:

on 1*:text:*:#: {
  if ($nick == Taw_Sloan || Xariannii) {
    if ($1 == !gameLL) {      msg $chan !game League of Legends    }
    if ($1 == !gameSC) {      msg $chan !game StarCraft II: Heart of the Swarm    }
    if ($1 == !gameWW) {      msg $chan !game World of Warcraft: Warlords of Draenor    }
    if ($1 == !gameCH) {      msg $chan !game Company of Heroes 2    }
  }
}

I have currently set it up for these four games, way more to come. Would highly appreciate it if anyone could help me fix this so that only the specific people can use this command. Even better if someone had a script to change the current game played, as this one basically commands TAWTV (broadcaster) to send out that specific message, so that Nightbot will edit it.

Thanks in advance!

Comments

Sign in to comment.
Colten45   -  Nov 29, 2014

The easiest way for me to make this easy for you is to use regex, will look like if ($regex($nick,/(Taw_Sloan|Xariannii)/g) == 1) { }

Now what you are asking about is if ($nick == Taw_Sloan) || ($nick == Xariannii) {}

Can be cheated to do if (($nick == Taw_Sloan) || ($v1 == Xariannii)) {} that way it's always pointing back to the last number 1 parameter in the condition. TOP down left to right in to out can get confusing real fast.

OR with tokens if ($findtok(Taw_Sloan|Xariannii,$nick,124) isnum) {} OR if ($findtok(Taw_Sloan|Xariannii,$nick,124) != $null) {} OR if ($istok(Taw_Sloan|Xariannii,$nick,124)) {}

warning these have their draw backs. You will reach a limit of how many nicks you can manually enter if you're not doing just raw if () || () || () | () {}

Using hash tables,inifiles,binary files can increase this size and can be easily coded to "enter" a new nick to be able to use it etc. There are tricks and cheats and so many ways you can do something like this from very basic to advanced. I could see fordlawnmower or jaytea coming in here and posting what would look alien to the both of us at first sight.

Ari Anne Sorensen  -  Nov 29, 2014

Thanks! :) I will have a look at this and see how it goes. Do you reckon that there's a way to easily add people to this list, or more like create a group of users which can be added to and use something like ($nick == usergroup1)

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.