how to 'if nick is not on channel?'

Old posts that have not been replied to for several years.
Locked
User avatar
bruhv
Voice
Posts: 22
Joined: Sat Apr 10, 2004 5:53 pm

how to 'if nick is not on channel?'

Post by bruhv »

anyone help with the code i need to add to check if a user is on the channel?
i know the manual is there but i find i learn better by example :mrgreen:

Code: Select all

proc servebeer {nick uhost hand chan rest} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == "orac"} {
    putserv "PRIVMSG $chan :\00310thanks $nick, but i don't drink alcohol\003" ;return 0}
  if {$cmd == "bruhv"} {
    putserv "PRIVMSG $chan :\001ACTION \00310draws a pint of the finest english ale for $cmd\003\001" ;return 0}
  if {$cmd == ""} {
    putserv "PRIVMSG $chan :\001ACTION \00310pours a jug of warm beer and slides it over to $nick\003\001" ;return 0}
  putserv "PRIVMSG $chan :\001ACTION \00310pours a jug of warm beer and slides it over to  $rest\003\001"
}
bind pub - !beer servebeer
if a nick isn't on the channel i want the bot to say 'dumbass, he's not here' or similar

thanks in advance
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

if nick is on chan try docu onchan command ;)
onchan <nickname> [channel]
Returns: 1 if someone by that nickname is on the specified channel (or any channel if none is specified); 0 otherwise

Module: irc
XplaiN but think of me as stupid
Locked