<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
    <TriggerPackage>
        <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Sound Alerts</name>
            <script>
-- TODO 
  -- Ice Age
  -- Lasertag: The lasertag game will close in 1 minute.

-- this is workaround for know Mudlet's issue (requires linux)
os.execute(&quot;aplay /usr/share/sounds/alsa/Front_Center.wav&quot;)
</script>
            <triggerType>0</triggerType>
            <conditonLineDelta>0</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile>/usr/share/sounds/alsa/Front_Center.wav</mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList>
                <string>QUEST: You may now quest again.</string>
                <string>Global Quest: See 'Help Global Quests'</string>
                <string>Ice Age</string>
            </regexCodeList>
            <regexCodePropertyList>
                <integer>0</integer>
                <integer>0</integer>
                <integer>0</integer>
            </regexCodePropertyList>
        </Trigger>
        <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Auto Re-SpellUp</name>
            <script>su.reSpellUpMe()</script>
            <triggerType>0</triggerType>
            <conditonLineDelta>0</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList>
                <string>{affoff}</string>
                <string>{recoff}</string>
            </regexCodeList>
            <regexCodePropertyList>
                <integer>0</integer>
                <integer>0</integer>
            </regexCodePropertyList>
        </Trigger>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Gag/Delete Lines</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>99</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList/>
            <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>Gag/Delete Lines</name>
                <script>deleteLine()</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^You have set your character to receive no experience points!$</string>
                    <string>^&lt;MAPSTART&gt;$</string>
                    <string>^&lt;MAPEND&gt;$</string>
                    <string>^{stats}</string>
                    <string>^--&gt; TICK &lt;--</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Prompt Gag end</name>
                <script>temp_prompt_gag = false</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>{prompt-gag-end}</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>0</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Prompt Gag</name>
                <script>
if temp_prompt_gag then
	deleteLine()
end
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^\[\d+/\d+h \d+/\d+m \d+% (\d+)qt (.*)tnl] \{(.*)\} &gt;</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Highlighting</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>99</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList/>
            <regexCodePropertyList/>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>room graffiti</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#aa5500</mFgColor>
                <mBgColor>#343434</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>\(G\)$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>other exits</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#3c005a</mFgColor>
                <mBgColor>#919148</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>(other)\]$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>quest target</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#d800d8</mFgColor>
                <mBgColor>#0b0b0b</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>\[TARGET\]$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>{.*end} keyword</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#0000ff</mFgColor>
                <mBgColor>#161616</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>{.*end}</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>spell failed</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ffff7f</mFgColor>
                <mBgColor>#39382e</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>{sfail}</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>0</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Flee</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#c3c3c3</mFgColor>
                <mBgColor>#2a2a2a</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^((.*)has fled!)$</string>
                    <string>You flee from combat!</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                    <integer>0</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Re-Arm</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>0</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList/>
            <regexCodePropertyList/>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>disarm</name>
                <script>
-- TODO try to use full name (need to amend regex)
--send(&quot;wiel '&quot; .. matches[3] .. &quot;'&quot;)

send(&quot;get all&quot;)
send(&quot;wiel &quot; .. matches[3])
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#55ffff</mFgColor>
                <mBgColor>#000000</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>(.*DISARMS you and sends your.* )(.*)( flying!)</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>overpower</name>
                <script>
-- TODO see note on disarm

send(&quot;wiel &quot; .. matches[3])
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>(.*You stop wielding.* )(.*)( in your primary hand.!)</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Capture Windows</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>99</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList/>
            <regexCodePropertyList/>
            <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Chat Log</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>return AConf.Enabled.ChatLog</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>4</integer>
                </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>communication</name>
                    <script>
MAGU.selectCaptured(MAG.name_cl, 3)
MAGU.moveSelected(MAG.name_cl, true)
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>0</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^()({say}.*)$</string>
                        <string>^({tell})(.*)$</string>
                        <string>^({chan ch=[^}]*})(.*)$</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                    </regexCodePropertyList>
                </Trigger>
                <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>remote socials</name>
                    <script>
-- only way how to detect remote socials is to check color
selectString(matches[2],1)
r,g,b = getFgColor()
if r==0 and g==128 and b==128 then
	MAGU.selectCaptured(MAG.name_cl)
	MAGU.moveSelected(MAG.name_cl, true)
end
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>99</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <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>
                <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>various info</name>
                    <script>
MAGU.selectCaptured(MAG.name_cl, 3)
MAGU.moveSelected(MAG.name_cl, true)
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>0</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^()(INFO: .*)$</string>
                        <string>^()(Global Quest: .*)$</string>
                        <string>^()(Lasertag: .*)$</string>
                        <string>^()(WARFARE: .*)$</string>
                        <string>^()(GENOCIDE: .*)$</string>
                        <string>^()(RAIDINFO: .*)$</string>
                        <string>^()(DUEL: .*)$</string>
                        <string>^()((.*) has challenged you to a duel[.])$</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                        <integer>1</integer>
                    </regexCodePropertyList>
                </Trigger>
            </TriggerGroup>
            <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Extra Info</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>return AConf.Enabled.ExtraInfo</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>4</integer>
                </regexCodePropertyList>
                <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>Quests</name>
                    <script></script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>0</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList/>
                    <regexCodePropertyList/>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="yes" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>start of quest</name>
                        <script>
MAGU.clear(MAG.name_ei)
MAGU.echo(MAG.name_ei, multimatches[1][4] .. &quot;\n&quot;)
MAGU.echo(MAG.name_ei, &quot;   &quot; .. multimatches[2][4] .. &quot;\n&quot;)
MAGU.echo(MAG.name_ei, &quot;   &quot; .. multimatches[3][4] .. &quot;\n\n&quot;)

temp_timer_quest = os.time()
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>3</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>^((Questor|A QuestoR) tells you 'Seek )(.*)( out somewhere in the vicinity')$</string>
                            <string>^((Questor|A QuestoR) tells you 'of )(.*)( which is in the general area')$</string>
                            <string>^((Questor|A QuestoR) tells you 'of )(.*)([.]')$</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>1</integer>
                            <integer>1</integer>
                            <integer>1</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>quest mob killed</name>
                        <script>
MAGU.selectCaptured(MAG.name_ei)
MAGU.moveSelected(MAG.name_ei, true)
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>99</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>^Return to the questmaster before your time runs out[.]$</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>1</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="yes" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>end of quest - multiline</name>
                        <script>
local questTime = os.difftime(os.time(), (temp_timer_quest or 0))
MAGU.echo(MAG.name_ei, &quot;Quest time: &quot; .. questTime .. &quot;s\n\n&quot;)

MAGU.selectCaptured(MAG.name_ei, 4)
MAGU.copySelected(MAG.name_ei)

-- update quest time
if MAG.sa_questTime then
	MAG.sa_questTime = 30
	MAG.updateStatusArea()
end
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>0</conditonLineDelta>
                        <mStayOpen>8</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>^((Questor|A QuestoR) tells you ')(As a reward, I am giving you (.*) quest points and (.*) gold[.])'$</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>1</integer>
                        </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>Items</name>
                            <script>
--&lt;questor name&gt; tells you 'Congratulations &lt;playername&gt; on completing your quest!'
--&lt;questor name&gt; tells you 'As a reward, I am giving you 111 quest points and 111 gold.'
--&lt;questor name&gt; tells you 'I am also giving you 111 quest points tier bonus.'
--You get lucky and gain an extra 111 quest points.
--** You gain a bonus training session **   ( 111 training sessions )
--** You gain a bonus 111 practices **      (** You gain a bonus practice ** )
--** You gain a bonus trivia point! **
--You gain an extra 2 quest points 'MCCP Bonus'. 

MAGU.selectCaptured(MAG.name_ei, 3)
MAGU.copySelected(MAG.name_ei)
</script>
                            <triggerType>0</triggerType>
                            <conditonLineDelta>8</conditonLineDelta>
                            <mStayOpen>0</mStayOpen>
                            <mCommand></mCommand>
                            <mFgColor>#ff0000</mFgColor>
                            <mBgColor>#ffff00</mBgColor>
                            <mSoundFile></mSoundFile>
                            <colorTriggerFgColor>#000000</colorTriggerFgColor>
                            <colorTriggerBgColor>#000000</colorTriggerBgColor>
                            <regexCodeList>
                                <string>^()(You get lucky and gain an extra (.*) quest points[.])$</string>
                                <string>^()([*][*] You gain a bonus (.*)training sessions? [*][*])</string>
                                <string>^()([*][*] You gain a bonus (.*)practices? [*][*])</string>
                                <string>^()([*][*] You gain a bonus trivia point! [*][*])</string>
                                <string>^()(You gain an extra 2 quest points 'MCCP Bonus'[.])$</string>
                                <string>^(A QuestoR tells you ')(I am also giving you (.*) quest points tier bonus[.])'$</string>
                                <string>^(Questor tells you ')(I am also giving you (.*) quest points tier bonus[.])'$</string>
                            </regexCodeList>
                            <regexCodePropertyList>
                                <integer>1</integer>
                                <integer>1</integer>
                                <integer>1</integer>
                                <integer>1</integer>
                                <integer>1</integer>
                                <integer>1</integer>
                                <integer>1</integer>
                            </regexCodePropertyList>
                        </Trigger>
                    </TriggerGroup>
                </TriggerGroup>
                <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>GQs &amp; CPs</name>
                    <script>
-- TODO still missing string for items

-- You still have to kill 1 * a messenger (Central square)
-- You still have to kill 2 * a messenger (Central square)
-- You still have to kill 4 * a messenger (Central square)
-- (followed by blank line)
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>99</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList/>
                    <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>mobs/items to info</name>
                        <script>
-- TODO get string for cp/gq items

if not temp_need_gq_sep then
	temp_need_gq_sep = true
	MAGU.clear(MAG.name_ei)
end

-- You still have to kill 1 * a messenger (Central square)
MAGU.echo(MAG.name_ei, matches[2] .. &quot;\n&quot;)
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>0</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>You still have to kill (.*)$</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>1</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>add final blank line to info</name>
                        <script>
if temp_need_gq_sep then
	temp_need_gq_sep = false
	MAGU.echo(MAG.name_ei, &quot;\n&quot;)
end
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>0</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <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>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>gq mob killed</name>
                        <script></script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>99</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand>gq c</mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>Congratulations, that was one of the GLOBAL QUEST mobs!</string>
                            <string>Global Quest: Use 'gquest info' to see the targets.</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>0</integer>
                            <integer>0</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>cp mob killed</name>
                        <script></script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>99</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand>cp c</mCommand>
                        <mFgColor>#000018</mFgColor>
                        <mBgColor>#660099</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>Congratulations, that was one of your CAMPAIGN mobs!</string>
                            <string>Commander Barcett tells you 'Good luck in your campaign!'</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>0</integer>
                            <integer>0</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>end of cp</name>
                        <script>
-- TODO copy some results there
----------------------------------------------------------------
--CONGRATULATIONS! You have completed your campaign.
--                 Reward of 33 quest points added.
--                 Reward of 5222 gold coins added.
--You will have to level before you can go on another campaign.
----------------------------------------------------------------

MAGU.echo(MAG.name_ei, &quot;\nCP completed - WELL DONE&quot;)
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>0</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>CONGRATULATIONS! You have completed your campaign.</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>0</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <Trigger isActive="no" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>end of gq</name>
                        <script>
-- TODO same as cp
-- plus you LOST
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>99</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>bla bla</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>0</integer>
                        </regexCodePropertyList>
                    </Trigger>
                </TriggerGroup>
                <TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="yes" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>Account Info</name>
                    <script>
MAGU.echo(MAG.name_ei)
MAGU.selectCaptured(MAG.name_ei)
MAGU.copySelected(MAG.name_ei)
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>99</conditonLineDelta>
                    <mStayOpen>8</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^Gold on hand(.*)$</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                    </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>Items</name>
                        <script>
-- TODO this is not holding BID information yet

MAGU.selectCaptured(MAG.name_ei)
MAGU.copySelected(MAG.name_ei)
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>0</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>^Gold in the bank(.*)$</string>
                            <string>^Net Worth(.*)$</string>
                            <string>^Trivia Points(.*)$</string>
                            <string>^Quest Points(.*)$</string>
                            <string>^Gold Committed(.*)$</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>1</integer>
                            <integer>1</integer>
                            <integer>1</integer>
                            <integer>1</integer>
                            <integer>1</integer>
                        </regexCodePropertyList>
                    </Trigger>
                </TriggerGroup>
            </TriggerGroup>
            <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Mini Map</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>return AConf.Enabled.MiniMap</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>4</integer>
                </regexCodePropertyList>
                <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="yes" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>Map Start</name>
                    <script>
temp_mapstarted = true
MAGU.clear(MAG.name_mm)
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>99</conditonLineDelta>
                    <mStayOpen>15</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^&lt;MAPSTART&gt;$</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                    </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>Map End</name>
                        <script>temp_mapstarted = false</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>0</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <mCommand></mCommand>
                        <mFgColor>#ff0000</mFgColor>
                        <mBgColor>#ffff00</mBgColor>
                        <mSoundFile></mSoundFile>
                        <colorTriggerFgColor>#000000</colorTriggerFgColor>
                        <colorTriggerBgColor>#000000</colorTriggerBgColor>
                        <regexCodeList>
                            <string>^&lt;MAPEND&gt;$</string>
                        </regexCodeList>
                        <regexCodePropertyList>
                            <integer>1</integer>
                        </regexCodePropertyList>
                    </Trigger>
                    <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                        <name>Map Line</name>
                        <script>
if temp_mapstarted then
	-- move line to map
	MAGU.selectCaptured(MAG.name_mm)
	MAGU.moveSelected(MAG.name_mm)
end 
</script>
                        <triggerType>0</triggerType>
                        <conditonLineDelta>99</conditonLineDelta>
                        <mStayOpen>0</mStayOpen>
                        <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>
                </Trigger>
            </TriggerGroup>
            <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Status Area</name>
                <script></script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>return AConf.Enabled.StatusArea</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>4</integer>
                </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>Status update</name>
                    <script>MAG.updateStatusArea(matches[2])
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>99</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^{stats}(.*)$</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                    </regexCodePropertyList>
                </Trigger>
                <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>Prompt</name>
                    <script>
-- [260/260h 180/180m 100% 16qt 1855tnl] {Deep in the Forest} &gt; 
MAG.sa_roomName = matches[4]
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>0</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#ff0000</mFgColor>
                    <mBgColor>#ffff00</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^\[\d+/\d+h \d+/\d+m \d+% (\d+)qt (.*)tnl] \{(.*)\} &gt;</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                    </regexCodePropertyList>
                </Trigger>
                <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                    <name>MUD Tick</name>
                    <script>
if AConf.Enabled.TickTimer then
	MAG.tick.start()
end

if matches[5] then
	MAG.sa_questTime = matches[5]
end

-- update monitor after each tick
send(&quot;&quot;)
</script>
                    <triggerType>0</triggerType>
                    <conditonLineDelta>0</conditonLineDelta>
                    <mStayOpen>0</mStayOpen>
                    <mCommand></mCommand>
                    <mFgColor>#000035</mFgColor>
                    <mBgColor>#000000</mBgColor>
                    <mSoundFile></mSoundFile>
                    <colorTriggerFgColor>#000000</colorTriggerFgColor>
                    <colorTriggerBgColor>#000000</colorTriggerBgColor>
                    <regexCodeList>
                        <string>^(--&gt; TICK &lt;--)( \((.*) Qt: (\d+)(, T:.*)?\))?</string>
                    </regexCodeList>
                    <regexCodePropertyList>
                        <integer>1</integer>
                    </regexCodePropertyList>
                </Trigger>
            </TriggerGroup>
        </TriggerGroup>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Statistics</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>0</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList>
                <string>return AConf.Enabled.Statistics</string>
            </regexCodeList>
            <regexCodePropertyList>
                <integer>4</integer>
            </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>kills</name>
                <script>stats.addKill()</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^You receive (.*) experience points[.]$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>exp</name>
                <script>
stats.addExp(matches[2])

-- You receive 103 experience points.
-- You receive 103 bonus experience points in honor of Maxx reaching superhero.
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^You receive (.*) experience points[.]$</string>
                    <string>^You receive (.*) bonus experience points (.*)[.]$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>gold</name>
                <script>
stats.addGold(matches[3])

-- You get 3 gold coins from the ashen-grey corpse of a jumping cholla.
-- Ayla gives you 4 gold coins for the battered corpse of a sand snake.
-- A QuestoR tells you 'As a reward, I am giving you 12 quest points and 2579 gold.'
-- The treasure of gold coins crumbles into 40 gold pieces.
-- You sell 5 * a sapphire gem to Peto, the bard hall cook for 98 gold.
-- Reward of 1000 gold coins added.


-- TODO
--   group share
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^()You get (.*) gold coins? from (.*) corpse of (.*)[.]$</string>
                    <string>^()Ayla gives you (.*) gold coins? for (.*)[.]$</string>
                    <string>'As a reward, I am giving you (.*) quest points and (.*) gold.'</string>
                    <string>^(.*) crumbles into (.*) gold pieces?[.]$</string>
                    <string>^You sell (.*) for (.*) gold[.]$</string>
                    <string>^()Reward of (.*) gold coins? added[.]$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>qp</name>
                <script>
stats.addQp(matches[2])

-- A QuestoR tells you 'As a reward, I am giving you 12 quest points and 2579 gold.'
-- You gain an extra 2 quest points 'MCCP Bonus'.
-- You get lucky and gain an extra 2 quest points.
-- 3 quest points awarded.
-- Reward of 20 quest points added.


-- TODO
--   gq
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>'As a reward, I am giving you (.*) quest points and (.*) gold.'</string>
                    <string>^You gain an extra (.*) quest points 'MCCP Bonus'[.]$</string>
                    <string>^You get lucky and gain an extra (.*) quest points[.]$</string>
                    <string>^(.*) quest points awarded[.]$</string>
                    <string>^Reward of (.*) quest points added[.]$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Barter Watcher</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>0</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList>
                <string>return AConf.Enabled.BarterWatcher</string>
            </regexCodeList>
            <regexCodePropertyList>
                <integer>4</integer>
            </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>AFK on</name>
                <script>temp_afk = true</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^You are now in AFK mode[.]</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>AFK off</name>
                <script>temp_afk = false</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^AFK mode removed[.]</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Auction</name>
                <script>
local out = &quot;bid &quot; .. matches[2]
if temp_afk then
	out = &quot;afk;; &quot; .. out .. &quot; ;; afk&quot;
end
send(out)
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>0</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>Auction: .* is auctioning .* \(Level .*, Num (.*)\)\. Current bid is .*\.</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
            <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>Market</name>
                <script>
local out = &quot;lbid &quot; .. matches[2]
if temp_afk then
	out = &quot;afk;; &quot; .. out .. &quot; ;; afk&quot;
end
send(out)
</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>Market: Bid of .* on .* \(Level .*, Num (.*)\)</string>
                    <string>Market: .* is selling .* \(Level .*, Num (.*)\)</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
    </TriggerPackage>
    <TimerPackage/>
    <AliasPackage>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Lua helpers</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>Run Lua code with ! prefix</name>
                <script>
-- USAGE:  
--   !commnad
--
-- EXAMPLE:
--   !echo(&quot;Hello from Lua&quot;)

assert(loadstring(matches[2]))()
</script>
                <command></command>
                <regex>^!(.+)$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>Repeat command</name>
                <script>
-- USAGE: 
--   rep N command
--
-- EXAMPLE:
--   rep 3 hey
-- will send following to mud
--   hey
--   hey
--   hey

for i = 1, tonumber(matches[2]) do
	send(matches[3])
end
send(&quot;echo {loop-end}&quot;)
</script>
                <command></command>
                <regex>^rep (\d+) (.*)$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>Loop with index</name>
                <script>
-- USAGE:  
--   loo 9 pref, suf
--   loop 9 pref, suf
--
-- EXAMPLE:
--   loo 3 where, ant
-- will send following to mud
--   where 1.ant
--   where 2.ant
--   where 3.ant

for i = 1, tonumber(matches[2]) do
	send(matches[3] .. &quot; &quot; .. i .. &quot;.&quot; .. matches[4])
end
send(&quot;echo {loop-end}&quot;)
</script>
                <command></command>
                <regex>^loop? (\d+) (.*), (.*)$</regex>
            </Alias>
        </AliasGroup>
        <Alias isActive="yes" isFolder="no">
            <name>recall, eat and sleep</name>
            <script></script>
            <command>recall ;; run u3n ;; drin ;; run 5nen ;; sle bed</command>
            <regex>^bed$</regex>
        </Alias>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Info</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>list learned spells</name>
                <script></script>
                <command>spells learned</command>
                <regex>^lll$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>list combat spells</name>
                <script></script>
                <command>spells combat</command>
                <regex>^ll$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>consider all</name>
                <script></script>
                <command>con all</command>
                <regex>^ca$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>listen to</name>
                <script>send(&quot;listen &quot; .. matches[2])</script>
                <command></command>
                <regex>^ls( .*)$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>market search 0 1</name>
                <script></script>
                <command>market search 0 1</command>
                <regex>^ms$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>lastkills</name>
                <script>send(&quot;lastkills &quot; .. (matches[2] or &quot;20&quot;))</script>
                <command></command>
                <regex>^lk( .*)?$</regex>
            </Alias>
        </AliasGroup>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Quests</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>quest request</name>
                <script>send (&quot;wake ;; &quot; .. AConf.Actions.recallPortal .. &quot; ;; &quot; .. AConf.Actions.rtQuestor .. &quot; ;; q r&quot;)</script>
                <command></command>
                <regex>^qr$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>quest complete</name>
                <script>send (AConf.Actions.recallPortal .. &quot; ;; &quot; .. AConf.Actions.rtQuestor .. &quot; ;; q c&quot;)</script>
                <command></command>
                <regex>^qc$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>quest info</name>
                <script></script>
                <command>q i</command>
                <regex>^qi$</regex>
            </Alias>
        </AliasGroup>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Items</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>get all</name>
                <script>send(&quot;get all&quot; .. (matches[2] or &quot;&quot;))</script>
                <command></command>
                <regex>^ga( .*)?$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>drop all</name>
                <script></script>
                <command>drop all</command>
                <regex>^da$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>sacrifice all</name>
                <script></script>
                <command>sac all</command>
                <regex>^sa$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>wear item</name>
                <script>
-- default we is for going west
send(&quot;wear &quot; .. matches[2])
</script>
                <command></command>
                <regex>^we( .*)$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>keep all keys</name>
                <script></script>
                <command>keep all.key ;; i filter key</command>
                <regex>^kk$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>use invisibility ring</name>
                <script></script>
                <command>vis ;; shadow ;; r 'invis ring' ;; wea 'invis ring' ;; aflag</command>
                <regex>^inv$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>use portal to recall</name>
                <script>send (AConf.Actions.recallPortal)</script>
                <command></command>
                <regex>^[.]$</regex>
            </Alias>
        </AliasGroup>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Hunt</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>where</name>
                <script>send(&quot;where&quot; .. (matches[2] or &quot;&quot;))</script>
                <command></command>
                <regex>^v( .*)?$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>scan</name>
                <script>send(&quot;scan&quot; .. (matches[2] or &quot;&quot;))</script>
                <command></command>
                <regex>^x( .*)?$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>where all</name>
                <script>
-- USAGE: 
--   va &lt;mob&gt;
--
-- EXAMPLE:
--   va imp
-- will send following to mud
--   where 1.imp
--   where 1.imp
--   ...

temp_prompt_gag = true
for i = 1, 9 do
	send(&quot;where &quot; .. i .. &quot;.&quot; .. matches[2])
end
send(&quot;echo {prompt-gag-end}&quot;)
</script>
                <command></command>
                <regex>^va (.*)$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>hunt all</name>
                <script>
-- USAGE: 
--   ha &lt;mob&gt;
--
-- EXAMPLE:
--   ha imp
-- will send following to mud
--   hunt 1.imp
--   hunt 1.imp
--   ...

temp_prompt_gag = true
for i = 1, 9 do
	send(&quot;hunt &quot; .. i .. &quot;.&quot; .. matches[2])
end
send(&quot;echo {prompt-gag-end}&quot;)

</script>
                <command></command>
                <regex>^ha (.*)$</regex>
            </Alias>
        </AliasGroup>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Statistics</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>Print stats</name>
                <script>
if AConf.Enabled.Statistics then
	stats.print()
else
	send(&quot;sp&quot;)
end
</script>
                <command></command>
                <regex>^sp$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>Reset stats</name>
                <script>
if AConf.Enabled.Statistics then
	stats.print()
	stats.reset()
else
	send(&quot;sr&quot;)
end
</script>
                <command></command>
                <regex>^sr$</regex>
            </Alias>
        </AliasGroup>
    </AliasPackage>
    <ActionPackage/>
    <ScriptPackage>
        <ScriptGroup isActive="yes" isFolder="yes">
            <name>Geyser</name>
            <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

-- UNCOMMENT EVERYTHING BELOW THIS LINE FOR VERSIONS PRIOR TO 1.1.0
myoldresizer = myoldresizer or handleWindowResizeEvent
function handleWindowResizeEvent()
	raiseEvent(&quot;sysWindowResizeEvent&quot;)
end</script>
            <eventHandlerList/>
            <Script isActive="yes" isFolder="no">
                <name>GeyserGeyser</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--==================================================
-- Create the Geyser Root Container
--==================================================

--- Create the Geyser namespace.
-- Geyser is considered to be a &quot;container window&quot; for the purposes
-- of default limits for new windows, in fact, it is the root container
-- window, and is the metatable for Geyser.Container. It has the 
-- minimum number of functions needed to behave as a Container.
Geyser = Geyser or {i = 0, x = 0, y = 0}
Geyser.width, Geyser.height = getMainWindowSize()

Geyser.get_x = function () return 0 end
Geyser.get_y = function () return 0 end
Geyser.get_width = function () return getMainWindowSize() end
Geyser.get_height = function () local w,h = getMainWindowSize() return h end
Geyser.name = &quot;Geyser Root Window&quot;
Geyser.__index = Geyser

-- Create the window list for updates
Geyser.windowList = Geyser.windowList or {}

--- Add a window to the list that this container manages.
-- @param window The window to add this container
function Geyser:add (window, cons)
   cons = cons or window -- 'cons' is optional
   
   -- Stop other container from controlling this window
	if window.container then
	   window.container:remove(window)
	end

   -- Assume control of this window
   window.container = self
   self.windowList[window.name] = window
   Geyser.set_constraints(window, cons, self)
   window:reposition()
   window:show()
end

--- Removes a window from the list that it manages
-- @param window The window to remove from this container's
-- windowList
function Geyser:remove (window)
   self.windowList[window.name] = nil
end</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserUtil</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- Generate a window name unique to this session.
function Geyser.nameGen (type)
   local index = Geyser.i
   local t = type or &quot;window&quot;
   Geyser.i = Geyser.i + 1
   return &quot;anon_&quot; .. t .. &quot;_&quot; .. index
end

--- Hide all managed windows.
function Geyser.hideAll(type)
   for _,v in pairs(Geyser.windowList) do
      if v.type == type or not type then
         v:hide()
      end
   end
end

--- Show all managed windows.
function Geyser.showAll(type)
   for _,v in pairs(Geyser.windowList) do
      if v.type == type or not type then
         v:show()
      end
   end
end

--- Non-recursive display of an item, because the normal 'display' was
-- causing Mudlet to hang. Not sure why.
function Geyser.display (table)
	echo(&quot;------ &quot; .. type(table) .. &quot; ------\n&quot;)
	if type(table) == &quot;table&quot; then
		for k,v in pairs(table) do
			echo(&quot;'&quot; .. tostring(k) .. &quot;' - &quot; .. tostring(v) .. &quot;\n&quot;)
		end
	else
		echo(tostring(table) .. &quot;\n&quot;)
	end
end

--- Clone a table, for good fun and profit.
function Geyser.copyTable (table)
	local copy = {}
    if table then
		for k,v in pairs(table) do
			-- do deep copy on a table if it requests one by having the __clone function defined.
			if type(v) == &quot;table&quot; and v.__clone then
				copy[k] = v.__clone()
			else
				copy[k] = v
			end
		end
	end
	return copy
end</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserColor</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

Geyser.Color = {}

--- Converts color to 3 hex values as a string, no alpha, css style
-- @return The color formatted as a hex string, as accepted by html/css
function Geyser.Color.hex (r,g,b)
   return string.format(&quot;#%02x%02x%02x&quot;, Geyser.Color.parse(r, g, b))
end

--- Converts color to 4 hex values as a string, with alpha, css style
-- @return The color formatted as a hex string, as accepted by html/css
function Geyser.Color.hexa (r,g,b,a)
   return string.format(&quot;#%02x%02x%02x%02x&quot;, Geyser.Color.parse(r, g, b, a))
end

--- Converts color to 3 hex values as a string, no alpha, hecho style
-- @return The color formatted as a hex string, as accepted by hecho
function Geyser.Color.hhex (r,g,b)
   return string.format(&quot;|c%02x%02x%02x&quot;, Geyser.Color.parse(r, g, b))
end

--- Converts color to 4 hex values as a string, with alpha, hecho style
-- @return The color formatted as a hex string, as accepted by hecho
function Geyser.Color.hhexa (r,g,b,a)
   return string.format(&quot;|c%02x%02x%02x%02x&quot;, Geyser.Color.parse(r, g, b, a))
end

--- Converts color to 3 decimal values as a string, no alpha, decho style
-- @return The color formatted as a decho() style string
function Geyser.Color.hdec (r,g,b)
   return string.format(&quot;&lt;%d,%d,%d&gt;&quot;, Geyser.Color.parse(r, g, b))
end

--- Converts color to 4 decimal values as a string, with alpha, decho style
-- @return The color formatted as a decho() style string
function Geyser.Color.hdeca (r,g,b,a)
   return string.format(&quot;&lt;%d,%d,%d,%d&gt;&quot;, Geyser.Color.parse(r, g, b, a))
end

--- Returns 4 color components from (nearly any) acceptable format.  Colors can be
-- specified in two ways.  First: as a single word in english (&quot;purple&quot;) or
-- hex (&quot;#AA00FF&quot;, &quot;|cAA00FF&quot;, or &quot;0xAA00FF&quot;) or decimal (&quot;&lt;190,0,255&gt;&quot;). If
-- the hex or decimal representations contain a fourth element then alpha is
-- set too - otherwise alpha can't be set this way.  Second: by passing in
-- distinct components as unsigned integers (e.g. 23 or 0xA7).  When using the
-- second way, at least three values must be passed.  If only three are
-- passed, then alpha is 255.  Third: by passing in a table that has explicit 
-- values for some, all or none of the keys r,g,b, and a.
-- @param red Either a valid string representation or the red component.
-- @param green The green component.
-- @param blue The blue component.
-- @param alpha The alpha component.
function Geyser.Color.parse(red, green, blue, alpha)
   local r,g,b,a = 0,0,0,255

   -- have to have something to set, else can't do anything!
   if not red then
      print(&quot;No color supplied.\n&quot;)
      return
   end
   
   -- function to return next number
   local next_num = nil
   local base = 10
   -- assigns all the colors, used after we figure out how the color is
   -- represented as a string
   local assign_colors = function ()
                            r = tonumber(next_num(), base)
                            g = tonumber(next_num(), base)
                            b = tonumber(next_num(), base)
                            local has_a = next_num() 
                            if has_a then
                               a = tonumber(has_a, base)
                            end
                         end
   
   -- Check if we were passed a string or table that needs to be parsed, i.e.,
   -- there is only a valid red value, and other params are nil.
   if not green or not blue then
      if type(red) == &quot;table&quot; then
         -- Here just copy over the appropriate values with sensible defaults
         r = red.r or 127
         g = red.g or 127
         b = red.b or 127
         a = red.a or 255
         return r,g,b,a
      elseif type(red) == &quot;string&quot; then
         -- first case is a hex string, where first char is '#'
         if string.find(red, &quot;^#&quot;) then
            local pure_hex = string.sub(red, 2) -- strip format char
            next_num = string.gmatch(pure_hex, &quot;%w%w&quot;)
            base = 16

            -- second case is a hex string, where first chars are '|c' or '0x'
         elseif string.find(red, &quot;^[|0][cx]&quot;) then
            local pure_hex = string.sub(red, 3) -- strip format chars
            next_num = string.gmatch(pure_hex, &quot;%w%w&quot;)
            base = 16
            
            -- third case is a decimal string, of the format &quot;&lt;dd,dd,dd&gt;&quot;
         elseif string.find(red, &quot;^&lt;&quot;) then
            next_num = string.gmatch(red, &quot;%d+&quot;)

            -- fourth case is a named string
         elseif color_table[red] then
            local i = 0
            local n = #color_table[red]
            next_num = function () -- create a simple iterator
                          i = i + 1
                          if i &lt;= n then return color_table[red][i]
                          else return nil end
                       end
            
         else
            -- finally, no matches, do nothing
            return
         end
      end

   else
      -- Otherwise we weren't passed a complete string, but instead discrete
      -- components as either decimal or hex
      -- Yes, this is a little silly to do this way, but it fits with the
      -- rest of the parsing going on...
      local i = 0
      next_num = function ()
                    i = i + 1
                    if i == 1 then return red
                    elseif i == 2 then return green
                    elseif i == 3 then return blue
                    elseif i == 4 then return alpha
                    else return nil
                    end
                 end
   end
   assign_colors()
   return r,g,b,a
end

--- Applies colors to a window drawing from defaults and overridden values.
-- @param cons The window to apply colors to
function Geyser.Color.applyColors(cons)
   cons:setFgColor(cons.fgColor)
   cons:setBgColor(cons.bgColor)
   cons:setColor(cons.color)
end</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserSetConstraints</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- This function sets the constraints of a window.
-- It doesn't mess with anything other than positioning data.  It
-- creates get_x(), get_y(), get_width(), and get_height() functions
-- for 'window'
-- @param window The window to create the constraints for.
-- @param cons A table that holds the constraints.
-- @param container A table that holds maximum position values and
-- represents the dimensions of the &quot;window&quot; that holds whatever
-- widget is being created.
function Geyser.set_constraints (window, cons, container)
   -- If container is nil then by default it is the dimensions of the main window
   container = container or Geyser

   -- GENERATE CONSTRAINT AWARE POSITIONING FUNCTIONS
   -- Parse the position constraints to generate functions that will get
   -- window dimensions according to those constraints. Also, update position
   -- information.  The order that the dimensions are specified in the for
   -- loop is important so that get_x() and get_y() are defined before they
   -- needed by width and height.
   for _,v in ipairs{&quot;x&quot;, &quot;y&quot;, &quot;width&quot;, &quot;height&quot;} do
      local getter = &quot;get_&quot; .. v -- name of the function to calculate the

      -- if passed a number assume pixels are meant
      if type(cons[v]) == &quot;number&quot; then
         cons[v] = string.format(&quot;%dpx&quot;, cons[v])
      end
      
      -- Parse the constraint
      if string.find(cons[v], &quot;%%&quot;) then
         -- This handles dimensions as a percentage of the container.
         -- Negative percentages are converted to the equivalent positive.
         --------------------------------------------------------------   

         -- scale is a value between 0 and 1   
         local scale = tonumber((string.gsub(cons[v], &quot;%%&quot;, &quot;&quot;))) / 100.0
         if scale &lt; 0 then
            scale = 1 + scale
         end
         local dim = &quot;&quot;
         local min, max = 0,0

         if v == &quot;x&quot; then
            min = &quot;container.get_x()&quot;
            max = &quot;container.get_width()&quot;
         elseif v == &quot;width&quot; then
            max = &quot;container.get_width()&quot;
         elseif v == &quot;y&quot; then
            min = &quot;container.get_y()&quot;
            max = &quot;container.get_height()&quot;
         else
            max = &quot;container.get_height()&quot;
         end
         
         -- Define the getter function
         local src = &quot;local self,container = ...  return function () return &quot; .. min .. &quot; + (&quot; .. scale .. &quot; * &quot; .. max .. &quot;) end&quot;
         
         -- compile the getter
         window[getter] = assert(loadstring(src, &quot;getter for &quot; .. v))(window,container)
         
      else
         -- This handles absolute positioning and character positioning
         -- Negative values indicated positioning from the anti-origin.
         -- Pre: cons[v] must contain &quot;px&quot; or &quot;c&quot;
         --------------------------------------------------------------
         
         -- Create default values
         local x_mult, y_mult = 1,1 -- by default assume not &quot;c&quot;
         local negative = string.find(cons[v], &quot;-&quot;) or false -- detect &quot;negative&quot; 0
         
         -- As is, font size is considered a constraint
         if string.find(cons[v], &quot;c&quot;) then
            x_mult, y_mult = calcFontSize(window.fontSize)
         end
         
         local pos = tonumber((string.gsub(cons[v], &quot;%a&quot;, &quot;&quot;)))
         local max = 0
         local min = 0

         if v == &quot;x&quot; then
            min = &quot;container.get_x()&quot;
            pos = x_mult * pos
         elseif v == &quot;width&quot; then
            pos = x_mult * pos
         elseif v == &quot;y&quot; then
            min = &quot;container.get_y()&quot;
            pos = y_mult * pos
         else
            pos = y_mult * pos
         end

         -- Treat negative values differently
         if negative then
            if v == &quot;x&quot; then
               min = &quot;container.get_x()&quot;
               max = &quot;container.get_width()&quot;
            elseif v == &quot;width&quot; then
               min = &quot;container.get_x()&quot;
               max = &quot;container.get_width()&quot;
               pos = string.format(&quot;(%d - self:get_x())&quot;, pos)
            elseif v == &quot;y&quot; then 
               min = &quot;container.get_y()&quot;
               max = &quot;container.get_height()&quot;
            else -- v == &quot;height&quot;
               min = &quot;container.get_y()&quot;
               max = &quot;container.get_height()&quot;
               pos = string.format(&quot;(%d - self:get_y())&quot;, pos)
            end
         end

         -- Define the getter function
         local src = &quot;local self, container = ... return function () return &quot; .. max .. &quot; + &quot; .. min .. &quot; + &quot; .. pos .. &quot; end&quot;

         -- compile the getter
         window[getter] = assert(loadstring(src, &quot;getter for &quot; .. v))(window, container)
      end
      
      -- Here the actual value of the dimension is set according to the
      -- constraints requested.
      --window[v] = window[getter]()
   end -- END for that generates POSITION FUNCTIONS

   window:reposition()
end</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserContainer</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- Represents a generic container with positional information.
-- Has no notion of contents and is used to contain other windows
-- and impose some sense of order.
-- @class table
-- @name Geyser.Container
-- @field parent The parent class of this window
-- @field type The type of this window, usually lowercase of the classname and
--             can be used in checks for certain types. For a Container
--             instance, type is “container.”
-- @field name The name of this window. This is the same name that Mudlet will
--             use internally for primitive types like labels and
--             miniconsoles.  If not specified in the constraints table during
--             creation, an anonymous name unique to this session will be
--             made up.
-- @field x The x-coordinate relative to this window's container, not absolute
--          from the Mudlet main window. This is not a number, but a
--          constraint specification. To find out the numeric x-coordinate in
--          terms of pixels from the Mudlet main window's origin, use the
--          get_x() method. Default is &quot;10px&quot;.
-- @field y The y-coordinate relative to this window's container, not absolute
--          from the Mudlet main window. This is not a number, but a
--          constraint specification. To find out the numeric y-coordinate in
--          terms of pixels from the Mudlet main window's origin, use the
--          get_y() method. Default is &quot;10px&quot;.
-- @field width The width of this window, possibly relative to the window's
--              container. This is not a number, but a constraint
--              specification. To find out the numeric width in terms of
--              pixels, use the get_width() method. Default is &quot;300px&quot;.
-- @field height The height of this window, possibly relative to the window's
--               container. This is not a number, but a constraint
--               specification. To find out the numeric width in terms of
--               pixels, use the get_width() method. Default is &quot;200px&quot;.
-- @field windowList This is a list of all windows held by this container. It
--                   used to handle proper resizing of held windows as well as
--                   during show()s and hide()s to recursive show and hide all
--                   children windows.
-- @field fontSize The default size font used when calculating dimensions
--                 based on the character constraint. Default is 8.
Geyser.Container =  {
   name = &quot;ContainerClass&quot;,
   x = &quot;10px&quot;,
   y = &quot;10px&quot;,
   height = &quot;200px&quot;,
   width = &quot;300px&quot;,
   windowList = {},
   fontSize = 8,
}

--- Responsible for placing/moving/resizing this window to the correct place/size.
-- Called on window resize events.
function Geyser.Container:reposition ()
   local x,y,w,h = self:get_x(), self:get_y(), self:get_width(), self:get_height()
   moveWindow(self.name, self:get_x(), self:get_y())
   resizeWindow(self.name, self:get_width(), self:get_height())
   
   -- deal with all children of this container
   for k,v in pairs(self.windowList) do
      if k ~= self then
         v:reposition()
      end
   end

   -- Calls optional redraw method if it is available to cause a gui element to
   -- redraw itself after moving.
   if self.redraw then self:redraw() end
end

--- Hides this window and all its contained windows.
function Geyser.Container:hide ()
   hideWindow(self.name)
   for _,v in pairs(self.windowList) do
      v:hide()
   end
end

--- Shows this window and all windows it contains.
function Geyser.Container:show ()
   showWindow(self.name)
   for _,v in pairs(self.windowList) do
      v:show()
   end
end

--- Moves this window according to the new x and y contraints set. 
-- @param x New x constraint to use. If nil, uses current value.
-- @param y New y constraint to use. If nil, uses current value.
function Geyser.Container:move (x, y)
   self.x = x or self.x
   self.y = y or self.y
   self:set_constraints(self)
end

--- Resizes this window according to the new width and height constraints set. 
-- @param width New width constraint to use.  If nil, uses current value.
-- @param height New height constraint to use.  If nil, uses current value.
function Geyser.Container:resize (width, height)
   self.width = width or self.width
   self.height = height or self.height
   self:set_constraints(self)
end

--- Sets the default font size for this window.
-- Will resizes this window if necessary to meet constraints.
-- @param fontSize The new font size to use.
function Geyser.Container:setFontSize (fontSize)
   if type(fontSize) ~= &quot;number&quot; then
      error(&quot;fontSize must be a number&quot;)
      return
   end
   self.fontSize = fontSize or self.fontSize
   self:set_constraints()
end

--- Sets all contraints (x, y, width, height) for this window.
-- @param cons Any Lua table that contains appropriate constraint entries.
function Geyser.Container:set_constraints (cons)
   cons = cons or self
   Geyser.set_constraints(self, cons, self.container)
   for k,v in pairs(self.windowList) do
      v:set_constraints(v)
   end
end

--- Flashes a white box over the dimensions of this container. 
-- This is very useful to see where a container actually is if you've 
-- forgotten its details. 
-- @param time Time in seconds to flash for, default is 1.0s.
function Geyser.Container:flash (time)
   local time = time or 1.0
   local x, y, width, height = self.get_x(), self.get_y(), self.get_width(), self.get_height()
   local name = self.name .. &quot;_dimensions_flash&quot;
   createLabel(name, x, y, width, height, 1)
   resizeWindow(name, width, height)
   moveWindow(name, x, y)
   setBackgroundColor(name, 190, 190, 190, 128)
   showWindow(name)
   tempTimer(time, &quot;hideWindow(\&quot;&quot; .. name .. &quot;\&quot;)&quot;)
end

Geyser.Container.parent = Geyser.Container -- I'm my own grandpa too!

-- Someone has to be the root!
setmetatable(Geyser.Container, Geyser)

--- Constructor for containers.
-- This function creates a new container/window
-- @param cons Any Lua table that contains appropriate constraint entries.
--             Include any parameter such as name or fontSize in cons
--             that are to be used for the new window.
function Geyser.Container:new(cons, container)
   -- create new table for the container and copy over constraints
   local me = Geyser.copyTable(cons)

   -- enforce a default type, name and parent
   me.type = me.type or &quot;container&quot;
   me.name = me.name or Geyser.nameGen()
   me.windowList = {}

   -- Set the metatable.
   setmetatable(me, self)
   self.__index = self

   -- If we're not not a class definition then add to a controlling
   -- container.
   if not string.find(me.name, &quot;.*Class&quot;) then
      -- If passed in a container, add me to that container
      if container then
         container:add(me)
      else
         -- Else assume the root window is my container
         Geyser:add(me)
      end
   end

   --print(&quot;New in &quot; .. self.name .. &quot; : &quot; .. me.name)
   return me
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserWindow</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

local cparse = Geyser.Color.parse

--- Represents an abstract window class designed to be subclassed for windows
-- that are built on Mudlet primitives, like labels.
-- @class table
-- @name Geyser.Window
-- @field message The message last *echo()'d to this window. Default is “”.
-- @field bgColor Text background color, default &quot;white&quot;
-- @field fgColor Text foreground color, default &quot;black&quot;
-- @field color Window background color, default &quot;#202020&quot;
Geyser.Window = Geyser.Container:new({
      name = &quot;WindowClass&quot;,
      message = &quot;&quot;,

      -- default colors.  The are boring
      fgColor = &quot;white&quot;,
      bgColor = &quot;black&quot;,
      color = &quot;#202020&quot;,
   })

-- Add regular window methods, these are mostly just OO-ized wrappers

--- Prints a message to the window
-- @param message The message to print. Can contain html formatting.
function Geyser.Window:echo(message)
   self.message = message
   echo(self.name, self.message)
end

--- Prints a message to the window.
-- @param message The message to print. Uses color formatting information -
-- a message of &quot;&lt;red&gt;Hi&quot; would make 'Hi' red.
function Geyser.Window:cecho(message) self.message = message or self.message cecho(self.name, self.message) end

--- Prints a message to the window.
-- @param message The message to print. Uses color formatting information -
-- a message of &quot;&lt;255,0,0&gt;Hi&quot; would make 'Hi' red.
function Geyser.Window:decho(message) self.message = message or self.message decho(self.name, self.message) end

--- Prints a message to the window.
-- @param message The message to print. Uses color formatting information -
-- a message of &quot;|cff0000Hi&quot; would make 'Hi' red.
function Geyser.Window:hecho(message) self.message = message or self.message hecho(self.name, self.message) end

--- Get the window's foreground color.
-- @return The foreground color of this window primitive as a Geyser.Color object.
function Geyser.Window:getFgColor ()
   return getFgColor(self.name)
end

---  Get the window's background color
-- @return The background color of this window primitive as a Geyser.Color object.
function Geyser.Window:getBgColor ()
   return getBgColor(self.name)
end

--- Sets the background color of this window primitive.  If this primitive
-- was using a shared color, then it creates a new, personal color.
-- @param r The red value, or a quoted color name, like &quot;green&quot;.
-- @param g The green value, or nil if using a name.
-- @param b The blue value, or nil if using a name.
function Geyser.Window:setBgColor (r,g,b)
   setBgColor(self.name, cparse(r,g,b))
end

--- Sets the foreground color of this window primitive.  If this primitive
-- was using a shared color, then it creates a new, personal color.
-- @param r The red value, or a quoted color name, like &quot;green&quot;.
-- @param g The green value, or nil if using a name.
-- @param b The blue value, or nil if using a name.
function Geyser.Window:setFgColor (r,g,b)
   setFgColor(self.name, cparse(r,g,b))
end

--- Sets the background color and alpha.  If this primitive
-- was using a shared color, then it creates a new, personal color.
-- @param r The red component of the color, or a named color like &quot;green&quot;.
-- @param g The green component, or nil if using named colors.
-- @param b The blue component, or nil if using named colors.
-- @param a The alpha component. If nil, uses current alpha value.
function Geyser.Window:setColor (r,g,b,a)
   setBackgroundColor(self.name, cparse(r,g,b,a))
end

--- Pastes text from the clipboard into this window primitive.
function Geyser.Window:paste ()
   paste(self.name)
end

--- Sets the text format for this window. Note that the *echo()
-- functions will override these settings.
-- @param r1 The red foreground component.
-- @param g1 The green foreground component.
-- @param b1 The blue foreground component.
-- @param r2 The red background component.
-- @param g2 The green background component.
-- @param b2 The blue background component.
-- @param bold The bolded status. 1 is bold, 0 is normal.
-- @param underline The underlined status. 1 is underlined, 0 is normal.
-- @param italics The italicized status. 1 is italicized, 0 is normal.
function Geyser.Window:setTextFormat(r1, g1, b1, r1, g2, b2, bold, underline, italics)
   setTextFormat(self.name, r1, g1, b1, r1, g2, b2, bold, underline, italics)
end

--- Sets bolded text.
-- @param bool True for bold.
function Geyser.Window:setBold(bool)
   setBold(self.name, bool)
end

--- Sets underlined text.
-- @param bool True for underlined.
function Geyser.Window:setUnderline(bool)
   setUnderline(self.name, bool)
end

--- Sets italicized text.
-- @param bool True for italicized.
function Geyser.Window:setItalics(bool)
   setItalics(self.name, bool)
end

-- Save a reference to our parent's constructor
Geyser.Window.parent = Geyser.Container

function Geyser.Window:new (cons, container)
   -- Initiate and set Window specific things
   cons = cons or {}
   cons.type = cons.type or &quot;window&quot;

   -- Call parent's constructor
   local me = self.parent:new(cons, container)

   -- Set the metatable.
   setmetatable(me, self)
   self.__index = self

   --print(&quot; New in &quot; .. self.name .. &quot; : &quot; .. me.name)
   return me
end</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserLabel</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- Represents a label like we all know and love.
-- @class table
-- @name Geyser.Label
-- @field fillBg 1 if the background is to be filled, 0 for no background.
Geyser.Label = Geyser.Window:new({
      name = &quot;LabelClass&quot;,
      format = &quot;&quot;,
      args = &quot;&quot;,
      fillBg = 1, })

--- Prints a message to the window.  All parameters are optional and if not
-- specified will use the last set value.
-- @param message The message to print. Can contain html formatting.
-- @param color The color to use.
-- @param format A format list to use. 'c' - center, 'b' - bold, 'i' - italics,
--               'u' - underline, '##' - font size.  For example, &quot;cb18&quot; 
--               specifies center bold 18pt font be used.  Order doesn't matter.
function Geyser.Label:echo(message, color, format)
   message = message or self.message
   self.message = self.message
   format = format or self.format
   self.format = format
   color = color or self.fgColor
   self.fgColor = color
   
   local fs = &quot;&quot;
   -- check for formatting commands
   if format then
      if string.find(format, &quot;b&quot;) then message = &quot;&lt;b&gt;&quot; .. message .. &quot;&lt;/b&gt;&quot; end
      if string.find(format, &quot;i&quot;) then message = &quot;&lt;i&gt;&quot; .. message .. &quot;&lt;/i&gt;&quot; end
      if string.find(format, &quot;c&quot;) then message = &quot;&lt;center&gt;&quot; .. message .. &quot;&lt;/i&gt;&quot; end
      if string.find(format, &quot;u&quot;) then message = &quot;&lt;u&gt;&quot; .. message .. &quot;&lt;/u&gt;&quot; end
      fs = string.gmatch(format, &quot;%d+&quot;)()
      if not fs then fs = tostring(self.fontSize) end
      fs = &quot;font-size: &quot; .. fs .. &quot;pt; &quot;
   end
   message = [[&lt;div style=&quot;color: ]] .. Geyser.Color.hex(self.fgColor) .. &quot;; &quot; .. fs ..
             [[&quot;&gt;]] .. message .. [[&lt;/div&gt;]]
   echo(self.name, message)
end

function Geyser.Label:setFgColor(color)
   self:echo(nil,color,nil)
end

function Geyser.Label:setFormat(format)
   self:echo(nil,nil,format)
end

--- Sets a background image for this label.
-- @param imageFileName The image to use for a background image.
function Geyser.Label:setBackgroundImage (imageFileName)
   setBackgroundImage(self.name, imageFileName)
end

--- Sets a callback to be used when this label is clicked.
-- @param func The function to use.
-- @param ... Parameters to pass to the function. Must be strings or numbers.
function Geyser.Label:setClickCallback (func, ...)
   setLabelClickCallback(self.name, func, ...)
end

-- Save a reference to our parent constructor
Geyser.Label.parent = Geyser.Window

-- Overridden constructor
function Geyser.Label:new (cons, container)
   -- Initiate and set label specific things
   cons = cons or {}
   cons.type = cons.type or &quot;label&quot;

   -- Call parent's constructor
   local me = self.parent:new(cons, container)

   -- Set the metatable.
   setmetatable(me, self)
   self.__index = self

   -- Create the label using primitives
   createLabel(me.name, me:get_x(), me:get_y(),
               me:get_width(), me:get_height(), me.fillBg)

   -- Set any defined colors
   Geyser.Color.applyColors(me)
   me:echo()

   -- Set up the callback if we have one
   if me.callback then
      me:setClickCallback(me.callback, me.args)
   end

   --print(&quot;  New in &quot; .. self.name .. &quot; : &quot; .. me.name)
   return me
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserGauge</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- Represents a gauge that can be either vertical or horizontal.
-- @class table
-- @name Geyser.Gauge
-- @field value Percentage value of how &quot;full&quot; the gauge is.
-- @field orientation &quot;horizontal&quot; is the default and creates a horizontal
--                    gauge that fills from left to right. &quot;vertical&quot; creates
--                    a gauge that fills from bottom to top. &quot;goofy&quot; is
--                    horizontal but fills right to left. &quot;batty&quot; is
--                    vertical but fills from top to bottom.
-- @field color Color base for this gauge.  Default is #808080
Geyser.Gauge = Geyser.Container:new({
      name = &quot;GaugeClass&quot;,
      value = 100, -- ranges from 0 to 100
      color = &quot;#808080&quot;,
      orientation = &quot;horizontal&quot;})

--- Sets the gauge amount.
-- @param currentValue Current numeric value, or if maxValue is ommitted, then
--        it is assumed that currentValue is a value between 0 and 100 and is
--        used to set the gauge.
-- @param maxValue Maximum numeric value.  Optionally nil, see above.
-- @param text The text to display on the gauge, it is optional.
function Geyser.Gauge:setValue (currentValue, maxValue, text)
   -- Use sensible defaults for missing parameters.
   if currentValue &lt; 0 then
      currentValue = 0
   end
   if maxValue then
      self.value = currentValue/maxValue * 100
   else
      self.value = currentValue
   end

   -- Update gauge in the requested orientation
   local shift = tostring(self.value) .. &quot;%&quot;
   if self.orientation == &quot;horizontal&quot; then
      self.front:resize(shift, &quot;100%&quot;)
   elseif self.orientation == &quot;vertical&quot; then
      self.front:move(&quot;0px&quot;, &quot;-&quot; .. shift)
      self.front:resize(&quot;100%&quot;, &quot;-0px&quot;) -- bind to bottom container border
   elseif self.orientation == &quot;goofy&quot; then
      self.front:move(&quot;-&quot; .. shift, &quot;0px&quot;)
      self.front:resize(&quot;-0px&quot;, &quot;100%&quot;) -- bind to right container border
   else -- batty
      self.front:resize(&quot;100%&quot;, shift)
   end
   
   if text then
      self.front:echo(text)
      self.back:echo(text)
   end
end

--- Sets the gauge color.
-- @param r The red component, or a named color like &quot;green&quot;.
-- @param g the green component, or nil if using a named color.
-- @param b the blue component, or nil if using a named color.
-- @param text The text to display on the gauge, it is optional.
function Geyser.Gauge:setColor (r, g, b, text)
   r,g,b = Geyser.Color.parse(r,g,b)
   self.front:setColor(r,g,b)
   self.back:setColor(r,g,b,100)
   if text then
      self.front:echo(text)
      self.back:echo(text)
   end
end

--- Sets the text on the gauge.
-- @param text The text to set.
function Geyser.Gauge:setText (text)
   if text then
      self.front:echo(text)
      self.back:echo(text)
   end
end


-- Save a reference to our parent constructor
Geyser.Gauge.parent = Geyser.Container

-- Overridden constructor
function Geyser.Gauge:new (cons, container)
   -- Initiate and set gauge specific things
   cons = cons or {}
   cons.type = cons.type or &quot;gauge&quot;

   -- Call parent's constructor
   local me = self.parent:new(cons, container)

   -- Set the metatable.
   setmetatable(me, self)
   self.__index = self

   -----------------------------------------------------------
   -- Now create the Gauge using primitives and tastey classes

   -- Set up the constraints for the front label, the label that changes size to
   -- indicated levels in the gauges.
   local front = Geyser.copyTable(cons)
   front.name = me.name .. &quot;_front&quot;
   front.color = me.color
   front.x, front.y, front.width, front.height = 0,0,&quot;100%&quot;,&quot;100%&quot;

   -- Set up the constraints for the back label, which is always the size of the gauge.
   local back = Geyser.copyTable(front)
   back.name = me.name .. &quot;_back&quot;
   local br, bg, bb = Geyser.Color.parse(me.color)
   back.color = Geyser.Color.hexa(br,bg,bb,100)

   -- Create back first so that the labels are stacked correctly.
   me.back = Geyser.Label:new(back, me)
   me.front = Geyser.Label:new(front, me)
   
   --print(&quot;  New in &quot; .. self.name .. &quot; : &quot; .. me.name)
   return me
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserMiniConsole</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- Represents a miniconsole primitive
-- @class table
-- @name Geyser.MiniConsole
-- @field wrapAt Where line wrapping occurs. Default is 300 characters.
Geyser.MiniConsole = Geyser.Window:new({
      name = &quot;MiniConsoleClass&quot;,
      wrapAt = 300,})

--- Replaces the currently selected text.
-- @param with The text to use as a replacement.
function Geyser.MiniConsole:replace (with)
   replace(self.name, with)
end

--- Sets the size of this miniconsole's buffer.
-- @param linesLimit The number of lines to store - same limitations as Mudlet
--                   function of the same name.
-- @param sizeOfBatchDeletion See Mudlet documentation. (I don't know offhand =)
function Geyser.MiniConsole:setBufferSize (linesLimit, sizeOfBatchDeletion)
   setConsoleBufferSize(self.name, linesLimit, sizeOfBatchDeletion)
end

--- Sets the point at which text is wrapped in this miniconsole
-- @param wrapAt The number of characters to start wrapping.
function Geyser.MiniConsole:setWrap (wrapAt)
   if wrapAt then
      self.wrapAt = wrapAt
   end
   setWindowWrap(self.name, self.wrapAt)
end            

--- Sets the text format for this window. Note that the *echo()
-- functions will override these settings.
-- @param r1 The red foreground component.
-- @param g1 The green foreground component.
-- @param b1 The blue foreground component.
-- @param r2 The red background component.
-- @param g2 The green background component.
-- @param b2 The blue background component.
-- @param bold The bolded status. 1 is bold, 0 is normal.
-- @param underline The underlined status. 1 is underlined, 0 is normal.
-- @param italics The italicized status. 1 is italicized, 0 is normal.
function Geyser.MiniConsole:setTextFormat(r1, g1, b1, r2, g2, b2, bold, underline, italics)
   self.fgColor:set(r1,g1,b1)
   self.bgColor:set(r2,b2,g2)
   setTextFormat(self.name, r1, g1, b1, r2, g2, b2, bold, underline, italics)
end

--- Sets bold status for this miniconsole
-- @param bool True for bolded
function Geyser.MiniConsole:setBold(bool)
   setBold(self.name, val)
end
                       
--- Sets underline status for this miniconsole
-- @param bool True for underlined
function Geyser.MiniConsole:setUnderline(bool)
   setUnderline(self.name, val)
end

--- Sets italics status for this miniconsole
-- @param bool True for italicized
function Geyser.MiniConsole:setItalics(bool)
   setItalics(self.name, val)
end

--- Sets the font size for this miniconsole.
-- @param size The font size.
function Geyser.MiniConsole:setFontSize(size)
   self.parent:setFontSize(size)
   setMiniConsoleFontSize(self.name, size)
end

-- Save a reference to our parent constructor
Geyser.MiniConsole.parent = Geyser.Window

-- Overridden constructor
function Geyser.MiniConsole:new (cons, container)
   -- Initiate and set gauge specific things
   cons = cons or {}
   cons.type = cons.type or &quot;miniConsole&quot;

   -- Call parent's constructor
   local me = self.parent:new(cons, container)

   -- Set the metatable.
   setmetatable(me, self)
   self.__index = self

   -----------------------------------------------------------
   -- Now create the MiniConsole using primitives
   createMiniConsole(me.name, me:get_x(), me:get_y(),
                     me:get_width(), me:get_height())

   -- Set any defined colors
   Geyser.Color.applyColors(me)

   if cons.wrapAt then
      me:setWrap(cons.wrapAt)
   end
   
   --print(&quot;  New in &quot; .. self.name .. &quot; : &quot; .. me.name)
   return me
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserReposition</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

--- Responds to sysWindowResizeEvent and causes all windows managed
-- by Geyser to update their sizes and positions.
function GeyserReposition()
	for _,window in pairs(Geyser.windowList) do
		window:reposition()
	end
end</script>
                <eventHandlerList>
                    <string>sysWindowResizeEvent</string>
                </eventHandlerList>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>GeyserTests</name>
                <script>--------------------------------------
--                                  --
-- The Geyser Layout Manager by guy --
--                                  --
--------------------------------------

-- TESTS FOR GEYSER --

--- Test labels.  Creates 101 Labels of varying hue and transparency.
function Geyser.testLabels()
   labelTestContainer = Geyser.Container:new({x=0,y=0,width=&quot;100%&quot;,height=&quot;100%&quot;,name=&quot;labelTestContainer&quot;})

   for i=0,90,10 do
      for j=0,90,10 do
         local myName = &quot;TestLabel_&quot; .. i .. &quot;_&quot; .. j
         local l = Geyser.Label:new({
                               name = myName,
                               x = i .. &quot;%&quot;, y = j .. &quot;%&quot;,
                               width = &quot;8%&quot;, height = &quot;8%&quot;,
                               message = myName,
                               fgColor = &quot;white&quot;},
                               labelTestContainer)
         l:setColor(i,j,100, i*j/8100 * 128 + 127)
      end
   end
   Geyser.Label:new({
               name = &quot;Clickable&quot;,
               fontSize = 22,
               message = [[&lt;p style=&quot;font-size:22pt&quot;&gt;&lt;center&gt;Click me&lt;/center&gt;&lt;/p&gt;]],
               x = &quot;53%&quot;, y = &quot;53%&quot;,
               width = &quot;-40px&quot;, height = &quot;-3c&quot;,
               backgroundAlpha = 240,
               callback = &quot;echo&quot;,
               args = &quot;You Clicked Me!!\n&quot;},
               labelTestContainer)
end



--- Test gauges.  Creates 100 gauges of varying fullness.
function Geyser.testGauges()
   gaugeTestContainer = Geyser.Container:new({x=0,y=0,width=&quot;100%&quot;,height=&quot;100%&quot;,name=&quot;gaugeTestContainer&quot;})

   for i=0,90,10 do
   for j=0,90,10 do
      local myName = &quot;TestGauge_&quot; .. i .. &quot;_&quot; .. j
      local g = Geyser.Gauge:new({name = myName, x = i .. &quot;%&quot;, y = j .. &quot;%&quot;, width = &quot;9%&quot;, height = &quot;9%&quot;,
                                  message = myName, fgColor = &quot;red&quot;,},
                                 gaugeTestContainer)
      g:setValue(1.0 * i)
      --g:setText(myName)
   end
   end
end

--- Used by Geyser.demo1(). Sorry about the namespace polution,
-- but callbacks can't use functions contained in a table.  Anyway,
-- it just echoes some status info to the two miniconsoles.
function demoCallback1 (value)
	local g1 = geyserDemoContainer.windowList.myGauge
	local g2 = geyserDemoContainer.windowList.myGoofyGauge
	local c1 = geyserDemoContainer.windowList[&quot;console 1&quot;]
	local c2 = geyserDemoContainer.windowList[&quot;console 2&quot;]
	g1:setValue((g1.value - value) % 100)
	g2:setValue((g2.value - 2*value) % 100)
	local v1 = tostring(g1.value)
	local v2 = tostring(g2.value)
	c1:decho(string.format(&quot;&lt;90,90,%d&gt; You are at %d \n&quot;, v1, v1))
	c2:decho(string.format(&quot;&lt;90,%d,%d&gt; You are at %d \n&quot;, 255-v2, v2, v2))
end

local myDemoState = 0

--- Used by Geyser.demo1(). It moves the location of the
-- container window.  Look how easy it is to shift around all those
-- gui elements!
function demoCallback2 ()
   if myDemoState == 0 then
		geyserDemoContainer:resize(nil, &quot;50%&quot;)
		geyserDemoContainer:move(&quot;-90c&quot;)
		myDemoState = 1
	else
		geyserDemoContainer:resize(nil, &quot;100%&quot;)
		geyserDemoContainer:move(&quot;-42c&quot;)
		myDemoState = 0
	end
end		


--- This demonstrates some of the neat features in Geyser.
function Geyser.demo1()
   ----------------------------------------
   -- 1. Create a container on the left side of the screen wide
   -- enough for 40 characters

   geyserDemoContainer = Geyser.Container:new(
      { x = &quot;-42c&quot;, y = &quot;0px&quot;,
        width = &quot;40c&quot;, height = &quot;100%&quot;,
        name = &quot;myContainer&quot;})


   ----------------------------------------
   -- 2. Add a miniconsole to the top of the container,
   -- full width, with 20 lines of text

   local console1 = Geyser.MiniConsole:new(
      { x = &quot;0px&quot;, y = &quot;0px&quot;,
        width = &quot;100%&quot;, height = &quot;20c&quot;,
        name = &quot;console 1&quot;},
      geyserDemoContainer) -- add console1 to container directly

   console1:setColor(80,40,20,255)
   console1:echo(&quot;Go ahead - resize the Mudlet window\n&quot;)


   ----------------------------------------
   -- 3. Add two gauges and a clickable label just below the
   -- miniconsole

   local g1 = Geyser.Gauge:new(
      { x = &quot;0px&quot;, y = console1.height,
        width = &quot;60%&quot;, height = &quot;4c&quot;,
        orientation = &quot;batty&quot;, color = &quot;violet&quot;,
        name = &quot;myGauge&quot;})
   g1:setValue(77)

   geyserDemoContainer:add(g1) -- add gauge after creation

   local g2 = Geyser.Gauge:new(
      { x = &quot;10%&quot;, y = console1.height,
        width = &quot;50%&quot;, height = &quot;4c&quot;,
        orientation = &quot;goofy&quot;,
        name = &quot;myGoofyGauge&quot;}, geyserDemoContainer) -- add gauge directly
   g2:setValue(55)
   g2:setColor(&quot;cyan&quot;)


   local label1 = Geyser.Label:new(
      { x = g1.width, y = console1.height,
        width = &quot;40%&quot;, height = &quot;4c&quot;,
        name = &quot;label with callback&quot;,
        callback = &quot;demoCallback1&quot;,
        args=5, fontSize = 8, fgColor = &quot;white&quot;,
        message = &quot;Click me&quot;})

   geyserDemoContainer:add(label1) -- you know the drill

   ----------------------------------------
   -- 4. Add another miniconsole below the gauge that extends
   -- to the bottom of the screen and wraps at 40 characters and
   -- another clickable label.
echo(&quot;adfa\n&quot;)
   local console2 = Geyser.MiniConsole:new({
        x = &quot;0px&quot;, y = &quot;24c&quot;,
        width = &quot;100%&quot;, height = &quot;-0px&quot;,
        name = &quot;console 2&quot;,
        wrapAt = 40,
        color = &quot;&lt;10,20,40&gt;&quot;,},
        geyserDemoContainer) -- add console2 to geyserDemoContainer directly

   console2:echo(&quot;Vampire Gauges!\n&quot;)

   local label2 = Geyser.Label:new(
      { x = g1.width, y = &quot;60%&quot;,
        width = &quot;40%&quot;, height = &quot;4c&quot;,
        name = &quot;label with another callback and a long name!&quot;,
        callback = &quot;demoCallback2&quot;,
        message = [[&lt;center&gt;and me&lt;/center&gt;]]})

   geyserDemoContainer:add(label2) -- same here


   ----------------------------------------
   -- 5. hide all windows just created

   geyserDemoContainer:hide()


   ----------------------------------------
   -- 6. now show them again

   geyserDemoContainer:show()
end</script>
                <eventHandlerList/>
            </Script>
        </ScriptGroup>
        <Script isActive="yes" isFolder="no">
            <name>Aardwolf Configuration</name>
            <script>
-- Mudled Aardwolf GUI (MAG) main config 
-- (you will need to restart Mudled for most changes in this file)


AConf				= {}
AConf.name		= &quot;Mudled Aardwolf GUI&quot;
AConf.version	= &quot;1.0.0&quot;


AConf.Enabled	= {}
-- right
AConf.Enabled.Right			= true 									-- todo not fully implemented
AConf.Enabled.ChatLog			= true 	and AConf.Enabled.Right  -- todo not fully implemented
AConf.Enabled.ExtraInfo		= true 	and AConf.Enabled.Right  -- todo not fully implemented
-- bottom
AConf.Enabled.Bottom			= true
AConf.Enabled.MiniMap			= true 	and AConf.Enabled.Bottom
AConf.Enabled.StatusArea		= true	 	and AConf.Enabled.Bottom
-- other
AConf.Enabled.Statistics		= true
AConf.Enabled.ReSpellUp		= true
AConf.Enabled.BarterWatcher	= false
AConf.Enabled.TickTimer		= true


AConf.Actions					= {}
-- todo runprefix, runsufix command can do better job
AConf.Actions.recallPortal	= &quot;enter ;; d&quot;
AConf.Actions.spellUp 		= &quot;spellup learned wis;; spellup learned;; echo {spellup-end}&quot;
AConf.Actions.rtQuestor 		=  &quot;rt questor&quot;   -- &quot;e ;; e&quot;


AConf.GUI							= {}
AConf.GUI.Right_fontsize		= 10
AConf.GUI.Right_wrap			= 65
AConf.GUI.Bottom_fontsize	= 9
AConf.GUI.Bottom_rows			= 15
-- stat mon
AConf.GUI.StatMon_lines		= AConf.GUI.Bottom_rows-1
AConf.GUI.StatMon_warning	= 11
AConf.GUI.StatMon_critical	= 6


AConf.Statistics					= {}
AConf.Statistics.Timer_enabled	= true
AConf.Statistics.Timer_time		= (30*60)


-- calculate right width
right_x_mult, right_y_mult = 1,1
right_x_mult, right_y_mult = calcFontSize(AConf.GUI.Right_fontsize)
AConf.GUI.Right_width = (right_x_mult*(AConf.GUI.Right_wrap+1))
-- calculate bottom height
bottom_x_mult, bottom_y_mult = 1,1
bottom_x_mult, bottom_y_mult = calcFontSize(AConf.GUI.Bottom_fontsize)
AConf.GUI.Bottom_height = (bottom_y_mult*(AConf.GUI.Bottom_rows+1))
-- calculate bottom mini map width
AConf.GUI.Bottom_mm_spacer = (bottom_x_mult*4)
AConf.GUI.Bottom_mm_width = (bottom_x_mult*33)
AConf.GUI.Bottom_mm_total_width = AConf.GUI.Bottom_mm_spacer + AConf.GUI.Bottom_mm_width
-- calculate bottom stat mon width
AConf.GUI.Bottom_sm_width = (bottom_x_mult*15)
</script>
            <eventHandlerList/>
        </Script>
        <ScriptGroup isActive="yes" isFolder="yes">
            <name>Mudlet Aardwolf GUI</name>
            <script></script>
            <eventHandlerList/>
            <Script isActive="yes" isFolder="no">
                <name>MAG Utils</name>
                <script>
-- Mudlet Aardwolf GUI Utils package
MAGU = MAGU or {}	


function MAGU.clear(consoleName)
	clearUserWindow(consoleName)
end


function MAGU.echo(consoleName, message)
	echo(consoleName, (message or &quot;\n&quot;))
end


function MAGU.cecho(consoleName, message)
	cecho(consoleName, (message or &quot;\n&quot;))
end


-- captureGroup = nil - current line
function MAGU.selectCaptured(consoleName, captureGroup)
	selectCaptureGroup(captureGroup or 1)
	copy()
end


function MAGU.copySelected(consoleName, printNewLine)
	appendBuffer(consoleName)
	if printNewLine then 
		MAGU.echo(consoleName) 
	end
end


function MAGU.moveSelected(consoleName, printNewLine)
	MAGU.copySelected(consoleName, printNewLine)
	deleteLine()
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Core</name>
                <script>
-- TODO distant future
	-- make it more generic - just add minicilnsole, and pref in table
	-- return window object and manipulate with that... (amend AGU)

-- available consoles - use table for gettign names
  -- MAG.name_cl
  -- MAG.name_ei
  -- MAG.name_mm
  -- MAG.name_sa
  -- MAG.name_sm


-- Aardwolf GUI package
MAG = MAG or {}


function MAG.init()
	-- create top container (will consume all available space)
	MAG.name_top = MAG.name_top or Geyser.nameGen(&quot;Container_top&quot;)
	MAG.top = Geyser.Container:new(
		{
			name = MAG.name_top,
			x = 0,
			y = 0,
			width = &quot;100%&quot;,
			height = &quot;100%&quot;
		} 
	)
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Right Container</name>
                <script>
-----------------------------------------
-- Create Right Container
--
function MAG.create_right_container()
	-- create right container
	MAG.name_right = MAG.name_right or Geyser.nameGen(&quot;Container_right&quot;)
	MAG.right = Geyser.Container:new(
		{
			name = MAG.name_right,
			x = (-1)*AConf.GUI.Right_width,
			y = 0,
			width = AConf.GUI.Right_width,
			height = &quot;100%&quot;
		}, 
		MAG.top
	)
end


-----------------------------------------
-- Create Chat Log (says, tells, channels, ...)
--
function MAG.create_chatLog_console()
	if AConf.Enabled.ChatLog then
		MAG.name_cl = MAG.name_cl or Geyser.nameGen(&quot;MiniConsole_ChatLog&quot;)
		MAG.chatLog = Geyser.MiniConsole:new(
			{
				name = MAG.name_cl,
				x = 0, 
				y = 0,
				width = &quot;100%&quot;,
				height =	(-1)*(AConf.GUI.Bottom_height + 20)
			}, 
			MAG.right
		)
		MAG.chatLog:setColor(0, 0, 0, 0)
		MAG.chatLog:setFontSize(AConf.GUI.Right_fontsize)
		MAG.chatLog:setWrap(AConf.GUI.Right_wrap)
		-- move cursor to the end  (just once, it will not delete chat history)
		if not MAG.cl_cleared then
			MAGU.clear(MAG.name_cl)
			MAG.cl_cleared = true
			-- splash
			MAGU.echo(MAG.name_cl, &quot;\n&quot; .. AConf.name .. &quot; &quot; .. AConf.version .. &quot;\n\n&quot;)
			MAGU.echo(MAG.name_cl, &quot;http://www.aardwolf.com/wiki/index.php/Clients/MudletAardwolfGUI\n\n\n\n&quot;)
		end
	end
end


-----------------------------------------
-- Extra Info (mainly quest oriented)
--
function MAG.create_extraInfo_console()
	if AConf.Enabled.ExtraInfo then
		MAG.name_ei = MAG.name_ei or Geyser.nameGen(&quot;MiniConsole_ExtraInfo&quot;)
		MAG.extraInfo = Geyser.MiniConsole:new(
			{
				name = MAG.name_ei,
				x = 0, 
				y =	(-1)*AConf.GUI.Bottom_height,
				width = &quot;100%&quot;,
				height = AConf.GUI.Bottom_height
			}, 
			MAG.right
		)
		MAG.extraInfo:setColor(0, 0, 0, 0)
		MAG.extraInfo:setFontSize(AConf.GUI.Bottom_fontsize)
		MAG.extraInfo:setWrap(AConf.GUI.Right_wrap)
		MAGU.clear(MAG.name_ei)
		setConsoleBufferSize(MAG.name_ei, 100, 10)
	end
end


-----------------------------------------
-- Right Container Inicialization
--
function MAG.initRightContainer()
	if AConf.Enabled.ChatLog or AConf.Enabled.ExtraInfo then
		setBorderRight(AConf.GUI.Right_width + 10)
		MAG.create_right_container()
		MAG.create_chatLog_console()
		MAG.create_extraInfo_console()
	else
		setBorderRight(0)
	end
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Bottom Container</name>
                <script>
-----------------------------------------
-- Create bottom Container
--
function MAG.create_bottom_container()
	-- create bottom container
	MAG.name_bottom = MAG.name_bottom or Geyser.nameGen(&quot;Container_bottom&quot;)
	MAG.bottom = Geyser.Container:new(
		{
			name = MAG.name_bottom,
			x = 0,
			y = (-1)*AConf.GUI.Bottom_height,
			width = &quot;60%&quot;, -- TODO calc(-1)*AConf.GUI.Right_width,
			height = AConf.GUI.Bottom_height
		}, 
		MAG.top
	)
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Tick Info</name>
                <script>
-----------------------------------------
-- Tick Info
--
function MAG.create_tickInfo_console()
	if AConf.Enabled.StatusArea then
		MAG.name_ti = MAG.name_ti or Geyser.nameGen(&quot;MiniConsole_TickInfo&quot;)
		MAG.tickInfo = Geyser.MiniConsole:new(
			{
				name = MAG.name_ti,
				x = 0,
				y = 0,
				width = AConf.GUI.Bottom_mm_spacer,
				height = &quot;100%&quot;
			}, 
			MAG.bottom
		)
		MAG.tickInfo:setColor(0, 0, 0, 0)
		MAG.tickInfo:setFontSize(AConf.GUI.Bottom_fontsize)
		setConsoleBufferSize(MAG.name_ti, 100, 10)
	end
end


-----------------------------------------
-- supporting functions
--
MAG.tick			= MAG.tick or {}
MAG.tick.max		= 30
MAG.tick.rows	= AConf.GUI.Bottom_rows
MAG.tick.slice	= (MAG.tick.max/MAG.tick.rows)


function MAG.tick.start()
	MAG.tick.progress()
	MAG.tick.startTime = os.time()
	if not MAG.tick.alreadyInitialized then
		MAG.tick.alreadyInitialized = true
		MAG.tick.timer()
	end
end


function MAG.tick.progress()
	if MAG.tick.startTime then
		local time = os.difftime(os.time(), MAG.tick.startTime)
		if time &lt;= MAG.tick.slice then 
			MAGU.clear(MAG.name_ti)
		elseif time &gt;= (MAG.tick.max - 2*MAG.tick.slice) then 
			MAGU.cecho(MAG.name_ti, &quot;&lt;grey&gt;\&quot;&quot;  .. &quot;\n&quot;)
		else
			MAGU.cecho(MAG.name_ti, &quot;&lt;grey&gt;'&quot;  .. &quot;\n&quot;)
		end
	end
end


function MAG.tick.timer()
	if MAG.tick.startTime then
		MAG.tick.progress()
		tempTimer(MAG.tick.slice, [[MAG.tick.timer()]])
	end
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Mini Map</name>
                <script>
-----------------------------------------
-- Create Mini Map
--
function MAG.create_miniMap_console()
	if AConf.Enabled.MiniMap then
		MAG.name_mm = MAG.name_mm or Geyser.nameGen(&quot;MiniConsole_MiniMap&quot;)
		MAG.miniMap = Geyser.MiniConsole:new(
			{
				name = MAG.name_mm,
				x = AConf.GUI.Bottom_mm_spacer,
				y = 0,
				width = AConf.GUI.Bottom_mm_width,
				height = &quot;100%&quot;
			}, 
			MAG.bottom
		)
		MAG.miniMap:setColor(0, 0, 0, 0)
		MAG.miniMap:setFontSize(AConf.GUI.Bottom_fontsize)
		MAGU.clear(MAG.name_mm)
		setConsoleBufferSize(MAG.name_mm, 100, 10)
	end
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Status Area</name>
                <script>
-----------------------------------------
-- Stats Mon (HP, MN, MV, Emeny)
--
function MAG.create_statsMon_console()
	if AConf.Enabled.StatusArea then
		MAG.name_sm = MAG.name_sm or Geyser.nameGen(&quot;MiniConsole_StatsMonitor&quot;)
		MAG.statsMon = Geyser.MiniConsole:new(
			{
				name = MAG.name_sm,
				x = AConf.GUI.Bottom_mm_total_width,
				y = &quot;0%&quot;,
				width = AConf.GUI.Bottom_sm_width,
				height = &quot;100%&quot;
			}, 
			MAG.bottom
		)
		MAG.statsMon:setColor(0, 0, 0, 0)
		MAG.statsMon:setFontSize(AConf.GUI.Bottom_fontsize)
		setConsoleBufferSize(MAG.name_sm, 100, 10)
	end
end


function MAG.sm_print(per, index)
	local num = tonumber(per)
	local maxPer = 100*(AConf.GUI.StatMon_lines-index+1)/AConf.GUI.StatMon_lines
	if (num ~= nil) and (num &gt;= maxPer) then
		MAGU.echo(MAG.name_sm, &quot;#  &quot;)
	else
		MAGU.echo(MAG.name_sm, &quot;   &quot;)
	end
end


function MAG.sm_update(h, m, v, e)
	local ee = nil
	if e~=&quot;9999&quot; then 
		ee=tonumber(e) 
	end
	MAGU.clear(MAG.name_sm)
	for i=1, AConf.GUI.StatMon_lines do 
		-- set color
		local invIndex = AConf.GUI.StatMon_lines-i+1
		if invIndex == AConf.GUI.StatMon_lines then
			setFgColor(MAG.name_sm, 0, 255, 0)
		elseif invIndex == AConf.GUI.StatMon_warning then
			setFgColor(MAG.name_sm, 255, 255, 0)
		elseif invIndex == AConf.GUI.StatMon_critical then
			setFgColor(MAG.name_sm, 255, 0, 0)
		end
		-- print stats
		MAG.sm_print(h, i)
		MAG.sm_print(m, i)
		MAG.sm_print(v, i)
		MAGU.echo(MAG.name_sm, &quot;  &quot;)
		MAG.sm_print(ee, i)
		MAGU.echo(MAG.name_sm, &quot;\n&quot;)
	end
	setFgColor(MAG.name_sm, 255, 255, 255)
	MAGU.echo(MAG.name_sm, &quot;H  M  V&quot;)
	if ee~=nil then 
		MAGU.echo(MAG.name_sm, &quot;    E&quot;) 
	end
end



-----------------------------------------
-- Create Status Area
--
function MAG.create_statusArea_console()
	if AConf.Enabled.StatusArea then
		MAG.name_sa = MAG.name_sa or Geyser.nameGen(&quot;MiniConsole_StatusArea&quot;)
		MAG.statusArea = Geyser.MiniConsole:new(
			{
				name = MAG.name_sa,
				x = AConf.GUI.Bottom_mm_total_width + AConf.GUI.Bottom_sm_width,
				y = &quot;0%&quot;,
				width =  (-1)*AConf.GUI.Bottom_mm_spacer,
				height = &quot;100%&quot;
			}, 
			MAG.bottom
		)
		MAG.statusArea:setColor(0, 0, 0, 0)
		MAG.statusArea:setFontSize(AConf.GUI.Bottom_fontsize)
		setConsoleBufferSize(MAG.name_sa, 100, 10)
	end
end


function MAG.sa_getQuestTime()
	if MAG.sa_questTime then
		return string.format(&quot;&lt;cyan&gt;Quest time   : &lt;green&gt;%7d\n&quot;, tonumber(MAG.sa_questTime))
	else 
		return &quot;&quot;
	end
end


--  1, 2	current str / base str,
--  3, 4	current int / base int,
--  5, 6	current wis / base wis,
--  7, 8	current dex / base dex,
--  9,10	current con / base con,
-- 11,12	current luck / base luck,
-- 13-15	hp percent, mana percent, moves percent,
-- 16,17	hitroll, damroll,
-- 18,19	position, enemy pct (9999 if not fighting),
-- 20-25	hp / maxhp,  mana / max mana,  moves / max moves,
-- 26-28	gold, qp, tp,
-- 29-31	align, exp to level, current leel,
--    32	position (number)
function MAG.updateStatusArea(statusUpdate)
	-- use previous data for refresh
	if statusUpdate == nil then
		statusUpdate = MAG.su_lastUpdate
		if statusUpdate == nil then
			return
		end
	end
	MAG.su_lastUpdate = statusUpdate
	-- split input string
	local su = {}
	for w in string.gmatch(statusUpdate, &quot;[^,/]+&quot;) do
		table.insert(su, w)
	end
	-- update stats mon
	MAG.sm_update(su[13], su[14], su[15], su[19])
	-- print something out
	MAGU.clear(MAG.name_sa)
	MAGU.cecho(MAG.name_sa)
	if MAG.sa_roomName then 
		MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;green&gt;%s\n&quot;, MAG.sa_roomName))
	else
		MAGU.cecho(MAG.name_sa)
	end
	MAGU.cecho(MAG.name_sa)
	MAGU.cecho(MAG.name_sa, su[18] .. &quot;\n&quot;)
	MAGU.cecho(MAG.name_sa)
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;Health  : &lt;white&gt;%5d&lt;cyan&gt;/&lt;white&gt;%5d      &lt;cyan&gt;Strength     : &lt;white&gt;%3d&lt;cyan&gt;/&lt;white&gt;%3d\n&quot;, su[20], su[21], su[1], su[2]))
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;Mana    : &lt;white&gt;%5d&lt;cyan&gt;/&lt;white&gt;%5d      &lt;cyan&gt;Intelligence : &lt;white&gt;%3d&lt;cyan&gt;/&lt;white&gt;%3d\n&quot;, su[22], su[23], su[3], su[4]))
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;Moves   : &lt;white&gt;%5d&lt;cyan&gt;/&lt;white&gt;%5d      &lt;cyan&gt;Wisdom       : &lt;white&gt;%3d&lt;cyan&gt;/&lt;white&gt;%3d\n&quot;, su[24], su[25], su[5], su[6]))
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;                           Dexterity    : &lt;white&gt;%3d&lt;cyan&gt;/&lt;white&gt;%3d\n&quot;, su[7], su[8]))
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;Hitroll : &lt;white&gt;%11d      &lt;cyan&gt;Constitution : &lt;white&gt;%3d&lt;cyan&gt;/&lt;white&gt;%3d\n&quot;, su[16], su[9], su[10]))
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;Damroll : &lt;white&gt;%11d      &lt;cyan&gt;Luck         : &lt;white&gt;%3d&lt;cyan&gt;/&lt;white&gt;%3d\n&quot;, su[17], su[11], su[12]))
	MAGU.cecho(MAG.name_sa)
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;TNL     : &lt;white&gt;%11d      &lt;cyan&gt;Level        : &lt;green&gt;%7d\n&quot;, su[30], su[31]))
	MAGU.cecho(MAG.name_sa, string.format(&quot;&lt;cyan&gt;Align   : &lt;white&gt;%11d      %s\n&quot;, su[29], MAG.sa_getQuestTime()))
	MAGU.cecho(MAG.name_sa)
	-- todo [hunger, spel off flag, blind, noexp, double]
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Toggles</name>
                <script>
-----------------------------------------
-- Re-SpellUp Toggle
--
function MAG.sa_spellUpToggle_getMessage()
	local out = &quot;Re-SpellUp &quot;
	if AConf.Enabled.ReSpellUp then
		out = out .. &quot;ON&quot;
	else
		out = out .. &quot;OFF&quot;
	end
	return out
end


-- callback handler cannot be within package e.g. MAG.bla (must be MAG_bla)
function MAG_sa_spellUpToggle_callback()
	if AConf.Enabled.ReSpellUp then
		AConf.Enabled.ReSpellUp = false
	else
		AConf.Enabled.ReSpellUp = true
	end
	MAG.sa_spelup_button:echo(MAG.sa_spellUpToggle_getMessage())
end


function MAG.create_sa_spellUpToggle()
	MAG.name_sa_spelup_button = MAG.name_sa_spelup_button or Geyser.nameGen(&quot;name_sa_spelup_button&quot;)
   MAG.sa_spelup_button = Geyser.Label:new(
		{
			name = MAG.name_sa_spelup_button,
			fontSize = AConf.GUI.Bottom_fontsize,
			message = MAG.sa_spellUpToggle_getMessage(),
			x = &quot;80%&quot;, 
			y = (-1)*bottom_y_mult,
			width = &quot;15%&quot;, 
			height = bottom_y_mult,
			fgColor = &quot;grey&quot;,
			callback = &quot;MAG_sa_spellUpToggle_callback&quot;
		},
      MAG.bottom
	)
	MAG.sa_spelup_button:setColor(0,0,0,0)
end


-----------------------------------------
-- Barter Watcher Toggle
--
function MAG.sa_barterWatcherToggle_getMessage()
	local out = &quot;Barter Watcher &quot;
	if AConf.Enabled.BarterWatcher then
		out = out .. &quot;ON&quot;
	else
		out = out .. &quot;OFF&quot;
	end
	return out
end


-- callback handler cannot be within package e.g. MAG.bla (must be MAG_bla)
function sa_barterWatcherToggle_callback()
	if AConf.Enabled.BarterWatcher then
		AConf.Enabled.BarterWatcher = false
	else
		AConf.Enabled.BarterWatcher = true
	end
	MAG.sa_barter_button:echo(MAG.sa_barterWatcherToggle_getMessage())
end


function MAG.create_sa_barterWatcherToggle()
	MAG.name_sa_barter_button = MAG.name_sa_barter_button or Geyser.nameGen(&quot;name_sa_barter_button&quot;)
   MAG.sa_barter_button = Geyser.Label:new(
		{
			name = MAG.name_sa_barter_button,
			fontSize = AConf.GUI.Bottom_fontsize,
			message = MAG.sa_barterWatcherToggle_getMessage(),
			x = &quot;62%&quot;, 
			y = (-1)*bottom_y_mult,
			width = &quot;15%&quot;, 
			height = bottom_y_mult,
			fgColor = &quot;grey&quot;,
			callback = &quot;sa_barterWatcherToggle_callback&quot;
		},
      MAG.bottom
	)
	MAG.sa_barter_button:setColor(0,0,0,0)
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Bottom Initialization</name>
                <script>
-----------------------------------------
-- bottom Container Inicialization
--
function MAG.initBottomContainer()
	if AConf.Enabled.StatusArea or AConf.Enabled.MiniMap then
		setBorderBottom(AConf.GUI.Bottom_height)
		MAG.create_bottom_container()
		MAG.create_tickInfo_console()
		MAG.create_miniMap_console()
		MAG.create_statsMon_console()
		MAG.create_statusArea_console()
		MAG.create_sa_spellUpToggle()
		MAG.create_sa_barterWatcherToggle()
	else
		setBorderBottom(0)
	end
end
</script>
                <eventHandlerList/>
            </Script>
            <Script isActive="yes" isFolder="no">
                <name>MAG Initialization</name>
                <script>
function MAG.startMAG()
	setBorderLeft(7)
	setBorderBottom(0)
	MAG.init()	
	MAG.initRightContainer()
	MAG.initBottomContainer()
end

MAG.startMAG()



-- call this function whenever you want to configure Mudlet 
-- for specific avatar/character. Type following to command line:   
--   !MAG.avatarSetup()
function MAG.avatarSetup()
	send(&quot;tags CHANNELS on&quot;)
	send(&quot;tags MAP on&quot;)
	send(&quot;tags QUIET off&quot;)
	send(&quot;tags SAYS on&quot;)
	send(&quot;tags SPELLUPS on&quot;)
	send(&quot;tags TELLS on&quot;)
	send(&quot;statmon on&quot;)
	send(&quot;prompt  [%h/%Hh %m/%Mm %N %qqt %Xtnl] @G{%r}@w &gt; &quot;)
   send(&quot;bprompt [%h/%Hh %m/%Mm %N %Xtnl]@C%b @w&gt; &quot;)
	MAG.avatarSetup_autotickOn()
	MAG.avatarSetup_tickinfoOn()
	send(&quot;echo @G--&gt; @YPlease set commnad sepparator to ; ; (two semicolons without space) @G&lt;--@w&quot;)
end


function MAG.avatarUnSetup()
	send(&quot;tags QUIET on&quot;)
	send(&quot;statmon off&quot;)
	send(&quot;echo @G--&gt; @YYou have to manually disable 'autotick' and 'tickinfo'. @G&lt;--@w&quot;)
end



function MAG.avatarSetup_autotickOn()
	MAG.avatarSetup_autotickTID = tempRegexTrigger(
		&quot;You will not be informed when the mud 'ticks'[.]&quot;, 
		[[MAG.avatarSetup_autotickOn_action()]]
	)
	send(&quot;autotick&quot;)
end

function MAG.avatarSetup_autotickOn_action()
	killTrigger(MAG.avatarSetup_autotickTID) 
	send(&quot;autotick&quot;)
end


function MAG.avatarSetup_tickinfoOn()
	MAG.avatarSetup_tickinfoTID = tempRegexTrigger(
		&quot;You will no longer see additional information at tick[.]&quot;, 
		[[MAG.avatarSetup_tickinfoOn_action()]]
	)
	send(&quot;tickinfo&quot;)
end

function MAG.avatarSetup_tickinfoOn_action()
	killTrigger(MAG.avatarSetup_tickinfoTID) 
	send(&quot;tickinfo&quot;)
end
</script>
                <eventHandlerList/>
            </Script>
        </ScriptGroup>
        <Script isActive="yes" isFolder="no">
            <name>Statistics</name>
            <script>
-- stats package
stats = stats or {}


function stats.reset()
	stats.time = os.time()
	stats.kills = 0
	stats.gold = 0
	stats.exp = 0
	stats.qp = 0
end


-- increment data
function stats.getNum(value)
	if value then
		-- 123 + 12 + 12
		if (string.find(value, &quot;+&quot;)) then
			local out = 0
			for w in string.gmatch(value, &quot;[^+/]+&quot;) do
				out = out + stats.getNum_single(w)
			end
			return out
		else
			-- 123,456
			return stats.getNum_single(value)
		end
	else
		return 0
	end
end


function stats.getNum_single(value)
	value = tostring(string.gsub(value, &quot;,&quot;, &quot;&quot;))
	return (tonumber(value) or 0)
end



function stats.addKill()
	stats.kills = stats.kills + 1
end


function stats.addExp(value)
	stats.exp = stats.exp + stats.getNum(value)
end


function stats.addGold(value)
	stats.gold = stats.gold + stats.getNum(value)
end


function stats.addQp(value)
	stats.qp = stats.qp + stats.getNum(value)
end



-- print stats
function stats.per(value, div)
	if div == 0 then div = 1 end
	return math.floor((value*10/div) + 0.5) / 10
end


function stats.print()
	local minutes = os.difftime(os.time(), stats.time) / 60
	local out = &quot;\nStatistics for last &quot;
	minutes = math.floor(minutes)
	if minutes &lt; 2 then
		minutes = 1
		out = out .. &quot;minute:\n&quot;
	else
		out = out .. minutes .. &quot; minutes:\n&quot;
	end
	-- build stats report
	out = out .. string.format(&quot;   Kills %9d   %7.1f/min&quot;, stats.kills, stats.per(stats.kills, minutes)) .. &quot;\n&quot;
	out = out .. string.format(&quot;   Gold  %9d   %7.1f/min   %7.1f/kill&quot;,
		stats.gold, stats.per(stats.gold, minutes), stats.per(stats.gold, stats.kills)) .. &quot;\n&quot;
	out = out .. string.format(&quot;   Exp   %9d   %7.1f/min   %7.1f/kill&quot;,
		stats.exp, stats.per(stats.exp, minutes), stats.per(stats.exp, stats.kills)) .. &quot;\n&quot;
	out = out .. string.format(&quot;   QP    %9d   %7.1f/min&quot;, stats.qp, stats.per(stats.qp, minutes)) .. &quot;\n\n&quot;
	-- print stats (can be also send to gt for example)
	cecho(&quot;&lt;cyan&gt;&quot; .. out)
end


-- timer for showing stats
function stats.timer()
	if AConf.Statistics.Timer_enabled then
		stats.print()
		tempTimer(AConf.Statistics.Timer_time, [[stats.timer()]])
	end
end


-- init on session start
if not stats.alreadyInitialized then
	stats.alreadyInitialized = true
	stats.reset()
	stats.timer()
end
</script>
            <eventHandlerList/>
        </Script>
        <Script isActive="yes" isFolder="no">
            <name>Re-SpellUp</name>
            <script>
-- spellup package
su = {}

su.ignoreList = {
	&quot;{affoff}133&quot;  -- shadow form (so I can go visible without recast)
}


function su.forceSpellUpMe()
	send(AConf.Actions.spellUp)
end


function su.reSpellUpMe()
	if AConf.Enabled.ReSpellUp and not su.isIgnored(getCurrentLine()) then
		su.forceSpellUpMe()
	end
end


function su.isIgnored(spell) 
	for i,item in ipairs(su.ignoreList) do
		if item == spell then 
			return true
		end	
	end
	return false
end
</script>
            <eventHandlerList/>
        </Script>
    </ScriptPackage>
    <KeyPackage>
        <KeyGroup isActive="yes" isFolder="yes">
            <name>Navigation</name>
            <script></script>
            <command></command>
            <keyCode>-1</keyCode>
            <keyModifier>-1</keyModifier>
            <KeyGroup isActive="no" isFolder="yes">
                <name>NumPad movement</name>
                <script>-- TODO I don't have full keyboard, so I wasn't able to set that up</script>
                <command></command>
                <keyCode>16777268</keyCode>
                <keyModifier>0</keyModifier>
                <Key isActive="no" isFolder="no">
                    <name>N</name>
                    <script></script>
                    <command>n</command>
                    <keyCode>-1</keyCode>
                    <keyModifier>-1</keyModifier>
                </Key>
                <Key isActive="no" isFolder="no">
                    <name>S</name>
                    <script></script>
                    <command>s</command>
                    <keyCode>-1</keyCode>
                    <keyModifier>-1</keyModifier>
                </Key>
                <Key isActive="no" isFolder="no">
                    <name>E</name>
                    <script></script>
                    <command>e</command>
                    <keyCode>-1</keyCode>
                    <keyModifier>-1</keyModifier>
                </Key>
                <Key isActive="no" isFolder="no">
                    <name>W</name>
                    <script></script>
                    <command>w</command>
                    <keyCode>-1</keyCode>
                    <keyModifier>-1</keyModifier>
                </Key>
                <Key isActive="no" isFolder="no">
                    <name>U</name>
                    <script></script>
                    <command>u</command>
                    <keyCode>-1</keyCode>
                    <keyModifier>-1</keyModifier>
                </Key>
                <Key isActive="no" isFolder="no">
                    <name>D</name>
                    <script></script>
                    <command>d</command>
                    <keyCode>-1</keyCode>
                    <keyModifier>-1</keyModifier>
                </Key>
            </KeyGroup>
            <KeyGroup isActive="yes" isFolder="yes">
                <name>WSAD movement</name>
                <script></script>
                <command></command>
                <keyCode>-1</keyCode>
                <keyModifier>-1</keyModifier>
                <Key isActive="yes" isFolder="no">
                    <name>N</name>
                    <script></script>
                    <command>n</command>
                    <keyCode>87</keyCode>
                    <keyModifier>33554432</keyModifier>
                </Key>
                <Key isActive="yes" isFolder="no">
                    <name>S</name>
                    <script></script>
                    <command>s</command>
                    <keyCode>83</keyCode>
                    <keyModifier>33554432</keyModifier>
                </Key>
                <Key isActive="yes" isFolder="no">
                    <name>E</name>
                    <script></script>
                    <command>e</command>
                    <keyCode>68</keyCode>
                    <keyModifier>33554432</keyModifier>
                </Key>
                <Key isActive="yes" isFolder="no">
                    <name>W</name>
                    <script></script>
                    <command>w</command>
                    <keyCode>65</keyCode>
                    <keyModifier>33554432</keyModifier>
                </Key>
                <Key isActive="yes" isFolder="no">
                    <name>U</name>
                    <script></script>
                    <command>u</command>
                    <keyCode>69</keyCode>
                    <keyModifier>33554432</keyModifier>
                </Key>
                <Key isActive="yes" isFolder="no">
                    <name>D</name>
                    <script></script>
                    <command>d</command>
                    <keyCode>81</keyCode>
                    <keyModifier>33554432</keyModifier>
                </Key>
            </KeyGroup>
            <Key isActive="yes" isFolder="no">
                <name>glance, map and exits</name>
                <script></script>
                <command>gla;; m;; exits</command>
                <keyCode>35</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>open all directions</name>
                <script></script>
                <command>o n;;o s;;o w;;o e;;o u;;o d;;m</command>
                <keyCode>126</keyCode>
                <keyModifier>33554432</keyModifier>
            </Key>
        </KeyGroup>
        <KeyGroup isActive="yes" isFolder="yes">
            <name>Function Keys</name>
            <script></script>
            <command></command>
            <keyCode>-1</keyCode>
            <keyModifier>-1</keyModifier>
            <Key isActive="yes" isFolder="no">
                <name>F1 heal</name>
                <script></script>
                <command></command>
                <keyCode>16777264</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F2 spellup</name>
                <script>su.forceSpellUpMe()</script>
                <command></command>
                <keyCode>16777265</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F3 old attack spell</name>
                <script></script>
                <command>cast 12</command>
                <keyCode>16777266</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F4 attack spell</name>
                <script></script>
                <command>cast 12</command>
                <keyCode>16777267</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F5</name>
                <script></script>
                <command></command>
                <keyCode>16777268</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F6</name>
                <script></script>
                <command></command>
                <keyCode>16777269</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F7</name>
                <script></script>
                <command></command>
                <keyCode>16777270</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F8</name>
                <script></script>
                <command></command>
                <keyCode>16777271</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F9</name>
                <script></script>
                <command></command>
                <keyCode>16777272</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F10</name>
                <script></script>
                <command></command>
                <keyCode>16777273</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F11</name>
                <script></script>
                <command></command>
                <keyCode>16777274</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
            <Key isActive="yes" isFolder="no">
                <name>F12</name>
                <script></script>
                <command></command>
                <keyCode>16777275</keyCode>
                <keyModifier>0</keyModifier>
            </Key>
        </KeyGroup>
    </KeyPackage>
</MudletPackage>
