I'm trying to make an alias to set the prompt and create a trigger which matches on the prompt for Aardwolf. The only difficulty I'm having is with colour codes. Aard uses the @ symbol to denote a colour. The @ and any single character after it is eaten by the parser, except for @~- which are special characters. "@@" = "@", "@~" or "@-" = "~".
I have the following:
But I would like to have a string where I'm adding the unmatched sections to the modified ones I'm printing. The example string would wind up being "Cc@~@~asdf". For some really strange reason, I'm having a hard time getting my brain around the last step of this :(
I have the following:
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
> s="@CC@cc@@@~@C@@@-asdf"
> for w in string.gmatch(s, "(@.)") do
>> if w == "@@" then
>> print("@")
>> elseif w == "@-" or w == "@~" then
>> print("~")
>> end
>> end
@
~
@
~
>
But I would like to have a string where I'm adding the unmatched sections to the modified ones I'm printing. The example string would wind up being "Cc@~@~asdf". For some really strange reason, I'm having a hard time getting my brain around the last step of this :(