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


Joined: 12 Apr 2010
Posts: 11

PostPosted: Thu Apr 15, 2010 11:10 am   

Separator Characters
 
I have an old tool that stores speed walks. When I select one, it automatically puts the walk into the clipboard ready to paste into a mud client.

This worked fine when I used zMud, but I'm having difficulty in getting it to work in cMud.

An example speed walk I have is: "W; W; W; Open West; W; W; W; N; " (without the quotes)

Now, if I manually edited this text, and removed the spaces after the semi-colons, it works fine.

zMud accepted the spaces there, cMud (out of the box) doesn't.

How can I setup cMud to accept a speedwalk in this format? (I change change the old compiled utility to give different output)
Reply with quote
PsychicSmurf
Beginner


Joined: 12 Apr 2010
Posts: 11

PostPosted: Thu Apr 15, 2010 11:11 am   
 
Note: I tried an alias to swap "; " to ";" but it didn't work.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Apr 15, 2010 2:07 pm   
 
You should be able to use %replace(string, " ", "")
to get rid of the white spaces themselves.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
PsychicSmurf
Beginner


Joined: 12 Apr 2010
Posts: 11

PostPosted: Thu Apr 15, 2010 3:23 pm   
 
I've just tried that, and then it ends up sending "W;W;W;Open West;W;W;W;N;" to the mud, which is incorrect. The semi-colons should be parsed by cMud into new lines.

However, the mud then rejects that.

What I need to do is:
* parse the command line (which could have an extra keyword at the beginning to identify a speedwalk)
* remove the spaces after the semi-colons
* BUT THEN for cMud to parse the semi-colons so that each direction in the speedwalk is entered on a new line.


OR

For cMud to see the "; " as a newline separator...
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Apr 15, 2010 3:52 pm   
 
After you remove the spaces, use the #EXEC command to execute the string and send the individual commands to the MUD.
Reply with quote
PsychicSmurf
Beginner


Joined: 12 Apr 2010
Posts: 11

PostPosted: Thu Apr 15, 2010 4:04 pm   
 
Woot!

Many thanks, I can find place again!
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