Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(){
- var log = window.console.log;
- var EverWingHacks = {
- // State
- active : true,
- groupSize : 1,
- groupLimit : 4,
- /* Load
- ---------------------------------------- */
- // Load hack
- load : function() {
- this.hacks.init(this);
- // Hook ticks
- log("[EverWingHacks] Hooking game's ticks ...");
- this.ticksInterval = setInterval(() => {
- this.ticks();
- }, 1000/60);
- // Check group size
- this.groupInterval = setInterval(() => {
- FBInstant.context.getPlayersAsync().then((data) => {
- if (data) this.groupSize = data.length;
- });
- }, 2000);
- },
- // Handle tick
- ticksInterval : null,
- ticks : function(){
- this.game.resolveGame(this);
- // Game play hacks
- if (this.active && this.game.isPlaying()) {
- // On game start
- if(this.game.isEnteringGame()){
- // Lives hack
- this.hacks.lives.apply();
- // Sidekick powers hack
- this.hacks.sidekickPowers.apply();
- }
- // Magnet hack
- this.hacks.magnet.tick();
- // Double shot hack
- this.hacks.doubleShot.tick();
- // Rush hack
- this.hacks.rush.tick();
- // No meteors hack
- this.hacks.noMeteors.tick();
- // Weapon hack
- this.hacks.weapon.tick();
- this.hacks.sidekickWeapon.tick();
- // Waves space hack
- this.hacks.waveSpacing.tick();
- // Loots hack
- this.hacks.lootWeights.tick();
- // Time hack
- this.hacks.timeScale.tick();
- }
- },
- /* Game functions
- ---------------------------------------- */
- game : {
- resolveGame : function(self){
- this.enteringGame_history = this.playing;
- // If game has not started
- if(!window.GC.app.gameModel.gameStarted)
- this.playing = false;
- // If game over
- else if(window.GC.app.gameModel.gameOver)
- this.playing = false;
- // Game active
- else
- this.playing = true;
- },
- playing : false,
- isPlaying : function(){
- // State
- return this.playing;
- },
- enteringGame : false,
- enteringGame_history : false,
- isEnteringGame : function(){
- return (this.playing && this.enteringGame_history == false);
- }
- },
- /* Hacks
- ---------------------------------------- */
- hacks : {
- init : function(self) {
- this.magnet.self = self;
- this.magnet.tools = this.tools;
- this.doubleShot.self = self;
- this.doubleShot.tools = this.tools;
- this.rush.self = self;
- this.rush.tools = this.tools;
- this.noMeteors.self = self;
- this.noMeteors.tools = this.tools;
- this.lives.self = self;
- this.lives.tools = this.tools;
- this.weapon.self = self;
- this.weapon.tools = this.tools;
- this.sidekickWeapon.self = self;
- this.sidekickWeapon.tools = this.tools;
- this.sidekickPowers.self = self;
- this.sidekickPowers.tools = this.tools;
- this.waveSpacing.self = self;
- this.waveSpacing.tools = this.tools;
- this.lootWeights.self = self;
- this.lootWeights.tools = this.tools;
- this.timeScale.self = self;
- this.timeScale.tools = this.tools;
- },
- /* Codes
- ---------------------------------------- */
- magnet : {
- // Manage
- name : 'hacks.magnet',
- active : false,
- history : false,
- // Constants
- reach : 500,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- this.history = true;
- this.tools.powerTimer.on(window.GC.app.gameModel.magnetTimer);
- window.GC.app.gameModel.player.magnetReach = this.reach;
- }
- else if (this.history){
- this.history = false;
- this.tools.powerTimer.off(window.GC.app.gameModel.magnetTimer);
- window.GC.app.gameModel.player.magnetReach = 0;
- }
- }
- },
- doubleShot : {
- // Manage
- name : 'hacks.doubleShot',
- active : false,
- history : false,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- this.history = true;
- this.tools.powerTimer.on(window.GC.app.gameModel.doubleShotTimer);
- }
- else if (this.history){
- this.history = false;
- this.tools.powerTimer.off(window.GC.app.gameModel.doubleShotTimer);
- }
- }
- },
- rush : {
- // Manage
- name : 'hacks.rush',
- active : false,
- history : false,
- normal : 0,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- if (!this.history){
- this.normal = window.GC.app.gameModel.player.vy;
- }
- this.history = true;
- this.tools.powerTimer.on(window.GC.app.gameModel.rushTimer);
- window.GC.app.gameModel.player.vy = -1.9;
- }
- else if (this.history){
- this.history = false;
- this.tools.powerTimer.off(window.GC.app.gameModel.rushTimer);
- window.GC.app.gameModel.player.vy = this.normal;
- }
- }
- },
- noMeteors : {
- // Manage
- name : 'hacks.noMeteors',
- active : false,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- for (var i = window.GC.app.gameModel.meteors._pool._models.length - 1; i >= 0; i--) {
- window.GC.app.gameModel.meteors._pool._models[i].health = 0;
- }
- }
- }
- },
- lives : {
- // Manage
- name : 'hacks.lives',
- active : false,
- // Variables
- lives : 3,
- // Inject
- apply : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- window.GC.app.gameModel.extraLives = this.lives;
- }
- else if (this.active) {
- window.GC.app.gameModel.extraLives = 1;
- }
- }
- },
- weapon : {
- // Manage
- name : 'hacks.weapon',
- active : false,
- // Variables
- damage : -1,
- level : -1,
- speed : -1,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- if(this.damage >= 0)
- window.GC.app.gameModel.player.damage = this.damage;
- if(this.level >= 0)
- window.GC.app.gameModel.player.bulletLevel = this.level;
- if(this.speed >= 0)
- window.GC.app.gameModel.player.shootTimeout = 101 - this.speed;
- }
- }
- },
- sidekickWeapon : {
- // Manage
- name : 'hacks.sidekickweapon',
- active : false,
- // Variables
- damage : -1,
- level : -1,
- speed : -1,
- // Tick inject
- tick : function() {
- var sidekick;
- for (var i = 0; i < window.GC.app.gameModel.sidekicks.models.length; i++) {
- sidekick = window.GC.app.gameModel.sidekicks.models[i];
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- if(this.damage >= 0)
- sidekick.damage = this.damage;
- if(this.level >= 0)
- sidekick.bulletLevel = this.level;
- if(this.speed >= 0)
- sidekick.shootTimeout = 101 - this.speed;
- }
- }
- }
- },
- sidekickPowers : {
- // Manage
- name : 'hacks.sidekickpowers',
- active : false,
- // Constants
- powers : ["homing","bombs","dualShot","spreadShot","bossKiller","rushFlowers","poison","gems","itemBoost","itemSpawn","snowKiller","treasure","slowing","questing","charm","ice"],
- // Inject
- apply : function() {
- if (this.self.groupSize <= this.self.groupLimit){
- var sidekick;
- for (var i = 0; i < window.GC.app.gameModel.sidekicks.models.length; i++) {
- sidekick = window.GC.app.gameModel.sidekicks.models[i];
- for (var j = 0; j < this.powers.length; j++) {
- if(sidekick.powers.indexOf(this.powers[j]) < 0){
- sidekick.powers = JSON.parse(JSON.stringify(sidekick.powers));
- sidekick.powers.push(this.powers[j]);
- }
- }
- }
- }
- }
- },
- waveSpacing : {
- // Manage
- name : 'hacks.wavespacing',
- active : false,
- // Variables
- space : 1,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- window.GC.app.gameModel.enemies.waveSpacing = this.space;
- }
- }
- },
- lootWeights : {
- // Manage
- name : 'hacks.lootweights',
- active : false,
- // Variables
- weights : {
- amethyst : 0,
- bulletLevel : 0,
- coin : 0,
- deathRush : 0,
- diamond : 0,
- doubleShot : 0,
- energy : 0,
- laser : 0,
- magnet : 0,
- ruby : 0,
- rush : 0,
- slow : 0,
- trophy : 1
- },
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- for (name in this.weights) {
- if (this.weights.hasOwnProperty(name)) {
- window.GC.app.gameModel.items.spawnChances[name] = this.weights[name];
- }
- }
- }
- }
- },
- timeScale : {
- // Manage
- name : 'hacks.timescale',
- active : false,
- history : false,
- // Variables
- scale : 3,
- // Tick inject
- tick : function() {
- if(this.active && this.self.groupSize <= this.self.groupLimit){
- if(!this.history) this.history = true;
- window.GC.app.gameModel.timeMult = this.scale;
- }
- else if (this.history){
- this.history = false;
- window.GC.app.gameModel.timeMult = 1;
- }
- }
- },
- /* Tools
- ---------------------------------------- */
- tools : {
- powerTimer : {
- on : function(obj){
- obj.active = true;
- obj.duration = 1e+10;
- obj.elapsed = 1e+10;
- },
- off : function(obj){
- obj.active = false;
- obj.duration = 1e+4;
- obj.elapsed = 1e+4;
- }
- },
- getSidekicks : function(){
- var equiped = {};
- var sidekicks = window.GC.app.gameView.sidekicksModel.sidekicksList;
- for(var i=0; i<sidekicks.length; i++){
- if(sidekicks[i].state == "equippedLeft"){
- equiped.left = sidekicks[i];
- }
- else if(sidekicks[i].state == "equippedRight"){
- equiped.right = sidekicks[i];
- }
- }
- return equiped;
- },
- dailyLimitUse : function(name){
- if(typeof this.hacks.limits.daily[name] == "undefined")
- return;
- var value = parseInt(this.self.storage.getItem("limits.daily." + name), 10);
- if (!isNaN(value)) {
- if (value > 0){
- this.self.storage.setItem("limits.daily." + name, value - 1);
- this.hacks.limits.daily[name] = value - 1;
- }
- }
- else {
- this.self.storage.setItem("limits.daily." + name, 0);
- this.hacks.limits.daily[name] = 0;
- }
- },
- getNow : function(){
- var now = new Date();
- return now.getDate() + "/" + (now.getMonth()+1) + "/" + (now.getYear()+1900);
- }
- },
- /* Actions Codes
- ---------------------------------------- */
- fakeGame : function(data, callback) {
- // Fake game data
- var data = data || {};
- data.score = data.score || 10 + Math.round(Math.random()*10);
- data.seconds = data.seconds || 10 + Math.round(Math.random()*10);
- data.coins = data.coins || 0;
- data.trophies = data.trophies || 0;
- data.energy = data.energy || 0;
- data.xp = data.xp || 0;
- data.sidekick_xp = data.sidekick_xp || 0;
- // Get sidekicks
- var sidekicks = {};
- var sidekicks_db = window.GC.app.gameView.sidekicksModel.sidekicksList;
- for(var i=0; i<sidekicks_db.length; i++){
- if(sidekicks_db[i].state == "equippedLeft"){sidekicks.left = sidekicks_db[i];}
- else if(sidekicks_db[i].state == "equippedRight"){sidekicks.right = sidekicks_db[i];}
- }
- // App reference
- var app = window.GC.app;
- // Send command
- app.mvc.commandMap.GamePlayedCommand.prototype.execute.apply({mvc :app.mvc,finishCommand : function(e, $){}},
- [{
- playerID : app.gameModel.player.id,
- secondsElapsed : data.seconds,
- killedBy : "Meteor SINGLE " + (Math.round(Math.random()*3) + 1),
- background : "ocean",
- score : data.score,
- commonEarned : data.coins,
- premiumEarned : data.trophies,
- energyEarned : data.energy,
- playerXP : data.xp,
- sidekickXP : data.sidekick_xp,
- sidekickLeftID : (sidekicks.left) ? sidekicks.left.id : null,
- sidekickRightID : (sidekicks.right) ? sidekicks.right.id : null,
- }]);
- },
- unlockCharacters : function() {
- var names = ["fiona", "sophia", "coin", "magnet", "lenore", "jade", "arcana", "lyra", "trixie", "lucia"];
- for (var i = 0; i < names.length; i++) {
- if(GC.app.mvc.models.CharactersModel.characters[names[i]].state == "locked")
- GC.app.client.runFunction("purchaseCharacter", { characterID: names[i], isFree: true });
- }
- },
- charactersMaxLevel : function() {
- var names = ["fiona", "sophia", "coin", "magnet", "lenore", "jade", "arcana", "lyra", "trixie", "lucia"];
- var level = 1;
- var maxlevel = 50;
- var state = null;
- for (var i = 0; i < names.length; i++) {
- if(GC.app.mvc.models.CharactersModel.characters[names[i]].state == "locked") continue;
- level = GC.app.mvc.models.CharactersModel.characters[names[i]].level;
- maxlevel = GC.app.mvc.models.CharactersModel.characters[names[i]].maxLevel;
- state = GC.app.mvc.models.CharactersModel.characters[names[i]].state;
- log("Level : " + level + " Max Level : " + maxlevel + " state : " + state);
- if(state == "idle" || state == "equiped") {
- if(state == "idle") {
- GC.app.client.runFunction("equipCharacter", {characterName : names[i]});
- log("equiping : " + names[i]);
- }
- for (x = level; x < maxlevel; x++) {
- log("upgrading : " + names[i] + " x : " + x);
- GC.app.client.runFunction("purchaseCharacterUpgrade", {characterID : names[i], isFree : true});
- }
- }
- }
- },
- getRandomSideKick : function(callback) {
- var gacha = GC.app.client.schemaAPI.getTable("gachaConfig").rows;
- return this.getSideKick(gacha[Math.floor(Math.random() * gacha.length)].type, callback);
- },
- getLegendarySideKick : function(callback) {
- return this.getSideKick("legendary", callback);
- },
- getSideKick : function(id, callback) {
- // Get sidekick
- return GC.app.client.runFunction("sidekickGacha", {isFree : true, gachaType : id}).then(function(){
- // Get new items
- var items = GC.app.client.stateAPI.getNewItems();
- // If new items
- if (items.length > 0) {
- // Console message
- log("You got a \"" + items[0].model.name + "\" sidekick!");
- // If callback
- if(typeof callback == "function")
- callback(items[0]);
- }
- });
- },
- getEnergy : function(x){
- if(GC.app.client.schemaManager.models[17]._frozen)
- GC.app.client.schemaManager.models[17]._frozen = false;
- if (GC.app.client.schemaAPI.getTable("raidEnergyShop").rows.length == 6) {
- GC.app.client.schemaManager.models[17].rows = JSON.parse(JSON.stringify(GC.app.client.schemaManager.models[17].rows));
- for(var i = 0; i < GC.app.client.schemaManager.models[17].rows.length; i++){
- if(GC.app.client.schemaManager.models[17].rows[i].count == x)
- break;
- }
- GC.app.client.schemaManager.models[17].rows.splice(i, 0, {
- "id" : "item-free",
- "icon" : "resources/images/game/base/item_energy.png",
- "count" : x,
- "cost" : 0,
- "currency" : "trophies",
- "bonus" : 0
- });
- } else {
- GC.app.client.schemaAPI.getTable("raidEnergyShop").getRow("item-free").count = x;
- }
- GC.app.mvc.sendNotification("PurchaseEnergyCommand",{id: "item-free"});
- }
- }
- };
- // Wait
- var loaded = false;
- var check = function(){
- if(window.GC && window.GC.app && window.GC.app.gameModel && !loaded){
- EverWingHacks.load();
- loaded = true;
- clearInterval(wait);
- }
- };
- var wait = setInterval(function(){
- check();
- }, 100);
- // Debug
- //window.EverWingHacks = EverWingHacks;
- // Connection
- var conn = {
- isExt : (document.currentScript) ? false : true,
- event : {
- ext : "ext-event",
- page : "page-event"
- },
- init : function(){
- if (this.isExt) {
- this.event.listen = this.event.ext;
- this.event.fire = this.event.page;
- // Inject script on page
- this.s = document.createElement('script');
- this.s.src = chrome.extension.getURL('script.js');
- this.s.onload = function() {this.remove();};
- // Listent for event
- this.s.addEventListener("click", () => {
- this.handle();
- }, false);
- // Inject on page
- window.addEventListener("load", () => {
- (document.head || document.documentElement).appendChild(this.s);
- }, false);
- }
- else {
- this.event.listen = this.event.page;
- this.event.fire = this.event.ext;
- // Save element
- this.s = document.currentScript;
- // Listent for event
- this.s.addEventListener("click", () => {
- this.handle();
- }, false);
- }
- },
- handle : function() {
- if (this.s.dataset.event != this.event.listen) return;
- delete this.s.dataset.event;
- // Get data
- var data = {};
- var type = this.s.dataset.type;
- delete this.s.dataset.type;
- for (let i in this.s.dataset) {
- if (this.s.dataset.hasOwnProperty(i)) {
- console.log(i, this.s.dataset[i]);
- data[i] = JSON.parse(this.s.dataset[i]);
- }
- }
- // Clear old data
- for (let i in this.s.dataset) {
- if (this.s.dataset.hasOwnProperty(i)) {
- delete this.s.dataset[i];
- }
- }
- // Call events
- for (let i = 0; i < this.list.length; i++) {
- let e = this.list[i];
- if (e.type == type) {
- setTimeout(() => {
- e.callback(JSON.parse(JSON.stringify(data)));
- }, 0);
- }
- }
- },
- list : [],
- on : function(type, callback) {
- this.list.push({
- type : type,
- callback : callback
- });
- },
- fire : function(type, params) {
- this.s.dataset.event = this.event.fire;
- // Set type
- this.s.dataset.type = type;
- // Dataset
- for (let item in params) {
- if (params.hasOwnProperty(item)) {
- this.s.dataset[item] = JSON.stringify(params[item]);
- }
- }
- this.s.click();
- }
- }
- conn.init();
- var logger = function(){
- log.apply(null, arguments);
- }
- // Listeners
- conn.on("magnet", function(data){
- logger("Magnet : ", !EverWingHacks.hacks.magnet.active);
- EverWingHacks.hacks.magnet.active = !EverWingHacks.hacks.magnet.active;
- });
- conn.on("doubleshot", function(data){
- logger("DoubleShot : ", !EverWingHacks.hacks.doubleShot.active);
- EverWingHacks.hacks.doubleShot.active = !EverWingHacks.hacks.doubleShot.active;
- });
- conn.on("rush", function(data){
- logger("Rush : ", !EverWingHacks.hacks.rush.active);
- EverWingHacks.hacks.rush.active = !EverWingHacks.hacks.rush.active;
- });
- conn.on("nometeors", function(data){
- logger("NoMeteors : ", !EverWingHacks.hacks.noMeteors.active);
- EverWingHacks.hacks.noMeteors.active = !EverWingHacks.hacks.noMeteors.active;
- });
- conn.on("timescale", function(data){
- logger("TimeScale : ", !EverWingHacks.hacks.timeScale.active);
- EverWingHacks.hacks.timeScale.active = !EverWingHacks.hacks.timeScale.active;
- });
- conn.on("wavespacing", function(data){
- logger("WaveSpacing : ", !EverWingHacks.hacks.waveSpacing.active);
- EverWingHacks.hacks.waveSpacing.active = !EverWingHacks.hacks.waveSpacing.active;
- });
- conn.on("lootweights", function(data){
- logger("LootWeights : ", !EverWingHacks.hacks.lootWeights.active);
- EverWingHacks.hacks.lootWeights.active = !EverWingHacks.hacks.lootWeights.active;
- });
- conn.on("unlockcharacters", function(data){
- logger("UnlockCharacters fired!");
- EverWingHacks.hacks.unlockCharacters();
- });
- conn.on("charactersmaxlevel", function(data){
- logger("CharactersMaxLevel fired!");
- EverWingHacks.hacks.charactersMaxLevel();
- });
- conn.on("getrandomsidekick", function(data){
- EverWingHacks.hacks.getRandomSideKick();
- });
- conn.on("getcoins", function(data){
- logger("GetCoins : ", data.amount);
- EverWingHacks.hacks.fakeGame({coins : data.amount});
- });
- conn.on("gettrophies", function(data){
- logger("GetTrophies : ", data.amount);
- EverWingHacks.hacks.fakeGame({trophies : data.amount});
- });
- conn.on("getxp", function(data){
- logger("GetXP : ", data.amount);
- EverWingHacks.hacks.fakeGame({xp : data.amount});
- });
- conn.on("getsidekickxp", function(data){
- logger("GetSidekickXP : ", data.amount);
- EverWingHacks.hacks.fakeGame({sidekick_xp : data.amount});
- });
- })();
Add Comment
Please, Sign In to add comment