The alias that is calling ColourNote:
<aliases>
<alias
name="targetting"
match="^t (.+)$"
enabled="y"
regexp="y"
send_to="12"
keep_evaluating="y"
sequence="100"
>
<send>require "tprint"
target="%1"
--print(target)
args={"red","blue", "Target changed to: ", "blue","red", target}
--tprint(args)
ColourNote("red","blue", "Target changed to: ", "blue","red", target)
if attacking==true then
attack()
end</send>
</alias>
</aliases>
When I use the alias, I sometimes get this error:
Run-time error
World: Achaea
Immediate execution
[string "Alias: targetting"]:8: bad argument #6 to 'ColourNote' (string expected, got no value)
stack traceback:
[C]: in function 'ColourNote'
[string "Alias: targetting"]:8: in main chunk
Further experimentation shows that the error only shows up the first time I use the alias after receiving a message (any message) from the server.
Further experiment showed that disabling a new trigger for capturing prompts, which I just introduced, prevents the message. The trigger is:
<triggers>
<trigger
enabled="y"
group="prompt"
keep_evaluating="y"
match="^(.+)$"
name="prompt"
regexp="y"
send_to="12"
sequence="100"
>
<send>if GetLineCount() == GetInfo(289) then
prompt_curr="%1"
end</send>
</trigger>
</triggers>
Furthermore, the error does not happen if I call either print() or tprint() before the ColourNote in the alias (see commented out portions).
I suspect the issue is due to a race condition, but adjusting the sequence of the trigger up or down does not seem to resolve the issue.
Thanks in advance for your help.
Edit: I should add that I'm using Mushclient v5.06.