<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
    <TriggerPackage>
        <TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>who_grouping</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="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>end of who</name>
                <script>expandAlias(&quot;groups&quot;)
disableTrigger(&quot;who_grouping&quot;)</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>39</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>^There are \d+ players on this plane.*\.$</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>who lines</name>
                <script>-- Is the room already in the list? If not, add it and initialize room attributes
if not who_list[matches[3]] then 
   who_list[matches[3]] = {}
   who_list[matches[3]].names = {}
   who_list[matches[3]].roomname = matches[3]
   who_list[matches[3]].num = matches[4]~=&quot;&quot; and matches[4] or &quot;Unknown.&quot;
   who_list[matches[3]].area = matches[5]
end

-- Now that we know the room exists, add the name
table.insert(who_list[matches[3]].names,matches[2])</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>^\s+(\w+) - (.*?)\s+(?:\()?(\d+|\d+ rms|)?(?:\))? - (.*\.|\(unknown\)|\(multiple areas matched\))$</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>1</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
    </TriggerPackage>
    <TimerPackage/>
    <AliasPackage>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>who_grouping_aliases</name>
            <script></script>
            <command></command>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>who group main</name>
                <script>send(&quot;config pagelength 250&quot;)
send(&quot;who&quot;)
send(&quot;config pagelength 30&quot;)
who_list = {}
group = 1
enableTrigger(&quot;who_grouping&quot;)</script>
                <command></command>
                <regex>^whog$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>grouping output</name>
                <script>cecho(&quot;&lt;grey&gt;\n----------Groups----------\n&quot;)
for k,v in pairs(who_list) do
    if (#v.names &gt; 1) then
--MXP isn't working, so neither will the following
--        if (type(v.num) == &quot;number&quot;) then -- also it turns out it won't handle implicit typecasting so this won't work
--           echoLink(v.roomname,[[&quot;map path &quot;..v.num]],&quot;map path &quot;..v.num)
--        else
--           echoLink(v.roomname,[[&quot;room find &quot;..v.roomname]],&quot;room find &quot;..v.roomname)
--        end
--So we'll just echo the name &lt;_&lt;
        echo(v.roomname)
        cecho(string.rep(&quot; &quot;,25-string.len(v.roomname))..&quot; has &lt;red&gt;&quot;..#v.names..&quot;&lt;grey&gt; people. (&lt;purple&gt;&quot;)
        for _,name in ipairs(v.names) do echo(&quot; &quot;..name) end
        cecho(&quot;&lt;grey&gt;) (&lt;yellow&gt;&quot;..v.num..&quot;&lt;grey&gt;)&quot;)
        if (v.num~=&quot;Unknown.&quot;) then cecho(&quot; (&lt;yellow&gt;Area: &quot;..v.area..&quot;&lt;grey&gt;).\n&quot;)
        else echo(&quot;\n&quot;) end
    end
end</script>
                <command></command>
                <regex>^groups$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>search for individual</name>
                <script>echo(&quot;\n-----------Find-----------\n&quot;)
for k,v in pairs(who_list) do
    for _,current in pairs(v.names) do
        if (current == matches[2]) then
            echo(v.roomname)
            cecho(string.rep(&quot; &quot;,25-string.len(v.roomname))..&quot; has &lt;red&gt;&quot;..#v.names..&quot;&lt;grey&gt; people. (&lt;purple&gt;&quot;)
            for _,name in ipairs(v.names) do echo(&quot; &quot;..name) end
            cecho(&quot;&lt;grey&gt;) (&lt;yellow&gt;&quot;..v.num..&quot;&lt;grey&gt;)&quot;)
            if (v.num~=&quot;Unknown.&quot;) then cecho(&quot; (&lt;yellow&gt;Area: &quot;..v.area..&quot;&lt;grey&gt;).\n&quot;)
            else echo(&quot;\n&quot;) end
        end
    end
end</script>
                <command></command>
                <regex>^find (\w+)$</regex>
            </Alias>
            <Alias isActive="yes" isFolder="no">
                <name>individuals</name>
                <script>cecho(&quot;&lt;grey&gt;\n----------Groups----------\n&quot;)
for k,v in pairs(who_list) do
    if (#v.names == 1) then
--MXP isn't working, so neither will the following
--        if (type(v.num) == &quot;number&quot;) then -- also it turns out it won't handle implicit typecasting so this won't work
--           echoLink(v.roomname,[[&quot;map path &quot;..v.num]],&quot;map path &quot;..v.num)
--        else
--           echoLink(v.roomname,[[&quot;room find &quot;..v.roomname]],&quot;room find &quot;..v.roomname)
--        end
--So we'll just echo the name &lt;_&lt;
        echo(v.roomname)
        cecho(string.rep(&quot; &quot;,25-string.len(v.roomname))..&quot; has &lt;red&gt;&quot;..#v.names..&quot;&lt;grey&gt; people. (&lt;purple&gt;&quot;)
        for _,name in ipairs(v.names) do echo(&quot; &quot;..name) end
        cecho(&quot;&lt;grey&gt;) (&lt;yellow&gt;&quot;..v.num..&quot;&lt;grey&gt;)&quot;)
        if (v.num~=&quot;Unknown.&quot;) then cecho(&quot; (&lt;yellow&gt;Area: &quot;..v.area..&quot;&lt;grey&gt;).\n&quot;)
        else echo(&quot;\n&quot;) end
    end
end</script>
                <command></command>
                <regex>^alone$</regex>
            </Alias>
        </AliasGroup>
    </AliasPackage>
    <ActionPackage/>
    <ScriptPackage/>
    <KeyPackage/>
</MudletPackage>
