• 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

    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)