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
Panpardus
Beginner


Joined: 27 Feb 2005
Posts: 11

PostPosted: Mon Feb 25, 2008 12:58 am   

%1 keeps adding a space?
 
Might be me, most likely is but I have a trigger that looks like this

^[System]\: (\w+) class (\w+)\.$

and it executes this

#if %2="enabled" {b_%1on};#if %2="disabled" {b_%1off}

The problem is that instead of executing b_Apostateon or b_Apostateoff
its puts in a space so i get b_ Apostateon and b_ Apostateoff which of course no longer matches the aliases I wish to fire

anyone got a quick solution?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Feb 25, 2008 2:29 am   
 
This certainly is an annoyance and you are not the first person to come across it.

#if (%2="enabled") {#exec {%concat("b_",%trim(%1),"on")}};#if (%2="disabled") {#exec {%concat("b_",%trim(%1),"off")}}

You should really get into the habit of using () in your condition statements...
Cmud doesn't like implicit concatenation as much as Zmud does, it would have worked but I felt like being picky tonight.
You really should get into the habit of using #execute when trying to build a string then use the string as an alias.

Finally the only thing you really needed to get this to work is the %trim or %trimleft
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Panpardus
Beginner


Joined: 27 Feb 2005
Posts: 11

PostPosted: Mon Feb 25, 2008 2:58 am   
 
Just remembered %concat then and was coming here to say not to worry I had found the problem, I also didnt need to use %trim or %trimleft and it seems to work fine.

Anyway thanks for the help and advice, its appreciated.
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