Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. __module_name__ = "duckhunt"
  3. __module_version__ = "1.4"
  4. __module_description__ = "!bang moi lsac"
  5.  
  6. import hexchat
  7. import re
  8. import time
  9. import datetime
  10. from random import randint
  11.  
  12. lazyness_threshold = 5
  13.  
  14. crissdechat = re.compile(r" .,_,.-°'°-.,_.-°'`'° \_Ø< KWAAK")
  15. empty = re.compile(r"EMPTY MAGAZINE")
  16. missed = re.compile(r"Missed.")
  17. golden = re.compile(r"life -1")
  18. unarmed = re.compile(r"You are not armed.")
  19. jammed = re.compile(r"JAMMED GUN")
  20. me = hexchat.get_info("nick");
  21. confiscated = re.compile(r"just get shot by accident by {}".format(me))
  22.  
  23. def duckhunt_privmsg(word, word_eol, userdata):
  24. hour = int(datetime.datetime.fromtimestamp(time.time()).strftime('%H'))
  25. day = datetime.datetime.today().weekday()
  26. chatte = ":Canard!~Duck@miniemoi.users.undernet.org"
  27. channel = hexchat.get_info("channel")
  28. humanity = randint(2,5)
  29. ImHere = False
  30. if day <= 3:
  31. if hour >= 7 and hour < 9:
  32. ImHere = True
  33. if hour >= 18 and hour < 23:
  34. ImHere = True
  35. elif day == 4:
  36. if hour >= 7 and hour < 9:
  37. ImHere = True
  38. if hour >= 18 and hour < 19:
  39. ImHere = True
  40. elif day == 5:
  41. if hour >= 0 and hour < 2:
  42. ImHere = True
  43. if hour >= 9 and hour <= 23:
  44. ImHere = True
  45. elif day == 6:
  46. if hour >= 0 and hour < 1:
  47. ImHere = True
  48. if hour > 9 and hour <= 23:
  49. ImHere = True
  50.  
  51. if ImHere:
  52. result = crissdechat.search(word_eol[2])
  53. if result and channel == "#quebec" and word[0] == chatte:
  54. lazyness = randint(0,9)
  55. if lazyness >= lazyness_threshold:
  56. hexchat.prnt("Boaf, im feeling lazy: {}".format(lazyness))
  57. return hexchat.EAT_NONE
  58. else:
  59. time.sleep(humanity)
  60. hexchat.command("msg {} !bang".format(channel))
  61. return hexchat.EAT_NONE
  62. result_confiscated = confiscated.search(word_eol[2])
  63. if result_confiscated and channel == "#quebec" and word[0] == chatte:
  64. hexchat.command("msg {} !rearm {}".format(channel, me))
  65. return hexchat.EAT_NONE
  66.  
  67. def duckhunt_notice(word, word_eol, userdata):
  68. chatte = ":Canard!~Duck@miniemoi.users.undernet.org"
  69. channel = hexchat.get_info("channel")
  70. humanity = 1
  71. result_miss = missed.search(word_eol[2])
  72. if result_miss and word[0] == chatte:
  73. time.sleep(humanity)
  74. hexchat.command("msg #quebec !bang")
  75. return hexchat.EAT_NONE
  76. result_empty = empty.search(word_eol[2])
  77. if result_empty and word[0] == chatte:
  78. time.sleep(humanity)
  79. hexchat.command("msg #quebec !reload")
  80. time.sleep(.25)
  81. hexchat.command("msg #quebec !bang")
  82. return hexchat.EAT_NONE
  83. result_golden = golden.search(word_eol[2])
  84. if result_golden and word[0] == chatte:
  85. time.sleep(humanity)
  86. hexchat.command("msg #quebec !bang")
  87. return hexchat.EAT_NONE
  88. result_jam = jammed.search(word_eol[2])
  89. if result_jam and word[0] == chatte:
  90. time.sleep(humanity)
  91. hexchat.command("msg #quebec !reload")
  92. time.sleep(.25)
  93. hexchat.command("msg #quebec !bang")
  94. return hexchat.EAT_NONE
  95. result_unarmed = unarmed.search(word_eol[2])
  96. if result_unarmed and word[0] == chatte:
  97. hexchat.command("msg {} !rearm {}".format(channel, me))
  98. return hexchat.EAT_NONE
  99.  
  100.  
  101. hexchat.hook_server("PRIVMSG",duckhunt_privmsg)
  102. hexchat.hook_server("NOTICE",duckhunt_notice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement