Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Procyon
Newbie


Joined: 21 Jan 2007
Posts: 6

PostPosted: 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,
Code:
#SAY test whatever

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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Procyon
Newbie


Joined: 21 Jan 2007
Posts: 6

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net