thanker

By ryan245789 on Oct 19, 2010

put into remotes on +O +A +v it thanks the person who gave it to you

on *:RAWMODE:#:{
if (+q isin $1) && ($me isin $2) {  msg $chan Thanks for the ~ $nick $+  halt }
if (+a isin $1) && ($me isin $2) {  msg $chan Thanks for the & $nick $+  halt }
if (+o isin $1) && ($me isin $2) {  msg $chan Thanks for the @ $nick $+  }
if (+h isin $1) && ($me isin $2) {  msg $chan Thanks for the % $nick halt }
if (+v isin $1) && ($me isin $2) {  msg $chan Thanks for the + $nick halt }
if (-q isin $1) && ($me isin $2) {  msg $chan Don't take my ~ $nick halt }
if (-a isin $1) && ($me isin $2) {  msg $chan Don't take my & $nick halt }
if (-o isin $1) && ($me isin $2) { msg $chan Don't take my @ $nick  halt }
if (-h isin $1) && ($me isin $2) {  msg $chan Don't take my % $nick halt }
if (-v isin $1) && ($me isin $2) {  msg $chan Don't take my + $nick halt }
}

Comments

Sign in to comment.
Sorasyn   -  Oct 19, 2010

May need Pipes (|) between your actual message and halt commands, just from looking at it, it looks like the halt will carry over into said message

 Respond  
joelp53   -  Oct 19, 2010

I have a script that does this and i have to say for me regex works better.

 Respond  
Jethro   -  Oct 19, 2010

This is my way of doing it using regex (which saves you about 600+ bytes):

on !*:rawmode:#:{
  if ($regex($1,/([+-])(q|a|o|h|v)/)) && ($2 == $me) {
    var %m = $replace($regml(2),q,~,a,&,o,@,h,%,v,+)
    msg # $iif($pos($regml(1),+,1),Thanks for the %m,Don't take my %m) $nick
  }
}

You don't really need the halt, and it's better you use the case sensitive version > === or > isincs because your script will trigger if the mode is either upper or lowercase. My example of regex is by design case sensitive unless the /i modifier is specified. The exclamation mark by the event is not to be triggered by the client running the code.

 Respond  
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.