# HIGHNICK is the nickname that we want to detect
HIGHNICK = 'eb'
# NOISY = 1 if you want a beep
NOISY = 1

def on_public_with_nick(who, channel, message):
  pyirc.openwindow(channel)
  echo("<\026" + who + "\026> " + message, channel)
  if NOISY:
    pyirc.beep()

def on_public_msg_with_nick(who, channel, message):
  pyirc.openwindow(channel)
  echo("(\026" + who + "\026) " + message, channel)
  if NOISY:
    pyirc.beep()

def on_public_notice_with_nick(who, channel, message):
  pyirc.openwindow(channel)
  echo("-\026" + who + "\026- " + message, channel)
  if NOISY:
    pyirc.beep()

def on_action_with_nick(who, to, message):
  if to == pyirc.nickname():
    pyirc.on_action(who, to, message)
  else:
    pyirc.openwindow(to)
    echo("\026*\026 " + message, window)
    if NOISY:
      pyirc.beep()

def on_send_notice(to, message):
  pyirc.openwindow(to)
  echo("\026-\026" + pyirc.nickname() + "\026-\026 " + message, to)

def on_send_public(to, message):
  pyirc.openwindow(to)
  echo("\026<\026" + pyirc.nickname() + "\026>\026 " + message, to)

on("PUBLIC", "[^ ]+ [^ ]+ .*"+HIGHNICK+".*", \
   "on_public_with_nick(p0,p1,p2)")
on("PUBLIC_MSG", "[^ ]+ [^ ]+ .*"+HIGHNICK+".*", \
   "on_public_msg_with_nick(p0,p1,p2)")
on("PUBLIC_NOTICE", "[^ ]+ [^ ]+ .*"+HIGHNICK+".*", \
   "on_public_notice_with_nick(p0,p1,p2)")
on("ACTION", "[^ ]+ [^ ]+ .*"+HIGHNICK+".*", \
   "on_action_with_nick(p0,p1,p2)")
on("SEND_NOTICE", ".*", "on_send_notice(p0,p1)")
on("SEND_PUBLIC", ".*", "on_send_public(p0,p1)")
