Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- __module_name__ = "duckhunt"
- __module_version__ = "1.4"
- __module_description__ = "!bang moi lsac"
- import hexchat
- import re
- import time
- import datetime
- from random import randint
- lazyness_threshold = 5
- crissdechat = re.compile(r" .,_,.-°'°-.,_.-°'`'° \_Ø< KWAAK")
- empty = re.compile(r"EMPTY MAGAZINE")
- missed = re.compile(r"Missed.")
- golden = re.compile(r"life -1")
- unarmed = re.compile(r"You are not armed.")
- jammed = re.compile(r"JAMMED GUN")
- me = hexchat.get_info("nick");
- confiscated = re.compile(r"just get shot by accident by {}".format(me))
- def duckhunt_privmsg(word, word_eol, userdata):
- hour = int(datetime.datetime.fromtimestamp(time.time()).strftime('%H'))
- day = datetime.datetime.today().weekday()
- chatte = ":Canard!~Duck@miniemoi.users.undernet.org"
- channel = hexchat.get_info("channel")
- humanity = randint(2,5)
- ImHere = False
- if day <= 3:
- if hour >= 7 and hour < 9:
- ImHere = True
- if hour >= 18 and hour < 23:
- ImHere = True
- elif day == 4:
- if hour >= 7 and hour < 9:
- ImHere = True
- if hour >= 18 and hour < 19:
- ImHere = True
- elif day == 5:
- if hour >= 0 and hour < 2:
- ImHere = True
- if hour >= 9 and hour <= 23:
- ImHere = True
- elif day == 6:
- if hour >= 0 and hour < 1:
- ImHere = True
- if hour > 9 and hour <= 23:
- ImHere = True
- if ImHere:
- result = crissdechat.search(word_eol[2])
- if result and channel == "#quebec" and word[0] == chatte:
- lazyness = randint(0,9)
- if lazyness >= lazyness_threshold:
- hexchat.prnt("Boaf, im feeling lazy: {}".format(lazyness))
- return hexchat.EAT_NONE
- else:
- time.sleep(humanity)
- hexchat.command("msg {} !bang".format(channel))
- return hexchat.EAT_NONE
- result_confiscated = confiscated.search(word_eol[2])
- if result_confiscated and channel == "#quebec" and word[0] == chatte:
- hexchat.command("msg {} !rearm {}".format(channel, me))
- return hexchat.EAT_NONE
- def duckhunt_notice(word, word_eol, userdata):
- chatte = ":Canard!~Duck@miniemoi.users.undernet.org"
- channel = hexchat.get_info("channel")
- humanity = 1
- result_miss = missed.search(word_eol[2])
- if result_miss and word[0] == chatte:
- time.sleep(humanity)
- hexchat.command("msg #quebec !bang")
- return hexchat.EAT_NONE
- result_empty = empty.search(word_eol[2])
- if result_empty and word[0] == chatte:
- time.sleep(humanity)
- hexchat.command("msg #quebec !reload")
- time.sleep(.25)
- hexchat.command("msg #quebec !bang")
- return hexchat.EAT_NONE
- result_golden = golden.search(word_eol[2])
- if result_golden and word[0] == chatte:
- time.sleep(humanity)
- hexchat.command("msg #quebec !bang")
- return hexchat.EAT_NONE
- result_jam = jammed.search(word_eol[2])
- if result_jam and word[0] == chatte:
- time.sleep(humanity)
- hexchat.command("msg #quebec !reload")
- time.sleep(.25)
- hexchat.command("msg #quebec !bang")
- return hexchat.EAT_NONE
- result_unarmed = unarmed.search(word_eol[2])
- if result_unarmed and word[0] == chatte:
- hexchat.command("msg {} !rearm {}".format(channel, me))
- return hexchat.EAT_NONE
- hexchat.hook_server("PRIVMSG",duckhunt_privmsg)
- hexchat.hook_server("NOTICE",duckhunt_notice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement