noname/game/phantom.js

30 lines
629 B
JavaScript
Raw Normal View History

2017-11-06 05:55:03 +00:00
var fs = require('fs');
var webpage = require('webpage')
var load = function(id){
2018-04-17 07:32:43 +00:00
var page = webpage.create();
2018-04-23 00:22:47 +00:00
page.settings.userAgent = 'NonameServer';
2018-04-17 07:32:43 +00:00
page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) {
if(status !== 'success') {
console.log(fs.workingDirectory);
console.log('Unable to access network');
}
setInterval(function(){
if(page.evaluate(function(){
if(!lib.node||!lib.node.clients||!lib.node.clients.length){
return true;
}
else{
return false;
}
})){
page.close();
load(id);
}
},600000);
});
2016-04-27 15:01:25 +00:00
}
2016-04-26 02:34:31 +00:00
2016-04-27 15:01:25 +00:00
load(1);
2017-11-06 05:55:03 +00:00
load(2);
load(3);