Skip to content

Instantly share code, notes, and snippets.

@Underdoge
Forked from hikilaka/mockme.py
Last active May 18, 2017 18:46
Show Gist options
  • Save Underdoge/11953c90fbb2133e60a30fa48353be07 to your computer and use it in GitHub Desktop.
Save Underdoge/11953c90fbb2133e60a30fa48353be07 to your computer and use it in GitHub Desktop.
Added random uppercase/lowercase and /prism
import weechat
import random
SCRIPT_NAME = 'mockme'
SCRIPT_AUTHOR = 'hikilaka,underdoge'
SCRIPT_VERSION = '1.0.1'
SCRIPT_LICENSE = 'none'
SCRIPT_DESC = 'Converts your text into a mOcKiNg VeRsIoN'
weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
SCRIPT_LICENSE, SCRIPT_DESC, '', 'UTF-8')
weechat.register('mockmeprism','hikilaka,underdoge','1.0.1','none','mockme with prism', '', 'UTF-8')
weechat.hook_command(SCRIPT_NAME, SCRIPT_DESC,
'[args]', 'args can be any text.', 'args', 'mockme', '')
weechat.hook_command('mockmeprism','mockme with prism','[args]','args can be any text.', 'args', 'mockmeprism', '')
def mockme(data, buffer, args):
result = str()
if random.randint(1,2) > 1:
cap = False
else:
cap = True
for char in args:
if cap:
result += char.upper()
else:
result += char.lower()
if char != ' ':
if random.randint(1,2) > 1:
cap = not cap
weechat.command(buffer, result)
return weechat.WEECHAT_RC_OK
def mockmeprism(data, buffer, args):
result = str()
if random.randint(1,2) > 1:
cap = False
else:
cap = True
for char in args:
if cap:
result += char.upper()
else:
result += char.lower()
if char != ' ':
if random.randint(1,2) > 1:
cap = not cap
weechat.command(buffer, '/prism ' + result)
return weechat.WEECHAT_RC_OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment