| Message |
You need to do the replacements in a single alias. You can set "keep evaluating" but that would result in multiple sends. Using a bit of Lua scripting you can achieve that. I assume the line itself can be identified in some way (eg. chat xxx). This example assumes the line starts with "chat" but you can change that to whatever it is. Then inside the script we do a lookup of the words we want to do the replacement on. To expand the replacements, simply add to the table in the format shown.
<aliases>
<alias
match="chat *"
enabled="y"
send_to="12"
sequence="100"
>
<send>
replacements = {
["*kuvoc*"] = "&09K&00&01u&16v&00&01o&09c&16",
["*solbet*"] = "&00&12S&00&04o&00&03l&00&00&11b&00&12e&00&04t&00&16",
}
Send ("chat " .. string.gsub ("%1", "%%*%%a+%%*",
function (str) return replacements [str] or str end ))
</send>
</alias>
</aliases>
I assumed the asterisks were part of it, if not use this:
<aliases>
<alias
match="chat *"
enabled="y"
send_to="12"
sequence="100"
>
<send>
replacements = {
kuvoc = "&09K&00&01u&16v&00&01o&09c&16",
solbet = "&00&12S&00&04o&00&03l&00&00&11b&00&12e&00&04t&00&16",
}
Send ("chat " .. string.gsub ("%1", "%%a+",
function (str) return replacements [str] or str end))
</send>
</alias>
</aliases>
Don't be put off by all the & above - that is just part of the way the & symbol is represented in the XML code. Once you copy and paste it into your alias list, the replacement text will look like how you had it.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|