noname/game/phantom.js

39 lines
1010 B
JavaScript
Raw Normal View History

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(){
game.pageId=1;
});
}
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(){
game.pageId=2;
});
}
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(){
game.pageId=3;
});
}
2016-04-17 09:51:07 +00:00
});