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


Joined: 16 Sep 2003
Posts: 16
Location: Sweden

PostPosted: Sun Apr 11, 2004 6:13 pm   

removing lines from a variable
 
I have a peekscript where I store what I see as several lines in a variable, and then report it to my leader with

#forall @peekinfo {tell @tank %i}

the grabbing trigger is:
~(*)
#var peekinfo {%additem( %concat( "%1"), @peekinfo)}

What I don't want to report are certain actions, like spells being cast, talk on channels etc. What would be the easiest way to remove the lines?

For example if the variable looks like this:
{A strange presence pervades the water here. (invisible)|A large, imposing creature with a spiked tail is here.|Aldur gossips, 'well duh'}

How would I do to remove the "Aldur gossips, 'well duh'" part? Is there any way to check if a variable contains certain words and then remove those entries that match?
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Sun Apr 11, 2004 7:04 pm   
 
If you want to remove any lines containing the word gossips you could do.

#forall @list {#if (%pos("gossips",%i)) {list = %delitem("%i",@list)}}


Cheers, Jesse
Reply with quote
Aldur
Beginner


Joined: 16 Sep 2003
Posts: 16
Location: Sweden

PostPosted: Sun Apr 11, 2004 7:41 pm   
 
Ah, thanks :)
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