NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name PlanetHoster Memory Resolver // @namespace PlanetHosterMemoryResolver // @version 1.01 // @description Auto-Resolve PlanetHoster Memory game // @include http://planethoster.*/*/Memory // @include https://planethoster.*/*/Memory // @include http://*.planethoster.*/*/Memory // @include https://*.planethoster.*/*/Memory // @include http://planethoster.*/*/Memory // @include https://planethoster.*/*/Memory // @include http://*.planethoster.*/*/Memory // @include https://*.planethoster.*/*/Memory // @grant metadata // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js // @author CiliBi18 // @copyright 2017, LeFoulek // ==/UserScript== function goFlipThis(t) { var ouverture1 = ''; var continuer = ''; $.each((t == '' ? $('#mg__contents div.mg__tile .mg__tile--inner') : $('#mg__contents div.mg__tile .mg__tile--inner').not('.flipped')), function(i, e) { setTimeout(function(){ // if (i == $('#mg__contents div.mg__tile .mg__tile--inner').length - 1) // goFlipThis(''); if ($(e).hasClass('flipped')) continuer = 1; if (continuer != 1) console.log(i, parseInt($(e).data('id'))); if (continuer != 1) { // console.log('cas 1', ouverture1); if (ouverture1 == '') { $('#mg__contents div.mg__tile .mg__tile--inner').eq(i).trigger('click'); ouverture1 = parseInt($(e).data('id')); continuer = 1; } } if (continuer != 1) { // console.log('cas 2', ouverture1, parseInt($(e).data('id'))); if (ouverture1 != '' && ouverture1 == parseInt($(e).data('id'))) { $('#mg__contents div.mg__tile .mg__tile--inner').eq(i).trigger('click'); ouverture1 = ''; continuer = 1; } } if (continuer != 1) { // console.log('cas 3', $('#mg__contents div.mg__tile .mg__tile--inner').not('.flipped').length, ouverture1, i, $('#mg__contents div.mg__tile .mg__tile--inner').length - 1) if ($('#mg__contents div.mg__tile .mg__tile--inner').not('.flipped').length > 0 && ouverture1 != '' && i == $('#mg__contents div.mg__tile .mg__tile--inner').length - 1) goFlipThis(''); } continuer = ''; }, 500) }) setTimeout(function(){ console.log($('#mg__contents div.mg__tile .mg__tile--inner').not('.flipped').length); if ($('#mg__contents div.mg__tile .mg__tile--inner').not('.flipped').length > 0) goFlipThis(''); }, 3000) } $(function(){ console.clear(); $('#mg__start-screen > div button').click(function(){ setTimeout(goFlipThis, 500); }) })