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


Joined: 26 Jan 2004
Posts: 21
Location: Norway

PostPosted: Sun Apr 04, 2004 6:23 am   

word formating, scripting trouble
 
basically the problem is the mud wordwrapping as usual.

So im pondering a script to grab the text, reformat it and push it through my triggers.

the format is name says to you in xyllic: I have seen a red-haired green-eyed male elf, a brown-haired short female gnome.

You can imagine the easy way is to just trigger on the descs and substitute it with #psub or similar to a name.

But due to word wrap, some descs can come out like red-haired on one line then green-eyed male elf on the next line.

So i need to design a script that takes the text, and reformats it into one where it wraps after Race or something similar.

Anyone able to help me out?

Lench
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Apr 05, 2004 3:41 am   
 
No, I can't imagine. Go ahead and explain what you want to do with a "red-haired green-eyed male elf" that you wouldn't want to do with elves of other hair and eye colors.
Reply with quote
Lench
Beginner


Joined: 26 Jan 2004
Posts: 21
Location: Norway

PostPosted: Mon Apr 05, 2004 3:53 am   
 
#trigger {red-eyed blond male elf} {#psub Lench}

think thats right format, so next time the mud throws me red-eyed blond male elf i'll see Lench


But sometimes the mud wordwraps it into red-eyed on one line and blond male elf on next or red-eyed blond on one and male elf on next.

But i wonder if there is a way to unwrap the lines and reformat them.
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Mon Apr 05, 2004 2:49 pm   
 
Does you Mud have an option to turn off the word wrapping so you can allow zmud to wrap instead. Many muds have this option and it really helps solve a lot of these issues.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Apr 05, 2004 2:50 pm   
 
You don't need #PSUB for this. #SUB is better suited anyway.
#TR {red-eyed blond male elf} {#SUB Lench}
Reply with quote
Lench
Beginner


Joined: 26 Jan 2004
Posts: 21
Location: Norway

PostPosted: Fri Apr 09, 2004 6:11 am   
 
wont i need #psub since a sentance can contain more descs? tought #sub changed the entire line.

And afraid not the mud does not have a wordwrap option yet, i asked the admins to add one tho. *crossing fingers*

Lench
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Apr 09, 2004 3:31 pm   
 
No, #SUB replaces the matched pattern.
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