|
burgoin Newbie
Joined: 23 Sep 2008 Posts: 2
|
Posted: Tue Nov 04, 2008 12:04 am
Parsing a variable flag string |
The mud that I play on has a set of variable flags that can be shown in the prompt. The flags only appear if the condition exists so the lenght and data in the flag string changes based on what conditions you are in. I have copied a sample prompt string that includes all the appropriate flags as follows:
[F_chipApStxBMXYZ |153/163hp|143/150en|123/137mv|243/258mmv|NEWS]
The flags are designated by chipApStxBMWYZ.
I have created the following trigger to trap the data from my prompt.
^~[F_&{flags} ~|&{hp}/&{hpmax}hp~|&{en}/&{enmax}en~|&{pmv}/&{pmvmax}mv~|&{mmv}/&{mmvmax}mmv~|*~]
Therefore the value that would be in the @flags variable would be chiPApStxBMWYZ.
I want to be able to search this string to determine if each character is present and if it is update variables for each so that I can control my status bar, buttons and other script control variables?
What is the best way to search this string for each individual character and how can I distinguish between the upper and lower case characters?
Thanks for any suggestions you might have. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Nov 04, 2008 3:30 am |
You are looking for the %pos function. It is case sensitive.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|