• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (GUI)
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages
    • Diff for "Loop"
    Differences between revisions 3 and 4
    Revision 3 as of 2012-10-21 15:25:29
    Size: 1837
    Editor: Inanna
    Comment:
    Revision 4 as of 2012-10-24 01:29:48
    Size: 1729
    Editor: Romulus
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 1: Line 1:
    ||<tablestyle="margin: 1em 1em 1em 0px; background-color: rgb(249, 249, 249); border-style: solid; border-color: rgb(170, 170, 170); color: rgb(0, 0, 0); font-family: sans-serif; font-size: 13px; line-height: 19.5px; text-align: start; " tableclass="wikitable"style="border-style: solid; border-color: rgb(170, 170, 170); padding: 0.2em; background-color: rgb(242, 242, 242); ">Usage:||<style="border-style: solid; border-color: rgb(170, 170, 170); padding: 0.2em; ">loop [optional # of times]<<BR>>loop [optional label]<<BR>>loop [optional # of times] [optional label]||
    ||<style="border-style: solid; border-color: rgb(170, 170, 170); padding: 0.2em; background-color: rgb(242, 242, 242); ">Example:||<style="border-style: solid; border-color: rgb(170, 170, 170); padding: 0.2em; ">loop<<BR>>loop 5<<BR>>loop upgrade<<BR>>loop 2 upgrade ||
    ||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px;text-align:start;" tableclass="wikitable"#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">Usage: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">loop [optional # of times]<<BR>>loop [optional label]<<BR>>loop [optional # of times] [optional label] ||
    ||<#F2F2F2 style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">Example: ||<style="border-style:solid;border-color:rgb(170, 170, 170);padding:0.2em;">loop<<BR>>loop 5<<BR>>loop upgrade<<BR>>loop 2 upgrade ||
    Line 5: Line 6:
    Line 42: Line 42:
    CategoryControlStructures ----
    Scrip
    tControlStructures

    Usage:

    loop [optional # of times]
    loop [optional label]
    loop [optional # of times] [optional label]

    Example:

    loop
    loop 5
    loop upgrade
    loop 2 upgrade

    Allows you to repeat your entire script, or using a label repeat parts of a script. No parameter, or a parameter of 0 (ie - loop 0), will repeat the script indefinitely.

    • //===============================
      // Upgrade everything in your
      // city, as long as tech and
      // resource requirements are met
      //===============================
            upgrade
            loop
      
      //===============================
      // Upgrade your farms, sawmills
      // and your ironmines, then
      // repeat the process again
      // 5 times
      //===============================
            upgrade farm
            upgrade saw
            upgrade iron
            loop 5
      
      //===============================
      // Upgrade your farms, sawmills
      // and your ironmines, then
      // upgrade cottages and repeat the cottages again
      // 5 times
      //===============================
            upgrade farm
            upgrade saw
            upgrade iron
            label cotupgrade
            upgrade cottage
            loop 5 cotupgrade



    ScriptControlStructures

    Loop (last edited 2012-10-24 01:29:48 by Romulus)