Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hexchat
- __module_name__ = "werewolfquit"
- __module_author__ = "jacob1"
- __module_version__ = "1.0"
- __module_description__ = "Does /cycle in ##werewolf when user marks themselves as away"
- def check_werewolf(server):
- channel = hexchat.find_context(server=server, channel="##werewolf")
- if not channel or 'm' in channel.get_info("modes"):
- return
- userlist = channel.get_list("users")
- if not userlist:
- return
- for user in userlist:
- if user.nick == channel.get_info("nick"):
- if user.prefix != "":
- channel.command("CYCLE ##werewolf :Automatic cycle due to going away")
- return
- def on_away(word, word_eol, userdata):
- check_werewolf(word[0][1:])
- hexchat.hook_server("306", on_away)
- def on_nick(word, word_eol, userdata):
- host = word[0]
- newnick = word[2]
- if newnick == ":^j" and host.split("@")[1] == "Powder/Developer/jacob1":
- check_werewolf(hexchat.get_info("server"))
- hexchat.hook_server("NICK", on_nick)
Advertisement
Add Comment
Please, Sign In to add comment