Skip to content

Instantly share code, notes, and snippets.

@myso-kr
Last active March 30, 2023 04:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myso-kr/8b2fd8fa5e2ee54f17a2695e7d85cdb6 to your computer and use it in GitHub Desktop.
Save myso-kr/8b2fd8fa5e2ee54f17a2695e7d85cdb6 to your computer and use it in GitHub Desktop.
HTML5 Web Game Macro + Hack

HTML5 Web Game Macro with Cheats

Installation

  1. Open Developer Console.
  2. Import Command Core Script
  3. Import Command Macro Script from Macro repository

Hotkeys

Ctrl + X : Stop Macro
Ctrl + Z : Start Macro

Command Core Script (stable)

!function(){window.w3c=window.w3c||{},window.w3c.commands||(window.w3c.commands=function(a){var b=function(a,b){var c=document.createElement("script");c.setAttribute("src",a),c.onerror=function(a){c.onerror=c.onreadystatechange=c.onload=null,"function"==typeof b&&b(a),c.parentNode.removeChild(c)},c.onreadystatechange=c.onload=function(){c.onerror=c.onreadystatechange=c.onload=null,"function"==typeof b&&b(),c.parentNode.removeChild(c)},document.getElementsByTagName("head")[0].appendChild(c)},c=function(a,c){if(0===a.length)return c();var d=0;!function e(){b(a[d],function(b){(!b&&++d<a.length?e:c)(b)})}()};c(["//craig.global.ssl.fastly.net/js/mousetrap/mousetrap.min.js","//rawgit.com/myso-kr/c48e3a1332cbe30e9583b6b9f2b2f00f/raw/03a27945b6c520390ab0021732e1842bada2058a/w3c.simulate.click.js","//rawgit.com/myso-kr/c48e3a1332cbe30e9583b6b9f2b2f00f/raw/03a27945b6c520390ab0021732e1842bada2058a/w3c.simulate.click.service.js","//rawgit.com/myso-kr/c48e3a1332cbe30e9583b6b9f2b2f00f/raw/03a27945b6c520390ab0021732e1842bada2058a/w3c.simulate.click.automator.js"],function(b){window.w3c.simulate.automator(Object.assign({"ctrl+x":function(a){return window.w3c.simulate.service.clear(),!1}},a))})})}();

Command Macro Script Sample

// http://play.famobi.com/taptastic-monsters
;(function(url){
  if( url !== location.hostname + location.pathname ) return;
  window.w3c.commands({
    'ctrl+z': function(e){
      // cheats
      window.w3c.simulate.service.on(function(){
        let hp = game && game.state && game.state.states && game.state.states.cgame && game.state.states.cgame.enemy && game.state.states.cgame.enemy.hp
        if (hp && hp > 1) game.state.states.cgame.enemy.hp = 1;
      });
      // macros
      window.w3c.simulate.service.on('#game > canvas', {x: 300, y: 300});
      window.w3c.simulate.service.on('.fg-modal-close', {x: 30, y: 30});
      return false;
    }
  });
}('games.cdn.famobi.com/html5games/t/taptastic-monsters/v5/'));
// http://www.timegamers.com/TimeClickers/WebGL/
;(function(url){
  if( url !== location.hostname + location.pathname ) return;
  window.w3c.commands({
    'ctrl+z': function(e){
      // macros
      window.w3c.simulate.service.on('#canvas');
      return false;
    }
  });
}('game234229.konggames.com/gamez/0023/4229/live/index.html'));
// http://dappadesign.com/estate2/
;(function(url){
if( url !== location.hostname + location.pathname ) return;
window.w3c.commands({
'ctrl+z': function(e){
// macros
window.w3c.simulate.service.on(function() {
var node = document.querySelector('#c2canvas');
window.w3c.simulate.simulateClick(node, 375, 70);
window.w3c.simulate.simulateClick(node, 375, 190);
window.w3c.simulate.simulateClick(node, 375, 290);
window.w3c.simulate.simulateClick(node, 375, 400);
window.w3c.simulate.simulateClick(node, 375, 510);
window.w3c.simulate.simulateClick(node, 375, 610);
window.w3c.simulate.simulateClick(node, 760, 70);
window.w3c.simulate.simulateClick(node, 760, 190);
window.w3c.simulate.simulateClick(node, 760, 290);
window.w3c.simulate.simulateClick(node, 760, 400);
window.w3c.simulate.simulateClick(node, 760, 510);
window.w3c.simulate.simulateClick(node, 760, 610);
});
return false;
}
});
}('dappadesign.com/estate2/'));
// http://adarkroom.doublespeakgames.com/
;(function(url){
if( url !== location.hostname + location.pathname ) return;
window.w3c.commands({
'ctrl+z': function(e){
// macros
window.w3c.simulate.service.on('#stokeButton, #gatherButton, #trapsButton');
window.w3c.simulate.service.on('[id^=attack_]');
window.w3c.simulate.service.on('#build_hut, #build_trap', null, 1000 * 30);
window.w3c.simulate.service.on('#build_scales, #build_teeth', null, 1000 * 60 * 10);
//window.w3c.simulate.service.on('#build_steel, #build_iron', null, 1000 * 60 * 10);
//window.w3c.simulate.service.on('#investigate, #backinside, #leave, #kill, #goodbye, #deny, #end');
return false;
}
});
}('adarkroom.doublespeakgames.com/'));
// http://play.famobi.com/taptastic-monsters
;(function(url){
if( url !== location.hostname + location.pathname ) return;
window.w3c.commands({
'ctrl+z': function(e){
// cheats
window.w3c.simulate.service.on(function(){
let hp = game && game.state && game.state.states && game.state.states.cgame && game.state.states.cgame.enemy && game.state.states.cgame.enemy.hp
if (hp && hp > 1) game.state.states.cgame.enemy.hp = 1;
});
// macros
window.w3c.simulate.service.on('#game > canvas', {x: 300, y: 300});
window.w3c.simulate.service.on('.fg-modal-close', {x: 30, y: 30});
return false;
}
});
}('games.cdn.famobi.com/html5games/t/taptastic-monsters/v5/'));
// http://www.timegamers.com/TimeClickers/WebGL/
;(function(url){
if( url !== location.hostname + location.pathname ) return;
var offset = 0, buttons = [ {x: 50, y: 195}, {x: 50, y: 275}, {x: 50, y: 345}, {x: 50, y: 435}, {x: 50, y: 515}, {x: 945, y: 430} ];
window.w3c.commands({
'ctrl+z': function(e){
// macros
window.w3c.simulate.service.on('#canvas', { cursor: true }, 10);
window.w3c.simulate.service.on(function() {
var node = document.querySelector('#canvas');
var button = buttons[offset++];
if(offset >= buttons.length) offset = 0;
window.w3c.simulate.simulateClick(node, button.x, button.y);
}, null, 300);
return true;
}
});
}('game234229.konggames.com/gamez/0023/4229/live/index.html'));
// http://dogeminer.se/
;(function(url){
if( url !== location.hostname + location.pathname ) return;
window.w3c.commands({
'ctrl+z': function(e){
// macros
window.w3c.simulate.service.on('#miner', null, 51);
window.w3c.simulate.service.on('.upgrade button, .shopbutton, #flyingcoin, #bonuscoin');
return false;
}
});
}('dogeminer.se/'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment