|
mmex Newbie
Joined: 12 Nov 2003 Posts: 2 Location: USA
|
Posted: Sat Nov 15, 2003 7:50 am
Repeat message compression? |
I am wondering if anyone has come up with a good way to do good message compress. I have found on some muds you get the same line over and over, often rather quickly. Some muds can be rather spammy, it would be nive if I didn't have to read it all. Her is what I am looking for:
Golem misses you.
Golem misses you.
Golem misses you.
Becomes:
Golem misses you. [3]
Does anyone have something like this? |
|
|
|
Cuttlefish Apprentice
Joined: 28 Oct 2003 Posts: 164
|
Posted: Sun Nov 16, 2003 1:43 am |
Okay, I've worked for hours on this script, so I hope you appreciate it!
Actually, I was mainly working for hours just learning zMUD. I thought your script presented a good opportunity for that. What I have is a script that seems to work for me, but that you shouldn't use until the real experts tell you what's grossly wrong about it. This will probably crash your system and make your boyfriend/girlfriend dump you. But anyway, here it is:
Code: |
Pattern: ^*{^]}$
Script:
curline = %0
#if (@lastsub=@curline) {
lastcount = 2
lastsub = @curline"["@lastcount"]"
#sub @lastsub
#gag -1
} {#if (@lastsub = @curline"["@lastcount"]") {
#add lastcount 1
lastsub = @curline"["@lastcount"]"
#sub @lastsub
#gag -1
} {
lastsub = @curline
}}
|
Note that you have to turn off "Allow [] for eval". I tried a million different things but could never get around this. Can any gurus point out the solution?
This also included more variables that I wanted. I had all kinds of more tricky ways to do this but none of them seemed to work. I plan on picking this example apart (either in this thread or another) and asking why various other things don't work like I expected.
I'm also worried about the fact that this trigger would parse on just about any input from your mud. I don't see any other way to do this, though, unless you JUST wanted it limited to specific strings like "(something) misses you." |
|
|
|
|
|
|
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
|
|