Skip to content

Instantly share code, notes, and snippets.

@CodySwannGT
Last active January 28, 2018 21:56
Show Gist options
  • Save CodySwannGT/6d5625a6447d2eb126d16a79287d3e70 to your computer and use it in GitHub Desktop.
Save CodySwannGT/6d5625a6447d2eb126d16a79287d3e70 to your computer and use it in GitHub Desktop.
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