Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- #
- # epenis.py
- #
- # Copyright 2011 sharch <sharch@thegame.com>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- # MA 02110-1301, USA.
- #
- #
- # Displays you e-penis size based on system uptime. Usage: /epenis
- __module_name__ = "E-Penis"
- __module_version__ = "0.2"
- __module_description__ = "Exibe o tamanho do seu e-penis baseado no uptime do sistema"
- __module_author__ = "sharch"
- import hexchat
- import math
- try:
- # So many broken ctypeses out there.
- import ctypes
- import struct
- except ImportError:
- ctypes = None
- def uptime_windows():
- """
- Returns uptime in seconds or None, on Windows. Warning: may return
- incorrect answers after 49.7 days on versions older than Vista.
- """
- if hasattr(ctypes, 'windll') and hasattr(ctypes.windll, 'kernel32'):
- lib = ctypes.windll.kernel32
- # Windows CE uses the cdecl calling convention.
- else:
- try:
- lib = ctypes.CDLL('coredll.lib')
- except (AttributeError, OSError):
- return None
- if hasattr(lib, 'GetTickCount64'):
- # Vista/Server 2008 or later.
- lib.GetTickCount64.restype = ctypes.c_uint64
- return lib.GetTickCount64() / 1000.
- if hasattr(lib, 'GetTickCount'):
- # WinCE and Win2k or later; gives wrong answers after 49.7 days.
- lib.GetTickCount.restype = ctypes.c_uint32
- return lib.GetTickCount() / 1000.
- return None
- def doEpenis(word, word_eol, userdata):
- size = round((math.sqrt((0.0005 * uptime_windows())) * 2.540),2)
- penis = '=' * int(size)
- sperm = '~°'
- if int(size) > 10:
- sperm = '~° ' * (int(size) / 10)
- hexchat.command('SAY Baseado no uptime do sistema, meu e-pênis mede \002' + str(size).replace('.',',') + '\002cm. 8' + penis + 'D ' + sperm)
- return hexchat.EAT_ALL
- 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