|
Lench Beginner
Joined: 26 Jan 2004 Posts: 21 Location: Norway
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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.
|
|
|
|
Lench Beginner
Joined: 26 Jan 2004 Posts: 21 Location: Norway
|
Posted: 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. |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: 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.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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} |
|
|
|
Lench Beginner
Joined: 26 Jan 2004 Posts: 21 Location: Norway
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Apr 09, 2004 3:31 pm |
No, #SUB replaces the matched pattern.
|
|
|
|
|
|