-
-
Save sim642/dde23725f23907bc960fce308ecda4f1 to your computer and use it in GitHub Desktop.
colorspam weechat script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
SCRIPT_NAME = "colorspam" | |
SCRIPT_AUTHOR = "Simmo Saan <simmo.saan@gmail.com>" | |
SCRIPT_VERSION = "1.0" | |
SCRIPT_LICENSE = "GPL3" | |
SCRIPT_DESC = "" | |
SCRIPT_COMMAND = SCRIPT_NAME | |
IMPORT_OK = True | |
try: | |
import weechat | |
except ImportError: | |
print("This script must be run under WeeChat.") | |
print("Get WeeChat now at: http://www.weechat.org/") | |
IMPORT_OK = False | |
def command_cb(data, buffer, args): | |
for fg in range(16, 48): | |
s = "" | |
for bg in range(16, 48): | |
s += weechat.color(str(fg) + "," + str(bg)) + "X" | |
weechat.prnt(weechat.current_buffer(), s) | |
return weechat.WEECHAT_RC_OK | |
if __name__ == "__main__" and IMPORT_OK: | |
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", ""): | |
weechat.hook_command(SCRIPT_COMMAND, SCRIPT_DESC, "", "", "", "command_cb", "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment