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
mmex
Newbie


Joined: 12 Nov 2003
Posts: 2
Location: USA

PostPosted: 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?
Reply with quote
Cuttlefish
Apprentice


Joined: 28 Oct 2003
Posts: 164

PostPosted: Sun Nov 16, 2003 1:43 am   
 
Okay, I've worked for hours on this script, so I hope you appreciate it! Very Happy

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."
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