 |
Aldur Beginner
Joined: 16 Sep 2003 Posts: 16 Location: Sweden
|
Posted: 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? |
|
|
 |
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: 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 |
|
|
 |
Aldur Beginner
Joined: 16 Sep 2003 Posts: 16 Location: Sweden
|
Posted: Sun Apr 11, 2004 7:41 pm |
Ah, thanks :)
|
|
|
 |
|
|
|
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
|
|