<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SOS!!!]]></title><description><![CDATA[<p>Why donot in work?:
var roleMule = {
run: function(creep) {</p>
<pre><code>    if(creep.memory.mule &amp;&amp; creep.store[RESOURCE_ENERGY] == 0) {
        creep.memory.muleing = false;
    }
    if(!creep.memory.mule &amp;&amp; creep.store.getFreeCapacity() == 0) {
        creep.memory.muleing = true;
    }
    
    var targets = creep.room.find(FIND_STRUCTURES, {
        filter: (structure) =&gt; {
            return (structure.structureType == STRUCTURE_EXTENSION || structure.structureType == STRUCTURE_SPAWN || structure.structureType == STRUCTURE_TOWER) &amp;&amp;
            structure.store.getFreeCapacity() &gt; 0;
        }
    }); 
    
    var containers = creep.room.find(STRUCTURE_CONTAINER, {
        filter: (structure) =&gt; {
            return (structure.structureType == STRUCTURE_CONTAINER) &amp;&amp;
            (structure.store[RESOURCE_ENERGY] &gt; 0);
        }
    }); 
    
    if(creep.memory.muleing) 
    {
        if(targets.length &gt; 0) {
            if(creep.transfer(targets[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                creep.moveTo(targets[0]);
            }   
        }  
    }
        else 
    { 
        if(containers.length &gt; 0) {
            if(creep.withdraw(containers[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                creep.moveTo(containers[0]);
            }
        }
    }
}    
</code></pre>
<p>};</p>
<p>module.exports = roleMule;</p>
]]></description><link>http://screeps.com/forum/topic/2927/sos</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 18:12:57 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2927.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Mar 2020 10:08:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SOS!!! on Invalid Date]]></title><description><![CDATA[<p>Why donot in work?:
var roleMule = {
run: function(creep) {</p>
<pre><code>    if(creep.memory.mule &amp;&amp; creep.store[RESOURCE_ENERGY] == 0) {
        creep.memory.muleing = false;
    }
    if(!creep.memory.mule &amp;&amp; creep.store.getFreeCapacity() == 0) {
        creep.memory.muleing = true;
    }
    
    var targets = creep.room.find(FIND_STRUCTURES, {
        filter: (structure) =&gt; {
            return (structure.structureType == STRUCTURE_EXTENSION || structure.structureType == STRUCTURE_SPAWN || structure.structureType == STRUCTURE_TOWER) &amp;&amp;
            structure.store.getFreeCapacity() &gt; 0;
        }
    }); 
    
    var containers = creep.room.find(STRUCTURE_CONTAINER, {
        filter: (structure) =&gt; {
            return (structure.structureType == STRUCTURE_CONTAINER) &amp;&amp;
            (structure.store[RESOURCE_ENERGY] &gt; 0);
        }
    }); 
    
    if(creep.memory.muleing) 
    {
        if(targets.length &gt; 0) {
            if(creep.transfer(targets[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                creep.moveTo(targets[0]);
            }   
        }  
    }
        else 
    { 
        if(containers.length &gt; 0) {
            if(creep.withdraw(containers[0], RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                creep.moveTo(containers[0]);
            }
        }
    }
}    
</code></pre>
<p>};</p>
<p>module.exports = roleMule;</p>
]]></description><link>http://screeps.com/forum/post/14786</link><guid isPermaLink="true">http://screeps.com/forum/post/14786</guid><dc:creator><![CDATA[TelEGraffoNy]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to SOS!!! on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/3993">@telegraffony</a> said in <a href="/forum/post/14786">SOS!!!</a>:</p>
<blockquote>
<p>store.getFreeCapacity()</p>
</blockquote>
<p>Im not sure why this is as it feels off... but if you call store.getFreeCapacity() without an resource type argument on a structure that can only store certain types of resource (in this case, spawns, extensions, towers) will return 0.</p>
<p>You need to do <code>store.getFreeCapacity(RESOURCE_ENERGY)</code> instead.</p>
]]></description><link>http://screeps.com/forum/post/14790</link><guid isPermaLink="true">http://screeps.com/forum/post/14790</guid><dc:creator><![CDATA[trebbettes]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to SOS!!! on Invalid Date]]></title><description><![CDATA[<p>Please fix that. What's your code supposed to do? What's its behaviour now?</p>
<p><a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="nofollow">http://www.catb.org/~esr/faqs/smart-questions.html</a></p>
<p>And it's better to ask these basic questions on slack #help channel.</p>
<p>The first issue I spotted is that your first couple of lines are using both <code>creep.memory.mule</code> and <code>creep.memory.muleing</code>.</p>
]]></description><link>http://screeps.com/forum/post/14791</link><guid isPermaLink="true">http://screeps.com/forum/post/14791</guid><dc:creator><![CDATA[iamgqr]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to SOS!!! on Invalid Date]]></title><description><![CDATA[<p>And the second one is as what <a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/293">@trebbettes</a> said.</p>
]]></description><link>http://screeps.com/forum/post/14792</link><guid isPermaLink="true">http://screeps.com/forum/post/14792</guid><dc:creator><![CDATA[iamgqr]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to SOS!!! on Invalid Date]]></title><description><![CDATA[<p>Well. It is a mule, and it's currently &quot;muleing.&quot;</p>
<p>.getFreeCapacity(resource); is documented. For non general stores, you need to specify what you want the free capacity of.</p>
<p>The reason for this is simple. What if you have something with a store that accepts only a subset of a few items? Like a lab? Or a nuker? Labs can hold 5K TOTAL, but 3K of it must be that lab's mineral resource, and 2K of it must be energy. You have to tell it which you want the free capacity of for it to be meaningful at all.</p>
]]></description><link>http://screeps.com/forum/post/14794</link><guid isPermaLink="true">http://screeps.com/forum/post/14794</guid><dc:creator><![CDATA[Smokeman]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>