mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2015
Posts: 15
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Feb 2015
Posts: 15
I'm trying to make a subscriber hype for Twitch that displays a different message when the number of months is greater or equal to 12. I would imagine it would be pretty easy.

on *:TEXT:*subscribed*:#:{
if ($nick == twitchnotify) { msg $chan Thanks for subscribing $1! }
}


I know it would be something like: if ($4 >= 12) {msg $chan More than a year! PogChamp } else ...sub hype...

but I am not sure where to put it in regards to the original sub hype.

Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Something like

Code:
on *:TEXT:*subscribed*:#:{
  if ($nick == twitchnotify) { 
    if ($4 >= 12) msg $chan More than a year! PogChamp 
    else msg $chan Thanks for subscribing $1!
  }
}
?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2015
Posts: 15
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Feb 2015
Posts: 15
Yes, thank you smile

Joined: Aug 2015
Posts: 16
A
Pikka bird
Offline
Pikka bird
A
Joined: Aug 2015
Posts: 16
a much easier way to do this would be

Code:
if (this) && (that) {

}

Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
No, because the first condition has priority, we want the second if/else to be inside that if statement, using && ,you would have to add the first condition each time and you couldn't use the logical else statement, since it would enter the else statement when the nick is incorrect.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard