Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Aug 15, 2006 11:58 pm   

[LegendMud] Strip post-titles and pre-titles
 
The following function will make it easy to strip post titles and pre titles the second one will also drop the last letter of the resulting word so it won't target on doppels/mobs

First the function(s), because this is a pretty big code it is easier to use a function and just call it from within your scripts.
Code:
#FUNC strip {%word( %word( "%1", 1, ","), %numwords( %word( "%1", 1, ",")))}
#FUNC stripall {%copy( %word( %word( "%1", 1, ","), %numwords( %word( "%1", 1, ","))), 1, %len( %word( %word( "%1", 1, ","), %numwords( %word( "%1", 1, ","))))-1)}


EXAMPLES:

#TRIGGER {(*) tickes you.} {tickle @strip("%1")}
Input: Emperor Tah, The Demon slayer tickles you.
Output: tickle tah

#TRIGGER {(*) tickes you.} {tickle @stripall("%1")}
Input: Emperor Tah, The Demon slayer tickles you.
Output: tickle ta


Edits: Fixed typos, and missing code bits, kthxbai
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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