|
Size: 144
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 | == Abandon all valleys == Script to drop all valleys in one city |
| Line 4: | Line 5: |
| label abandonAllValleys if city.fields.length = 0 goto done execute "abandon " + city.fields[0].coords if !$error goto abandonAllValleys |
|
| Line 5: | Line 10: |
| label done }}} |
|
| Line 6: | Line 13: |
| label abandonAllValleys | == Abandon all valleys in all cities == Script to drop all valleys in all cities |
| Line 8: | Line 16: |
| x = city.fields.length | {{{ 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" }}} |
| Line 10: | Line 29: |
| if x execute "abandon "+FieldIdToCoords(0) x = x-1 }}} |
---- 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"

![[+]](/moin_static/explorer/img/toggle1.png)

![[-]](/moin_static/explorer/img/toggle0.png)
