# Talk.py# An X-Chat Python Script by Maulsel# What it does: Colors names for roleplay.# Tested on: X-Chat Aqua 0.16.0# You may modify this code as long as you keep the copyright info.# Copyright: Script is Public Domain. Originally Created by Maulsel.import xchat__module_name__ = "Talk"__module_version__ = "0.1"__module_description__ = "Colors names for roleplay."xchat.prnt("Loading Talk script...")# let's define some strings for output first#start info?data = []def dotalk(word, word_eol, userdata): lookfor = word[1] for i in data: for x in i: if x == lookfor: name = i[0] color = i[1] bgcolor = i[2] break xchat.command("SAY " + color + "," + bgcolor + "(" + name + ") " + word_eol[2]) return xchat.EAT_ALLdef setcolor(word, word_eol, userdata): gotit = 0 lookfor = word[1] for i in data: for x in i: if x == lookfor: i[1] = word[2] i[2] = word[3] gotit = 1 break if gotit == 0: data.append([word[1], word[2], word[3]]) xchat.command("ECHO Set colors for " + word[1] + ". Preview: " + word[2] + "," + word[3] + "(" + word[1] + ")") return xchat.EAT_ALLdef dotest(word, word_eol, userdata): xchat.command("ECHO " + data) return xchat.EAT_ALLdef unload_cb(userdata): xchat.prnt("Unloaded Talk.")xchat.hook_unload(unload_cb)xchat.hook_command("setcolors", setcolor, help="/setcolors name color bgcolor")xchat.hook_command("talk", dotalk, help="/talk name What to say")xchat.hook_command("test", dotest, help="/test")xchat.prnt("Loaded Talk script.")