Size: 218
Comment:
|
← Revision 6 as of 2014-10-15 14:14:18 ⇥
Size: 604
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
== AbandonAllValleys == Script to drop all vallys |
== Abandon all valleys == Script to drop all valleys in one city |
Line 6: | Line 6: |
x = city.fields.length if x execute "abandon "+FieldIdToCoords(city.fields[0].id) x = x-1 if x >=0 goto abandonAllValleys |
if city.fields.length = 0 goto done execute "abandon " + city.fields[0].coords if !$error goto abandonAllValleys |
Line 11: | Line 10: |
label done | |
Line 12: | Line 12: |
== Abandon all valleys in all cities == Script to drop all valleys in all cities {{{ 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" }}} ---- ScriptExamples |
Abandon all valleys
Script to drop all valleys in one city
label abandonAllValleys if city.fields.length = 0 goto done execute "abandon " + city.fields[0].coords if !$error goto abandonAllValleys label done
Abandon all valleys in all cities
Script to drop all valleys in all cities
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"