Skip to content

Instantly share code, notes, and snippets.

@danielb2
Forked from anonymous/gist:5852935
Created June 24, 2013 19:46
Show Gist options
  • Save danielb2/5852938 to your computer and use it in GitHub Desktop.
Save danielb2/5852938 to your computer and use it in GitHub Desktop.
import weechat
SCRIPT_NAME = "test"
SCRIPT_AUTHOR = "test"
SCRIPT_VERSION = "0.0"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "test"
def connecting_cb(data, signal, signal_data):
global notice_hook
try:
if not notice_hook:
notice_hook = weechat.hook_signal("*,irc_raw_in_notice", "notice_cb", "")
except:
notice_hook = weechat.hook_signal("*,irc_raw_in_notice", "notice_cb", "")
return weechat.WEECHAT_RC_OK
def notice_cb(data, signal, signal_data):
if "Ident broken or disabled, to continue to connect you must type" in signal_data:
server = signal.split(',')[0]
passwd = signal_data.split(" ")[-1]
weechat.prnt('','Sending UnderNet quote pass')
corebuf = weechat.buffer_search_main()
weechat.command(corebuf, '/quote -server %s pass %s' % (server,passwd))
global notice_hook
weechat.unhook(notice_hook)
notice_hook = ""
return weechat.WEECHAT_RC_OK
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
weechat.hook_signal("irc_server_connecting", "connecting_cb", "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment