SetStatus problems.

Posted by FishOnSpeed on Wed 26 Mar 2008 06:20 PM — 3 posts, 16,141 views.

USA #0
I'm trying to send my prompt to the status line at the bottom of the screen. My trigger fires fine and all that then I get an error.

Heres the error.
Compile error
World: darkeningsun
Immediate execution
[string "Trigger: DStracker"]:1: ')' expected near ':'


Heres the trigger.
<triggers>
<trigger
enabled="y"
match="[*][*][*/* * *][*/*](*)"
name="DStracker"
send_to="12"
sequence="100"
>
<send>SetStatus ("[".. %1 .."][".. %2 .."][".. %3 .."/".. %4 .." ".. %5 .." ".. %6 .."][".. %7 .."/".. %8 .."](".. %9 ..")")
</send>
</trigger>
</triggers>

The only place in the prompt where a : shows up is in the time part. Can I not send something with numbers and symbols to the status line? I.e. 2:30am Because it works fine if I take the time out.
Australia Forum Administrator #1
Have a look at http://mushclient.com/faq point 32.

Say in your example that %1 is a time. Let's see how that will look:


SetStatus ("[".. 19:32 .."][" ... etc ... )


This will fail because it won't accept 19:32 as a variable name or number.

String values in wildcards need to be quoted like this:


SetStatus ("[".. "%1" .."][".. "%2" .."][".. "%3" .."/".. "%4" .." ".. "%5" .." ".. "%6" .."][".. "%7" .."/".. "%8" .."](".. "%9" ..")")


Of course that looks ridiculously complex, so just simplify it like this:


SetStatus ("[%1][%2][%3/%4 %5 %6][%7/%8](%9)")


You already have a quoted string - things like %1 are not variables, they are simply substituted into the string literally.
Amended on Wed 26 Mar 2008 08:40 PM by Nick Gammon
USA #2
Nice. Works perfectly, thanks.