Last active
January 28, 2018 21:56
-
-
Save CodySwannGT/6d5625a6447d2eb126d16a79287d3e70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flatten = arr => { | |
while (arr.find(el => Array.isArray(el))) arr = Array.prototype.concat(...arr) | |
return arr | |
} | |
const _gtSetMessage = message => FF.ns.battle.BattleViewController.getInstance().showMessage({ message: message }) | |
const logit = () => { | |
FF.env.isDevelop = function() { return true; } | |
// FF.logger.debug = function() { try { alert(JSON.stringify(arguments)) } catch (e) {} } | |
// alert( | |
// JSON.stringify( | |
// FF.ns.battle.BattleInfo.getInstance().getDropItemList() | |
// ) | |
// ) | |
_gtSetMessage(JSON.stringify( | |
flatten( | |
FF.ns.battle.BattleInfo.getInstance()._battleInitData.battle.rounds.map(round => round.enemy.map(enemy => enemy.children.map(child => child.dropItemList))) | |
) | |
)) | |
} | |
var _gtInterval = setInterval(() => { | |
try { | |
logit(); | |
// clearTimeout(_gtInterval); | |
} catch (e) { | |
} | |
}, 3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment