Skip to content

Instantly share code, notes, and snippets.

@spacemud
Created August 18, 2017 00:01
Show Gist options
  • Save spacemud/45a49eb46c50437e8e363ac4bb8c9e55 to your computer and use it in GitHub Desktop.
Save spacemud/45a49eb46c50437e8e363ac4bb8c9e55 to your computer and use it in GitHub Desktop.
local name = "xmlogin.lua"
local version = "1.0"
local desc = "Simplify logging in to the xMovie IRC echo bots with this script"
hexchat.register(name, version, desc)
local function cmd_xmlogin(word, eol)
if not word[2] then
hexchat.print("Syntax: /xmlogin [password]")
return hexchat.EAT_HEXCHAT
end
password = word[2]
hexchat.command("QUOTE WHOIS xM_1")
return hexchat.EAT_ALL
end
local function handle_whois(word, eol)
if word[1] ~= "xM_1" or word[3] ~= "play.xmovieserver.com" then
hexchat.print("Error: IRC bot credentials could not be verified. Use caution and do not login.")
return
end
hexchat.command(("MSG xM_1 login %s"):format(password))
end
hexchat.hook_command("XMLOGIN", cmd_xmlogin)
hexchat.hook_print("WhoIs Name Line", handle_whois)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment