2016-04-17 09:51:07 +00:00
|
|
|
var page1 = require('webpage').create();
|
|
|
|
page1.settings.userAgent = 'SpecialAgent';
|
|
|
|
page1.open('http://localhost/index.html?server=true', function(status) {
|
|
|
|
if(status !== 'success') {
|
|
|
|
console.log('Unable to access network');
|
|
|
|
}
|
2016-04-18 03:13:31 +00:00
|
|
|
else{
|
|
|
|
page.evaluate(function(){
|
2016-04-18 05:13:47 +00:00
|
|
|
game.saveConfig('pageId',1);
|
2016-04-18 03:13:31 +00:00
|
|
|
});
|
|
|
|
}
|
2016-04-17 09:51:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
var page2 = require('webpage').create();
|
|
|
|
page2.settings.userAgent = 'SpecialAgent';
|
|
|
|
page2.open('http://localhost/index.html?server=true', function(status) {
|
|
|
|
if(status !== 'success') {
|
|
|
|
console.log('Unable to access network');
|
|
|
|
}
|
2016-04-18 03:13:31 +00:00
|
|
|
else{
|
|
|
|
page.evaluate(function(){
|
2016-04-18 05:13:47 +00:00
|
|
|
game.saveConfig('pageId',2);
|
2016-04-18 03:13:31 +00:00
|
|
|
});
|
|
|
|
}
|
2016-04-17 09:51:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
var page3 = require('webpage').create();
|
|
|
|
page3.settings.userAgent = 'SpecialAgent';
|
|
|
|
page3.open('http://localhost/index.html?server=true', function(status) {
|
|
|
|
if(status !== 'success') {
|
|
|
|
console.log('Unable to access network');
|
|
|
|
}
|
2016-04-18 03:13:31 +00:00
|
|
|
else{
|
|
|
|
page.evaluate(function(){
|
2016-04-18 05:13:47 +00:00
|
|
|
game.saveConfig('pageId',3);
|
2016-04-18 03:13:31 +00:00
|
|
|
});
|
|
|
|
}
|
2016-04-17 09:51:07 +00:00
|
|
|
});
|