Advertisement
Guest User

hexchat hug return 10 second cooldown

a guest
May 27th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. __module_name__="Hug and cool"
  2. __module_version__="1.2.3"
  3. __module_description__="A hug return cooldown script on 10-second intervals"
  4.  
  5. import hexchat
  6.  
  7. allowHug=True
  8. myTimer=None
  9.  
  10.  
  11. def hugBack(a,b,c):
  12.     global myTimer
  13.     global allowHug
  14.     if 'hugs' in a[1] or 'hug' in a[1]:
  15.         pingerNick=a[0]
  16.         if allowHug==True:
  17.             hexchat.command("me hugs {} back <3".format(pingerNick))
  18.         allowHug=False
  19.         myTimer=hexchat.hook_timer(10000,timeOut)
  20.  
  21. #10000 in the above ^ is means 10000 milliseconds, or 10 seconds. Every 10 seconds, it calls the timeOut function.
  22. #The timer starts AFTER 10 seconds, not ON 0
  23.  
  24. def timeOut(userdata):
  25.     global allowHug
  26.     global myTimer
  27.     if allowHug==False:
  28.         allowHug=True
  29.         hexchat.unhook(myTimer)
  30.     else:
  31.         hexchat.unhook(myTimer)
  32.  
  33.  
  34. hexchat.hook_print("Channel Action hilight",hugBack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement