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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
newby
Newbie


Joined: 27 Oct 2003
Posts: 4
Location: USA

PostPosted: Tue May 18, 2004 2:18 pm   

converting to ascii?
 
Is there a way to convert a string captured from a trigger to ascii without assigning it to a variable?

#TR {(*)} {Here I want to convert %1 to ascii before assigning it to a variable}

The reason I'm doing this is because there are special characters in the string and if I assign it to a variable it comes out all garbled... Thanks
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Tue May 18, 2004 3:04 pm   
 
I think what you really want to do is replace any special character with some other character or with nothing.

Take a look at the %replace function

%replace(%1,"-"," ")

that will replace "-" with a space


Also


What are the special char that are not working and how are you assigning it to a variable.
#var string "%1"
This will assign everything in %1 into string without parsing it.
#var string %1
This will parse through zmud.
Reply with quote
newby
Newbie


Joined: 27 Oct 2003
Posts: 4
Location: USA

PostPosted: Tue May 18, 2004 3:44 pm   
 
...
I didn't state the problem clear enough... I'm on a chinese mud, it's a 2bit language, and for some reason zmud seems to parse some of the characters. I don't have a list of the characters, so I was thinking of converting the whole string into ascii.
One of the main problem causing characters is "¿", is it a special character in zmud? If there's no general way of doing this, I guess I'll just make a list of problem characters and add more as I find them then... Thanks
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue May 18, 2004 8:03 pm   
 
zMUD does not have support for multi-byte languages. For this reason, your triggers won't be able to do much with the text received from the MUD because the two bytes per character will confuse it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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