<?xml version="1.0" encoding="utf-8"?>
<s1 title="AbandonAllValleys"><p></p>
<s2 id="Abandon all valleys" title="Abandon all valleys">
<p>Script to drop all valleys in one city </p>
<p></p>
<source><![CDATA[label abandonAllValleys
if city.fields.length = 0 goto done
execute "abandon " + city.fields[0].coords
if !$error goto abandonAllValleys

label done]]></source><p></p>
</s2>
<s2 id="Abandon all valleys in all cities" title="Abandon all valleys in all cities">
<p>Script to drop all valleys in all cities </p>
<p></p>
<source><![CDATA[cs = cities.concat()
label nextcity
c = cs.shift()
if c fs = c.cityManager.fields.toArray()
label nextfield
if c f = fs.shift()
if c if f execute "abandon " + f.coords
if c if f if !$error goto nextfield
if c goto nextcity
echo "Finished"]]></source><p></p>

<br/>------------------------------------------------------------------------------<br/>
<p> <jump href="/wiki/ScriptExamples">ScriptExamples</jump> </p>
</s2></s1>