mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2015
Posts: 1
N
Mostly harmless
OP Offline
Mostly harmless
N
Joined: Apr 2015
Posts: 1
Code:
 on $*:text:/(Hi|Hello|Hiya|Hiya guys|Hi guys|Hello all|Hi all|Hello guys)$/i:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return } && ($nick == nick)

  set -u10 %flood On
  set -u900 %flood. $+ $nick On


  { msg $chan Hi $nick }

}

elseif ($nick != nick)

 set -u10 %flood On
  set -u900 %flood. $+ $nick On


  { msg $chan Different message for this specific person here }

}

Hello, I have this script. It is a script built to greet people who enter a channel, with flood prevention measures so that it only works every 10 seconds and every 15 minutes per nick. However, I am trying to implement a feature so that it responds differently to one nick. I have attempted to do so above using if and elseif statements, but for some reason it is not working as I anticipated it to. Could somebody please help me determine why?

Thanks! : )

Last edited by Noah1267; 26/04/15 03:41 AM.
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Just FYI, (Hi|Hello) is going to cover all the other phrases including Hiya|Hiya guys|Hi guys|... etc.

http://regexr.com/


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
if ($nick == SpecialGuy) msg $chan Hey $nick $+ ! You're a special guy.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Originally Posted By: Raccoon
Just FYI, (Hi|Hello) is going to cover all the other phrases including Hiya|Hiya guys|Hi guys|... etc.

http://regexr.com/


Not with the $ there

Joined: Jan 2014
Posts: 107
M
Vogon poet
Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
Originally Posted By: Noah1267
Code:
 

elseif ($nick != nick)




  { msg $chan Different message for this specific person here }

}



change the ref object ("nick" in this case) to the persons actual user name and it should work.

Example:

Code:
elseif ($nick != majeye)




  { msg $chan Majeye is one heck of a guy! }

}


This should yield:

"Majeye is one heck of a cool guy" upon entering your chat, or in response to a specific word I typed, or however you set it up initially, and would only work for me since you specified 'majeye' as the reference object.


Link Copied to Clipboard