Remove delay on modal click

Since now that I know what the problem was. Also fixed weird indenting
This commit is contained in:
Lamp 2018-05-11 23:13:39 -07:00 committed by GitHub
parent 0034b209fd
commit c1531fe76e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 15 deletions

View File

@ -1,16 +1,16 @@
global.screenshotter = {
capture: async function () {
console.log('Starting screen captures');
var puppeteer = require('puppeteer');
var browser = await puppeteer.launch({args:['--no-sandbox']});
var page = await browser.newPage();
await page.setViewport({width: 1440, height: 900});
await page.goto('http://www.multiplayerpiano.com/lobby');
await page.evaluate(function(){ setTimeout(()=>{ document.getElementById('modal').click() }, 1000) });
capture: async function () {
console.log('Starting screen captures');
var puppeteer = require('puppeteer');
var browser = await puppeteer.launch({args:['--no-sandbox']});
var page = await browser.newPage();
await page.setViewport({width: 1440, height: 900});
await page.goto('http://www.multiplayerpiano.com/lobby');
await page.evaluate(function(){ document.getElementById('modal').click() } });
await new Promise(resolve => setTimeout(resolve, 5000));
var screenshot = await page.screenshot({type: 'png'});
var filename = `Screenshot of www.multiplayerpiano.com/lobby @ ${new Date().toISOString()}.png`;
var attachment = new Discord.MessageAttachment(screenshot, filename);
var screenshot = await page.screenshot({type: 'png'});
var filename = `Screenshot of www.multiplayerpiano.com/lobby @ ${new Date().toISOString()}.png`;
var attachment = new Discord.MessageAttachment(screenshot, filename);
await dClient.channels.get('383773548810076163').send(attachment);
await page.goto('http://ourworldofpixels.com');
await page.evaluate(function(){OWOP.camera.zoom = 1;});
@ -20,7 +20,7 @@ global.screenshotter = {
var attachment = new Discord.MessageAttachment(screenshot, filename);
await dClient.channels.get('399079481161023492').send(attachment);
await browser.close();
console.log('Finished screen captures');
},
interval: setInterval(()=>{screenshotter.capture();}, 1000*60*60)
};
console.log('Finished screen captures');
},
interval: setInterval(()=>{screenshotter.capture();}, 1000*60*60)
};