// 【范例】地图编辑器脚本文件
// 名称: 计次循环结构
// 作者: Pzy
// 时间: 2010,9,28
// 此脚本会将指定的内容循环执行指定的次数
// 请在“输入接口”处设定参数
// 请在下面表记处写上需要循环的脚本
// ========================================================
//
// 呼吁，为了把FA2的脚本发扬广大，呼吁管理，修改，刺激积极性。
// 引用范例脚本的时候请连用范例的头文件一起引用，也就是这行文字以下的所有
// 内容。

//【结构】计次循环结构v1.0   By Pzy 2010.9.28
//========================开始==============================
//许可
SetSafeMode("FALSE","为了脚本的执行，这是必要的。");
AllowAdd("执行这个脚本，有必要允许增加物件。");
//获得事件链长度
UInputGetInteger("%Count%","请输入要生成的事件链的长度。","1","9");
SetVariable("%NowTimes%","0"); 
Add("%NowTimes%","1");
//链头 主体，条件
SetIniKey("Triggers","AC_M000%NowTimes%","Americans,<none>,第%NowTimes%个触发,0,1,1,1,0");
SetIniKey("Events","AC_M000%NowTimes%","0");

//链节
:Begin:
Is("%NowTimes%",">=","%Count%","Over");
JumpTo("End","Over");
SetVariable("%NextTimes%","%NowTimes%"); 
Add("%NextTimes%","1");
SetIniKey("Actions","AC_M000%NowTimes%","1,53,2,AC_M000%NextTimes%,0,0,0,0,A");
SetIniKey("Tags","AC_T000%NowTimes%","0,%NowTimes% 标签,AC_M000%NowTimes%");
Add("%NowTimes%","1");

SetIniKey("Triggers","AC_M000%NowTimes%","Americans,<none>,第%NowTimes%个触发 ,1,1,1,1,0");//开启新的一节
SetIniKey("Events","AC_M000%NowTimes%","1,13,0,1");
JumpTo("Begin");
:End:
//链尾 事件，标签
SetIniKey("Actions","AC_M000%NowTimes%","0");
SetIniKey("Tags","AC_T000%NowTimes%","0,%NowTimes% 标签,AC_M000%NowTimes%");
//========================结束==============================