<?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[Repair Containers?]]></title><description><![CDATA[<p>Hi noob to the game but loving it so far!</p>
<p>Maybe a silly question but when ever I attempt to repair a container I get error code -7 (Invalid Target) are you not able to repair them or am I doing something stupid?</p>
<p> </p>
<p>var repTarget = creep.room.find(FIND_STRUCTURES, {filter: function(object){ return object.structureType === STRUCTURE_ROAD || object.structureType === STRUCTURE_CONTAINER &amp;&amp; (object.hits &lt; object.hitsMax); } });</p>
<p>if (repTarget.length &gt; 0)<br> {<br> if(creep.repair(repTarget[0]) == ERR_NOT_IN_RANGE)<br> {<br> creep.moveTo(repTarget[0]);<br> }<br> }</p>]]></description><link>http://screeps.com/forum/topic/347/repair-containers</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 18:03:35 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/347.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Jan 2017 00:23:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Repair Containers? on Invalid Date]]></title><description><![CDATA[<p>Hi noob to the game but loving it so far!</p>
<p>Maybe a silly question but when ever I attempt to repair a container I get error code -7 (Invalid Target) are you not able to repair them or am I doing something stupid?</p>
<p> </p>
<p>var repTarget = creep.room.find(FIND_STRUCTURES, {filter: function(object){ return object.structureType === STRUCTURE_ROAD || object.structureType === STRUCTURE_CONTAINER &amp;&amp; (object.hits &lt; object.hitsMax); } });</p>
<p>if (repTarget.length &gt; 0)<br> {<br> if(creep.repair(repTarget[0]) == ERR_NOT_IN_RANGE)<br> {<br> creep.moveTo(repTarget[0]);<br> }<br> }</p>]]></description><link>http://screeps.com/forum/post/1714</link><guid isPermaLink="true">http://screeps.com/forum/post/1714</guid><dc:creator><![CDATA[Harcole]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Repair Containers? on Invalid Date]]></title><description><![CDATA[<p>I think you may be trying to repair a fully repaired road.  Some brackets may be useful to force the || to be evaluated before the &amp;&amp;.</p>]]></description><link>http://screeps.com/forum/post/1715</link><guid isPermaLink="true">http://screeps.com/forum/post/1715</guid><dc:creator><![CDATA[RFHolloway]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Repair Containers? on Invalid Date]]></title><description><![CDATA[<p>Thank you, you were correct I was missing brackets which was causing some confusion. <img
      src="http://screeps.com/forum/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=a1k070tfs06"
      class="not-responsive emoji emoji-android emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>For reference to someone in the future looking at this, I should have brackets after the return up till &amp;&amp; as below:</p>
<p> </p>
<p>{filter: function(object){ return (object.structureType === STRUCTURE_ROAD || object.structureType === STRUCTURE_CONTAINER) &amp;&amp; (object.hits &lt; object.hitsMax); }</p>]]></description><link>http://screeps.com/forum/post/1716</link><guid isPermaLink="true">http://screeps.com/forum/post/1716</guid><dc:creator><![CDATA[Harcole]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>