Help with Hexchat scripting reddit / irc ---------------------------------------------------------------------- maggot9779 路 2014-08-15 21:17 So basically what I want to do is have a script that, when x is typed in front of a string, will replace the entire string with a word. For example: ~~ This is a test It will see the ~~ and replace the entire string with: TEST I've searched around and the replace() command is close, but that only replaces words you define, what I want is for it to only be looking for ~~ but then replace all the text in that string. I hope this question makes sense, i'm not a programmer by any means so this is difficult to explain. ---------------------------------------------------------------------- TwiztedZero 路 2014-08-16 03:19 Join free node and ask the hexchat developers & maintainers in #hexchat. 馃捇馃摗 ---------------------------------------------------------------------- eier 路 2014-08-16 11:36 You can probably use regex. If you are using python, something like this: import re text = "~~This is a test" text = re.sub('.*~~.*', "TEST", text) #text = TEST text = "This is a test" text = re.sub('.*~~.*', "TEST", text) #text = This is a test ---------------------------------------------------------------------- TingPing 路 2014-08-18 13:10 This script can use regex to modify your input, it likely needs some modification to fit your needs though. - https://github.com/hexchat/hexchat- addons/blob/master/python/regex_auto-replace/replace.py ---------------------------------------------------------------------- maggot9779 路 2014-08-18 13:38 Thanks for the help guys. I should have added that I don't want to replace MY text, but the text of others. The reason I want this is for a spoiler script for Twitch. So when users want to talk about spoilers in a game they can type ~~ or whatever infront of their text and I wont be able to read it. I'll try to modify what has already been posted with my very limited knowledge and see if I get anywhere.