Advertisement
Guest User

E-Pênis script para HexChat (Windows)

a guest
Jan 5th, 2016
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.59 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. #
  3. #   epenis.py
  4. #
  5. #       Copyright 2011 sharch <sharch@thegame.com>
  6. #      
  7. #       This program is free software; you can redistribute it and/or modify
  8. #       it under the terms of the GNU General Public License as published by
  9. #       the Free Software Foundation; either version 2 of the License, or
  10. #       (at your option) any later version.
  11. #      
  12. #       This program is distributed in the hope that it will be useful,
  13. #       but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #       GNU General Public License for more details.
  16. #      
  17. #       You should have received a copy of the GNU General Public License
  18. #       along with this program; if not, write to the Free Software
  19. #       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  20. #       MA 02110-1301, USA.
  21. #      
  22. #
  23. #   Displays you e-penis size based on system uptime. Usage: /epenis
  24.  
  25.  
  26. __module_name__ = "E-Penis"
  27. __module_version__ = "0.2"
  28. __module_description__ = "Exibe o tamanho do seu e-penis baseado no uptime do sistema"
  29. __module_author__ = "sharch"
  30.  
  31. import hexchat
  32. import math
  33.  
  34. try:
  35.     # So many broken ctypeses out there.
  36.     import ctypes
  37.     import struct
  38. except ImportError:
  39.     ctypes = None
  40.  
  41. def uptime_windows():
  42.     """
  43.     Returns uptime in seconds or None, on Windows. Warning: may return
  44.     incorrect answers after 49.7 days on versions older than Vista.
  45.     """
  46.     if hasattr(ctypes, 'windll') and hasattr(ctypes.windll, 'kernel32'):
  47.         lib = ctypes.windll.kernel32
  48.             # Windows CE uses the cdecl calling convention.
  49.     else:
  50.         try:
  51.             lib = ctypes.CDLL('coredll.lib')
  52.         except (AttributeError, OSError):
  53.             return None
  54.    
  55.     if hasattr(lib, 'GetTickCount64'):
  56.         # Vista/Server 2008 or later.
  57.         lib.GetTickCount64.restype = ctypes.c_uint64
  58.         return lib.GetTickCount64() / 1000.
  59.     if hasattr(lib, 'GetTickCount'):
  60.         # WinCE and Win2k or later; gives wrong answers after 49.7 days.
  61.         lib.GetTickCount.restype = ctypes.c_uint32
  62.         return lib.GetTickCount() / 1000.
  63.     return None
  64.  
  65. def doEpenis(word, word_eol, userdata):
  66.     size = round((math.sqrt((0.0005 * uptime_windows())) * 2.540),2)
  67.     penis = '=' * int(size)
  68.     sperm = '~°'
  69.    
  70.     if int(size) > 10:
  71.         sperm = '~° ' * (int(size) / 10)
  72.    
  73.     hexchat.command('SAY Baseado no uptime do sistema, meu e-pênis mede \002' + str(size).replace('.',',') + '\002cm. 8' + penis + 'D ' + sperm)
  74.     return hexchat.EAT_ALL
  75.  
  76. hexchat.hook_command('epenis', doEpenis, help='epenis - Exibe o tamanho do seu e-penis baseado no uptime do sistema')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement