|
Procyon Newbie
Joined: 21 Jan 2007 Posts: 6
|
Posted: Sun Jan 21, 2007 6:06 pm
[1.24] #SUB and custom functions |
Code: |
#FUNC skill($string) {%ansi(red)~[%ansi(high,magenta)$string%ansi(red)~]%ansi(green)}
#TRIGGER {^test (*)} {
#SUB {@skill(%1)~: test}
} |
Now,
will produce
[](whatever): test
The correct output
[whatever]: test
IS produced if the #SUB from the trigger is replaced with a #GAG and #SAY, but being able to use #SUB would be preferable. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Sun Jan 21, 2007 10:24 pm |
try switching your function to use the mxp color, i have noticed quirks when mixing ansi color and SUB in the past
#FUNC skill($string) {<color red>~[</color><color high,magenta>$string</color><color red>~]</color>}
untested |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Procyon Newbie
Joined: 21 Jan 2007 Posts: 6
|
Posted: Sun Jan 21, 2007 11:02 pm |
%ansi() always worked fine within a #SUB for me in zMUD, and seems to work in CMUD as well. This problem only comes about in a situation as described in the original post.
And in any case I'd rather just keep using %ansi instead of custom funcs, if MXP is the only other solution.
Edit: Also, to point out this isn't just about a #SUB/%ansi() problem, if the skill function is changed to contain %eval($string*2) and the original test trigger is used with #SAY test 8, the output is
0(8): test |
|
|
|
|
|