本帖最后由 qq983378065 于 2020-5-20 15:14 编辑 用其他的写法写好了 function PrefixInteger(num, m) { return (Array(m).join(0) + num).slice(-m); } function switchesshow(){//定义函数 var c = [''] for (var i = 1; i <201; i++) { if($gameSwitches.value(i) == true){//检查i号开关的状态 var d = "开"; }else{ var d = "关"; } if(i%8==0){ var b = " " + PrefixInteger(i, 3) + ":" + d + " "; c.push(b) c.push("\n")//c数组每8个元素插入一个换行符 }else{ var b = " " + PrefixInteger(i, 3) + ":" + d + " "; c.push(b) } } alert(c) }//在显示框里显示1~200号开关的状态 function valueshow(){//定义函数 var c = [''] for (var i = 1; i <201; i++) { if(i%6==0){ var b = " " + PrefixInteger(i, 3) + ":" + PrefixInteger($gameVariables.value(i), 3) + " "; c.push(b); c.push("\n"); }else{ var b = " " + PrefixInteger(i, 3) + ":" + PrefixInteger($gameVariables.value(i), 3) + " "; c.push(b); } } alert(c) } |
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2025-1-12 18:50
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.