I coloured the lines so that it is clear there are only three lines here.You are holding:
88 plain wooden vials, 58 gourd vials, 2 black iron coins, 3 whirlwind of Galleus, a suit of leather
armour, an ashen wand, 4 firefly sigils, 4 rugged, hunter's vials, a gem of transmutation, 3
ornately-carved ivory pipes, a soot-blackened tinderbox, a glob of red wax, 2 small candles, 2
vibrant sunflowers, a slender florist's box, 2 vine sigils, a white wolf vial, a tower shield, a
plain wooden pot, a diagram for a soot-blackened tinderbox, a circlet of aesthesis, an itsy-bitsy,
teeny-tiny toy violin, a fiery red tulip, a set of dig site tools, a heap of fragile, broken bones,
the skeleton of a slender, fragile humanoid, a shattered piece of pottery, a non-descript collection
of bones, a purple tulip.
You are wearing:
What follows, is my attempt at a filter trigger which will eventually allow me to condense the information. For now, I have merely been colouring/substituting the matches, to make it clear when my triggers are matching, and when they are not.
<string>(\d+).+vials,</string>
^ one there, is not. It should colour all matches "sea_green" but it does not. I am clearly doing something wrong, but I don't understand what. If I can get it to colour the matches sea_green, then I can change the script to:
inv.vials = inv.vials + matches[2]
replace("")
The eventual idea being to strip all common items from the inventory, leaving only the handful of "special" ones, and then to add a neat summary of my common stuff at the end of that, in a nice, easy to read format.
First though, I need to actually match lines like this:
58 gourd vials
in my filter trigger.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
<TriggerPackage>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Inventory</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mCommand></mCommand>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList></regexCodeList>
<regexCodePropertyList></regexCodePropertyList>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Vial Summary start</name>
<script>inv.vials=0
selectCaptureGroup(1)
fg("yellow")
replace("My Inventory:")
resetFormat()
enableTrigger("InventoryFilter")</script>
<triggerType>0</triggerType>
<conditonLineDelta>1</conditonLineDelta>
<mCommand></mCommand>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^You are holding:$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="yes" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>InventoryFilter</name>
<script>selectCaptureGroup(1)
fg("white")
replace(matches[1])
resetFormat()
</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mCommand></mCommand>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^.*,.+\.$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Vials</name>
<script>selectCaptureGroup(1)
fg("sea_green")
replace(matches[1])
resetFormat()</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mCommand></mCommand>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>(\d+).+vials,</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Vial summary end</name>
<script>disableTrigger("InventoryFilter")
selectCaptureGroup(1)
fg("yellow")
replace("My Clothing:")
resetFormat()</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mCommand></mCommand>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>You are wearing:</string>
</regexCodeList>
<regexCodePropertyList>
<integer>3</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup>
</TriggerPackage>
</MudletPackage>