Thursday, April 2, 2015

Hack to KUKU-KUBE

Hi

Its long since my last blog. Was caught up into many things and also was looking for something interesting to post.

This is hack to the game available in below link as of the date of publishing this blog. The idea is borrowed from "Imitation Game" & "Independence Day" movie.

http://www.kuku-kube.com/


Steps to make the game simpler are as follows:
1) Open the link in browser
2) Use firebug or other javascript debug tool. That can be invoked by pressing F12 on windows machines.
3) Copy the below whole code
4) Paste in the console area and execute
5) Now play the game. All tiles should be black & white. Which gives probability of scoring around 70 per minute.

function getScript(url, success) { 
 var script = document.createElement('script');
 script.src = url;
  
 var head = document.getElementsByTagName('head')[0],
 done = false;
  
 // Attach handlers for all browsers
 script.onload = script.onreadystatechange = function() {
  
   if (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'){    
    // callback function provided as param
    success();    
    script.onload = script.onreadystatechange = null;
    head.removeChild(script);    
   };  
  };
}

getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js',function(){
console.log(jQuery("span").size())
});
setInterval(changeColor, 100);
function changeColor(){
var previousColor = null;
jQuery("#box").find("span").each(function(index, element){
  if(index == 0){
    previousColor = null;
  }
 // console.log(index + " : " + previousColor + " : " + jQuery(this).css("background-color"))
  if(previousColor == null){
    previousColor = jQuery(this).css("background-color");
    jQuery(this).css("background-color", 'black')    
  }else  if(jQuery(this).css("background-color") == previousColor){
    jQuery(this).css("background-color", 'black')
  }else{
    jQuery(this).css("background-color", 'white')
  }
})
}

2 comments:

  1. There is no more play button on the site!!!..
    looks they wanted to play on android..
    so ur trick is no longer valid!!!

    ReplyDelete
  2. Thanks Nirav for taking interest in my blog. The button is there. Only thing is, it got hidden in the page due to bug in HTML code. But the code is still valid.

    ReplyDelete