In my mud, a bard starts singing a song by using the command "singsong" plus a short name of the song, e.g. "singsong ranger" for singing a song about rangers.
To stop an ongoing song, you use the command "singsong" without a parameter.
I tried to write an alias that checks if %1 is empty and then sends "singsong" to the mud, without a parameter to stop the song and "singsong %1" in case I pass a songname to the alias.
Somehow the "singsong" without parameter never gets sent. When %1 is not empty, it works as intended. Any help?
Here is some sample output to illustrate the point(with command echo active):
Input: ss war
Output in game:
Sing song 'war'
singsong war - echo of command sent to the mud.
You start to sing 'Minstrelboy'.
You hum the melody of 'Minstrelboy'.
Input:
ss - echo of command sent to the mud.
Output in game:
What?
To stop an ongoing song, you use the command "singsong" without a parameter.
I tried to write an alias that checks if %1 is empty and then sends "singsong" to the mud, without a parameter to stop the song and "singsong %1" in case I pass a songname to the alias.
Somehow the "singsong" without parameter never gets sent. When %1 is not empty, it works as intended. Any help?
<alias
match="ss *"
enabled="y"
expand_variables="y"
group="skalds"
send_to="12"
sequence="100"
>
<send>songWanted = string.lower ("%1")
if songWanted == '' then
ColourNote ("#FFFF00", "", "End current song")
Send("singsong")
return
else
ColourNote ("#FFFF00", "", "Sing song '" .. "%1" .. "'")
Send("singsong %1")
end -- if
</send>
</alias>
Here is some sample output to illustrate the point(with command echo active):
Input: ss war
Output in game:
Sing song 'war'
singsong war - echo of command sent to the mud.
You start to sing 'Minstrelboy'.
You hum the melody of 'Minstrelboy'.
Input:
ss - echo of command sent to the mud.
Output in game:
What?