Channel Check On Join

By LuminolBlue on Dec 13, 2011

This little script will tell you what channel(s) a user is on when he/she joins your room. The channel information is echoed to you. For example:

  • Joins NickName (ident@Some-ISP.com) #Chan
  • NickName is on: #Chan1 #Chan2 #Chan3
alias channelcheck {
  if ($1 == $null) { /echo -at *** Invalid Command. Format: /channelcheck on|off. | halt }
  if ($1 == on) { /enable #channelcheck | /echo -at *** Channel Check now set to ON. | halt }
  if ($1 == off) { /disable #channelcheck | /echo -at *** Channel Check now set to OFF. | halt }
}

#channelcheck on
on !*:JOIN:#: {
  %channelcheck = on 
  %channelcheckchan = $chan 
  whois $nick 
}
raw 319:*:if (%channelcheck) { .echo -t %channelcheckchan *8 $2 is on 4*9*12* $3- 12*9*4* | unset %channelcheck | halt }
raw 311:*:if (%channelcheck) { halt }
raw 312:*:if (%channelcheck) { halt }
raw 313:*:if (%channelcheck) { halt }
raw 317:*:if (%channelcheck) { halt }
raw 318:*:if (%channelcheck) { halt }
raw 310:*:if (%channelcheck) { halt }
raw 301:*:if (%channelcheck) { halt }
#channelcheck end

Comments

Sign in to comment.
jaytea   -  Dec 14, 2011

the best thing to do in this case is silence all raws received up until the "End of Whois" one, not just the most common ones. disabling #channelcheck should be done automatically when the end of whois raw is received.

 Respond  
Jethro   -  Dec 14, 2011

I see. I reckon I should've used if ($istok(....,$numeric,32)) { halt } instead.

 Respond  
jaytea   -  Dec 14, 2011

LuminolBlue used /halt in those raw events to silence their output. the rest, i think, is self evident. look at your code and think about what it's doing.

 Respond  
Jethro   -  Dec 14, 2011

Would you kindly give me an explanation so I can learn from my mistakes? You left me cold dropping me those three words.

 Respond  
jaytea   -  Dec 14, 2011

not the same

 Respond  
Jethro   -  Dec 13, 2011

Why not:

raw *:*:{
  if (%channelcheck) && (!$istok(301 310 311 312 313 317 318,$numeric,32)) && ($numeric == 319) {
    .echo -t %channelcheckchan *8 $2 is on 4*9*12* $3- 12*9*4* 
    unset %channelcheck 
    halt
  }
}
 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.