mIRC Home    About    Download    Register    News    Help

Print Thread
Subscriber Announcer. #248137 22/09/14 06:59 PM
Joined: Sep 2014
Posts: 5
Q
QarlssonQ Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Q
Joined: Sep 2014
Posts: 5
Aight, so im trying to make my bot announce in chat when someone subscribes.

This is the script that im using.
Quote:

on *:TEXT:just subscribed!:#: {
if ( $nick == twitchnotify )
msg $chan Welcome $nick and thank you for subscribing!
}


I have done the /raw twitchclient 3, so i do see the Twitchnotify usernamn announce that $nick subscribed. But it still wont announce it in chat.

Re: Subscriber Announcer. [Re: QarlssonQ] #248139 22/09/14 07:47 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
No idea if the condition is actually correct. But most obvious fault is that you're not specifying it to only work when $nick is twitchnotify.
Well, that and your script is only ever triggered when the text is exactly "just subscribed!". Specify it to allow wildcards both before and after the sentence if you want it to work.

Also, assuming that twitchnotify is the nick that gives you this message, you would simply welcome that bot several times over since you're using $nick and not $3 or wherever the real user is placed in the message.



Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Subscriber Announcer. [Re: Nillen] #248140 22/09/14 09:38 PM
Joined: Sep 2014
Posts: 5
Q
QarlssonQ Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Q
Joined: Sep 2014
Posts: 5
Probably should have typed that im a total noob when it comes to mirc, new at this.

Dosent this line specify
Quote:
if ( $nick == twitchnotify )
that only when Twitchnotify sends a msg that the script will start?.


Re: Subscriber Announcer. [Re: QarlssonQ] #248147 23/09/14 06:08 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Yes. But you have no brackets which implies that the action should only occur when your condition is met.
Code:
if (something == something) do something
if (something == something) {
do something
do something again
}
These are valid ways to do it


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Subscriber Announcer. [Re: QarlssonQ] #248206 27/09/14 09:17 AM
Joined: Mar 2014
Posts: 65
E
Exuviax Offline
Babel fish
Offline
Babel fish
E
Joined: Mar 2014
Posts: 65
Originally Posted By: QarlssonQ


This is the script that im using.
Quote:

on *:TEXT:just subscribed!:#: {
if ( $nick == twitchnotify )
msg $chan Welcome $nick and thank you for subscribing!
}





So here is the problem with your script, you currently are not allowing mIRC to see anything in-front of the message "just subscribed!" so your bot is actually looking for Twitchnotify to say "just subscribed" and not "username just subscribed" it is an easy fix

Code:
on 1:text:*subscribed*:#:{
  if ($nick == twitchnotify) { 
    msg # /me Welcome $1 and thank you for subscribing!
  }
}


Also, another thing you will notice I changed. The $nick relates to the Username of the person who triggered the event, so $nick would (in this case) be "twitchnotify" so unless you want to thank "Twitchnotify" a hole bunch, use $1 to direct your bot to reply with the first word in the sentence, which in this case is the username!

Also, side note, when you place * in the identifier field it means that there could be more text before the thing you are looking for, so take a sentence like this

"Hey, I really love cheese"

You want your bot to say "So do I" when it sees someone says "I really love cheese" if you simply did

Code:
on *:text:I really love cheese:#: {
msg # So do I!
}


The bot would /only/ respond when the user only says "I really love cheese" since I said "hey," before and "!" after, we want to make it more dynamic, so instead we would use * and factor the code like this

Code:
on *:text:*I really love cheese*:#: {
msg # So do I!
}


Now, if I said "Hooppahoopa hopeey doope I really love cheese doope duppa dee" the bot would still respond as I said "I really love cheese" in that sentence. Hope that makes sense!

Last edited by Exuviax; 27/09/14 09:19 AM.

I do things with stuff that makes other things do stuff.