if(takeOver){ //takeOver is a function used by the AI
    function takeOver(){

    //try {    //enable for error protection
    
        // test game is compatible and set exec str
        ///testGame();
    
        // take over manager
        realGM = eval(gm_exec_str);

        // set constants
        GRID_SIZE = realGM.size;
        for (var i=0;i<100;i++) {
            if (realGM.getVector(i) == null) break;
        }    
        NUM_OF_MOVES = i;
    
        // setup speedups
//        speedups();

        var testAI = new AI(realGM);
        var res = testAI.getBestMove();
    
        realAI = new AI(realGM);
    
        if (document.getElementById('toggleAI')) return;
        setup_UI();
    /*} catch (e) {
        alert("There's a problem accessing this game. If you want me to fix this, please report it at the feedback link.");*/
    
    }    
    console.log('AI Patch successful!');
    console.log('You can play with the AI constants RUNS and MOVES_AHEAD to control AI strength. Set DEBUG to see verbose running data.');
    console.log('run speedups() for experimental speedup patchs.');
    
    }
    var gametitle=document.getElementsByClassName("title")[0].innerHTML
    if(gametitle==="Isotopic 256"){ //Isotopic 256 requires a patch to copy instability to random runs
        AI.prototype.cloneGM=function(gm) {
    // create a backgroud manager to do the runs on
    var bgm = new GameManager(GRID_SIZE, StubManager, StubManager, StubManager);
    
    // clone grid
    for (var x=0;x<gm.grid.cells.length;x++) {
        for (var y=0;y<gm.grid.cells[x].length;y++) {
            var cell = gm.grid.cells[x][y];
            
            // clone cell if exists
            if (cell) {
                var value = JSON.parse(JSON.stringify(cell.value));
                var unstable = cell.unstable
                cell = new Tile({ x: cell.x, y: cell.y }, cell.value);
                cell.unstable = unstable
            }
            
            bgm.grid.cells[x][y] = cell;
        }
    }
    
    return bgm;
}
}

@@ -1339,24 +1339,32 @@
 ction(gm) %7B%0A
+        
     // creat
@@ -1403,16 +1403,24 @@
 runs on%0A
+        
     var 
@@ -1493,24 +1493,36 @@
 ager);%0A    %0A
+            
     // clone
@@ -1527,16 +1527,28 @@
 ne grid%0A
+            
     for 
@@ -1582,24 +1582,32 @@
 ngth;x++) %7B%0A
+        
         for 
@@ -1656,24 +1656,32 @@
             
+ 
+       
 var cell = g
@@ -1717,32 +1717,40 @@
    %0A            
+  
+      
 // clone cell if
@@ -1765,24 +1765,32 @@
             
+        
 if (cell) %7B%0A
@@ -1801,24 +1801,32 @@
             
+     
+   
 var value = 
@@ -1877,24 +1877,32 @@
             
+       
+ 
 var unstable
@@ -1910,32 +1910,40 @@
 = cell.unstable%0A
+        
                 
@@ -2009,24 +2009,32 @@
             
+ 
+       
 cell.unstabl
@@ -2054,24 +2054,32 @@
             
+        
 %7D%0A          
@@ -2093,16 +2093,24 @@
         
+    
+    
 bgm.grid
@@ -2134,26 +2134,42 @@
 ll;%0A        
-%7D%0A
+        %7D%0A        
     %7D%0A    %0A 
@@ -2163,24 +2163,32 @@
      %7D%0A    %0A
+        
     return b
@@ -2191,12 +2191,481 @@
 rn bgm;%0A
-%7D
+        %7D%0A    else if(gametitle==%22DIVE%22)%7B //AI fails to load%0A        GameManager.prototype.isGameTerminated = function () %7B%0A            if (this.over %7C%7C (this.won && !this.keepPlaying)) %7B%0A                return true;%0A            %7D else %7B%0A                return false;%0A            %7D%0A        %7D;%0A        StubManager.prototype.updateCurrentlyUnlocked=StubManager.prototype.setGameMode=StubManager.prototype.announce=nullfunc; //by this point the AI manages to install itself
 %0A%7D%0A

Add DIVE fixes