TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

uniq?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
rosc



Joined: 13 Dec 2004
Posts: 115

PostPosted: Wed Dec 07, 2005 4:43 pm    Post subject: uniq? Reply with quote

Is there a way to format a string/var to only contain 1 unique instance of a word?

And if not, can you add such a function? =)

Working on a script that will do like:

#act {You feel less protected.} {`var {needspells} {$needspells armor protection}

("You feel less protected" is a trigger for 2 different spells, 'armor' and 'protection')

If both spells go off at the same time, i'd have like "var $needspells armor protection armor protection"

which would be a needless duplication further along in the script when the spells are being casted.

So i'm looking for a way to only append a string to a var, if it is not already in the var (unique).

Maybe some function in #format can be added to accomplish this?

Thanks :)
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Thu Dec 08, 2005 5:41 pm    Post subject: Reply with quote

You can check it like this: #if {"$needspells" == "*armor protection*"} {#showme var is already set}

The * is regexp.
Back to top
View user's profile Send private message Send e-mail
moebius



Joined: 27 Jan 2005
Posts: 96

PostPosted: Fri Dec 09, 2005 12:34 am    Post subject: Reply with quote

Technically the * is a wildcard. It would need to be ".*armor protection.*" to be a regexp.
_________________
StrangeMUD - strangemud.net:9332
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group