Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- 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 your e-penis size based on system uptime. Usage: /epenis
- import hexchat
- import math
- import os
- __module_name__ = "epenis.py"
- __module_version__ = "0.7"
- __module_description__ = "Exibe o tamanho do seu e-penis baseado no uptime do sistema"
- __module_author__ = "sharch"
- try:
- # So many broken ctypeses out there.
- import ctypes
- import struct
- except ImportError:
- ctypes = None
- hexchatdir = hexchat.get_info('configdir')
- epenisdb = os.path.join(hexchatdir, 'addons', 'epenis.db')
- if (os.name != 'posix') and (os.name != 'nt'):
- do_alert("Operating System not supported. \002%s\002 will not work" % __module_name__)
- 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 uptime_linux():
- try:
- with open('/proc/uptime', 'r') as f:
- return float(f.readline().split()[0])
- except:
- pass
- def get_erection():
- global epenisdb
- try:
- with open(epenisdb) as db:
- f = db.read()
- if f:
- return float(f)
- else:
- return 0
- db.close()
- except IOError:
- save_erection('0')
- return 0
- def save_erection(value):
- global epenisdb
- db = open(epenisdb, 'w')
- db.write(str(value))
- db.close()
- def epenis_callback(word, word_eol, userdata):
- if os.name == 'posix':
- uptime = uptime_linux()
- if os.name == 'nt':
- uptime = uptime_windows()
- size = round((math.sqrt((0.0005 * uptime)) * 2.540),2)
- penis = '=' * int(size * 0.6)
- sperm = '~°'
- if get_erection() > size:
- record = 'Minha maior ereção foi de ' + str(get_erection()).replace('.',',') + 'cm'
- else:
- record = 'Esta é minha maior ereção até o momento'
- save_erection(size)
- 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('.',',') + '\002 cm. (' + record +') 8' + penis + 'D ' + sperm)
- return hexchat.EAT_ALL
- def do_alert(alert_string):
- message = "\002【{0}】\002{1}".format(__module_name__, alert_string)
- hexchat.emit_print("Server Error", message)
- hexchat.hook_command('epenis', epenis_callback, help='epenis - Exibe o tamanho do seu e-penis baseado no uptime do sistema')
- do_alert("module loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement