Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. local name = "xmlogin.lua"
  2. local version = "1.0"
  3. local desc = "Simplify logging in to the xMovie IRC echo bots with this script"
  4.  
  5. hexchat.register(name, version, desc)
  6.  
  7. local function cmd_xmlogin(word, eol)
  8. if not word[2] then
  9. hexchat.print("Syntax: /xmlogin [password]")
  10. return hexchat.EAT_HEXCHAT
  11. end
  12.  
  13. password = word[2]
  14.  
  15. hexchat.command("QUOTE WHOIS xM_1")
  16. return hexchat.EAT_ALL
  17. end
  18.  
  19. local function handle_whois(word, eol)
  20. if word[1] ~= "xM_1" or word[3] ~= "play.xmovieserver.com" then
  21. hexchat.print("Error: IRC bot credentials could not be verified. Use caution and do not login.")
  22. return
  23. end
  24.  
  25. hexchat.command(("MSG xM_1 login %s"):format(password))
  26. end
  27.  
  28. hexchat.hook_command("XMLOGIN", cmd_xmlogin)
  29. hexchat.hook_print("WhoIs Name Line", handle_whois)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement