Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-*- coding:utf-8 -*-
- import hexchat, random
- __module_name__ = "Timebomb"
- __module_version__ = "1.0"
- __module_description__ = "Timebombs! :D"
- print("Timebomb LOADED!")
- def unload_cb(userdata):
- print("Timebomb UNLOADED!")
- hexchat.hook_unload(unload_cb)
- # settings = [nick of person being bombed, correct wire to disarm the bomb, hook object]
- settings = [None] * 3
- def kaboom(userdata):
- global settings
- hexchat.command("MSG {} \00304\002KABOOM!".format(userdata))
- hexchat.command("MSG {} {}, Should've gone for the {} wire.".format(userdata, settings[0], settings[1]))
- settings = [None] * 3
- def main_handler(word, word_eol, userdata):
- global settings
- colours = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]
- if word[1].startswith("%timebomb"):
- # %timebomb nick -- Set's timebomb in nick's pants.
- argv = word[1].split()
- if len(argv) < 2:
- hexchat.command("MSG {} {}, Too few arguments.".format(hexchat.get_info("channel"), word[0]))
- else:
- if not (settings[0] or settings[1] or settings[2]):
- if random.randint(0, 3) == 0:
- hexchat.command("MSG {} {}, There is a 1 in 4 chance that I will NOT do someone a favour with the timebomb. Sorry, this is the 1 in 4 chance I just told you about.".format(hexchat.get_info("channel"), word[0]))
- else:
- time = random.randint(10, 100)
- settings[0] = argv[1]
- settings[1] = random.choice(colours)
- settings[2] = hexchat.hook_timer(time * 1000, kaboom, userdata=hexchat.get_info("channel"))
- hexchat.command("MSG {} A timebomb is set for {} seconds and shoved into {}'s pants. There are 7 wires: {}. Use %cut colour to cut a wire.".format(hexchat.get_info("channel"), time, argv[1], colours))
- else:
- hexchat.command("MSG {} {}, There is already a live timebomb in {}'s pants!".format(hexchat.get_info("channel"), word[0], settings[0]))
- hexchat.hook_print("Channel Message", main_handler)
- hexchat.hook_print("Your Message", main_handler)
- hexchat.hook_print("Private Message", main_handler)
- hexchat.hook_print("Private Message to Dialog", main_handler)
Advertisement
Add Comment
Please, Sign In to add comment