mIRC Home    About    Download    Register    News    Help

Print Thread
Testing for two things at once (if this and this) #254448 11/08/15 09:17 AM
Joined: Feb 2015
Posts: 15
B
bwttruman Offline OP
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.

Re: Testing for two things at once (if this and this) [Re: bwttruman] #254453 11/08/15 02:42 PM
Joined: Jul 2006
Posts: 3,728
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,728
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!
  }
}
?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Testing for two things at once (if this and this) [Re: Wims] #254459 11/08/15 07:23 PM
Joined: Feb 2015
Posts: 15
B
bwttruman Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Feb 2015
Posts: 15
Yes, thank you smile

Re: Testing for two things at once (if this and this) [Re: bwttruman] #255872 28/11/15 11:08 PM
Joined: Aug 2015
Posts: 16
A
acpixel Offline
Pikka bird
Offline
Pikka bird
A
Joined: Aug 2015
Posts: 16
a much easier way to do this would be

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

}

Re: Testing for two things at once (if this and this) [Re: acpixel] #255877 28/11/15 11:45 PM
Joined: Jul 2006
Posts: 3,728
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,728
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net