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

First word/Last word of a parameter

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sun Oct 12, 2014 11:02 am    Post subject: First word/Last word of a parameter Reply with quote

Maybe I overlooked something, but is there a simple way to get the first word or the last word of a parameter from an ALIAS or an ACTION ?

for example something like this:
Code:
#ACTION {The %+ kills you} {#ECHO {%1f, this is the first word};#ECHO {%1l, this is the last word}}
The Dark Knight kills you
Dark, this is the first word
Knight, this is the last word


I found this kind of functions in every client I used before, but not in this

I made my own functions to obtain that, but I'm wondering if there's already something simpler

Code:
#FUNCTION {firstWord} {#regexp {%1} {^%w} {#RETURN &1}}
#FUNCTION {lastWord} {#regexp {%1} {%w%W$} {#RETURN &1}}
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 -> Script Help 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