I use goto sometimes but it’s usually cleaner to script without them.
alias err {
if ($1 == 1) {
if ($exists("sound.mp3") == $true) splay -q "sound.mp3"
}
elseif ($2 == 1) {
if ($exists("sound.mp3") == $true) splay -q "sound.mp3"
}
}
Hmm, you are already testing for if the sound file exists, I haven’t had mirc error on a sound file if it’s found, try this:
alias err {
if ($1 == 1) {
if ($exists("sound.mp3") == $true) splay -q "sound.mp3"
}
elseif ($2 == 1) {
if ($exists("sound.mp3") == $true) splay -q "sound.mp3"
}
:error
}
Since both use the same found file you can write it this way:
alias err {
if (($1 == 1) || ($2 == 1)) {
if ($exists("sound.mp3") == $true) splay -q "sound.mp3"
else echo -s "sound.mp3" not found in alias err
}
:error
}