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.

Revisions

  1. @invalid-email-address Anonymous created this gist Jun 24, 2013.
    35 changes: 35 additions & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    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", "")