加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
startX.js 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
Ecava_IGX 提交于 2022-08-16 14:33 . 上传文件
/***** Server Starup Alert & Modsim Write code start *****/
var ctr = getTag( 'svrStartd');
ctr = parseFloat( ctr);
if (isNaN( ctr)) {
ctr = 0;
}
setTag( 'svrStartd', ++ctr);
var alrmDelay = getTag('alrmDelay');
var wmi = new ActiveXObject('WbemScripting.SWbemLocator');
var wsh = new ActiveXObject("WScript.shell");
var wmiInstance = wmi.ConnectServer('.', "root\\cimv2");
var Processes = wmiInstance.ExecQuery("Select * from Win32_Process Where Name = 'Mod_RSsim.exe'");
if (getTag('device.MODSIM.status.connected')) {
if (60 <= ctr) {
var modsim = {
'HR40001':30000,
'HR40002':30000,
'HR40003':30000
};
for (var i in modsim) {
var data = getTag(i)
if ((data == 0)||(isNaN(data))) {
data = parseInt(Math.random()*modsim[i]);
} else {
data = getProcessData( data, modsim[i]);
}
setTag( i , data);
}
setTag( 'svrStartd', alrmDelay);
}
} else {
if (alrmDelay+10 < ctr) {
//.run("file:///C:\\Users\\Administrator\\Desktop\\mod_RSsimEXE\\mod_RSsim.exe");
setTag( 'svrStartd', alrmDelay);
}
}
if (Processes.Count >= 2) {
//wsh.run("taskkill.exe /im Mod_RSsim.exe");
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化