nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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 |
|