Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var doc = $( 'iframe[id="/embed/colors-game"]' ).contentDocument;
- var i = 200;
- clickOnColoredBox();
- function clickOnColoredBox() {
- var prevColors = null;
- for ( var div of doc.getElementsByTagName( 'div' ) ) {
- var color = div.style.backgroundColor;
- if ( !color ) {
- continue; /* Not a cell */
- }
- if ( prevColors === null ) {
- prevColors = {};
- }
- else if ( prevColors[color] === undefined ) {
- console.log( "Found unknown color: " + color );
- div.click();
- break;
- }
- prevColors[color] = 1;
- }
- if ( -- i >= 0 ) {
- setTimeout( clickOnColoredBox, 100 );
- }
- }
Add Comment
Please, Sign In to add comment