<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
    <AliasPackage>
        <AliasGroup isActive="yes" isFolder="yes">
            <name>Gathering</name>
            <script></script>
            <command></command>
            <packageName></packageName>
            <regex></regex>
            <Alias isActive="yes" isFolder="no">
                <name>Gather stuff!</name>
                <script>BeginGathering(RoomEnvironment)</script>
                <command></command>
                <packageName></packageName>
                <regex>^gather$</regex>
            </Alias>
        </AliasGroup>
    </AliasPackage>
	    <TriggerPackage>
        <TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
            <name>Gathering</name>
            <script></script>
            <triggerType>0</triggerType>
            <conditonLineDelta>99</conditonLineDelta>
            <mStayOpen>0</mStayOpen>
            <mCommand></mCommand>
            <packageName></packageName>
            <mFgColor>#ff0000</mFgColor>
            <mBgColor>#ffff00</mBgColor>
            <mSoundFile></mSoundFile>
            <colorTriggerFgColor>#000000</colorTriggerFgColor>
            <colorTriggerBgColor>#000000</colorTriggerBgColor>
            <regexCodeList/>
            <regexCodePropertyList/>
            <Trigger isActive="no" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
                <name>GatherBalance</name>
                <script>GatherAll()</script>
                <triggerType>0</triggerType>
                <conditonLineDelta>99</conditonLineDelta>
                <mStayOpen>0</mStayOpen>
                <mCommand></mCommand>
                <packageName></packageName>
                <mFgColor>#ff0000</mFgColor>
                <mBgColor>#ffff00</mBgColor>
                <mSoundFile></mSoundFile>
                <colorTriggerFgColor>#000000</colorTriggerFgColor>
                <colorTriggerBgColor>#000000</colorTriggerBgColor>
                <regexCodeList>
                    <string>You have recovered balance on all limbs.</string>
                    <string>You have already gathered from that plant recently.</string>
                    <string>What would you like to gather?</string>
                    <string>Exactly where do you see farmland around here to gather from?</string>
                    <string>You carefully dig through the soft soil of the riverbed but are unable to find any suitable clay.</string>
                    <string>That plant has been fully gathered from.</string>
                    <string>You carefully dig through the soft soil of the river bed but are unable to find any suitable clay.</string>
                    <string>You scour the farmland for anything of value, but come up empty.</string>
                </regexCodeList>
                <regexCodePropertyList>
                    <integer>3</integer>
                    <integer>3</integer>
                    <integer>3</integer>
                    <integer>3</integer>
                    <integer>3</integer>
                    <integer>3</integer>
                    <integer>3</integer>
                    <integer>3</integer>
                </regexCodePropertyList>
            </Trigger>
        </TriggerGroup>
    </TriggerPackage>
    <ScriptPackage>
        <Script isActive="yes" isFolder="no">
            <name>Gathering</name>
            <packageName></packageName>
            <script>GatherEnv = {
[&quot;Forest&quot;] = {&quot;nuts&quot;},
[&quot;Garden&quot;] = {&quot;fruit&quot;, &quot;vegetable&quot;},
[&quot;Grasslands&quot;] = {&quot;sugarcane&quot;, &quot;grain&quot;, &quot;from farm&quot;},
[&quot;Jungle&quot;] = {&quot;fruit&quot;, &quot;cacao&quot;},
[&quot;Natural underground&quot;] = {&quot;lumic&quot;, &quot;dust&quot;},
[&quot;Valley&quot;] = {&quot;olive&quot;},
[&quot;River&quot;] = {&quot;clay&quot;},
[&quot;Ocean&quot;] = {&quot;saltwater&quot;},
};
GatherQueue = {
};

function BeginGathering(env)
for i = 1,table.maxn(GatherEnv[env]) do
table.insert(GatherQueue, GatherEnv[env][i])
end
cecho(&quot;\n&lt;aquamarine:dark_green&gt;Gathering from this &quot; .. RoomEnvironment .. &quot;!&quot;)
enableTrigger(&quot;GatherBalance&quot;)
GatherAll()
end

function GatherAll()
	if GatherQueue[1] == nil  then 
		cecho(&quot;\n&lt;aquamarine:dark_green&gt;Done gathering from this &quot; .. RoomEnvironment .. &quot;!&quot;)
		disableTrigger(&quot;GatherBalance&quot;)
	else
	send(&quot;gather &quot; .. GatherQueue[1],false)
	table.remove(GatherQueue,1)
	end
end</script>
            <eventHandlerList/>
        </Script>
    </ScriptPackage>
    <ScriptPackage>
        <Script isActive="yes" isFolder="no">
            <name>RoomInfo</name>
            <packageName></packageName>
            <script>function RoomInfo(events, args)
 info = gmcp.Room.Info
 RoomNumberx = info.num
 RoomEnvironment = info.environment

end</script>
            <eventHandlerList>
                <string>gmcp.Room.Info</string>
            </eventHandlerList>
        </Script>
    </ScriptPackage>
</MudletPackage>
