Last active
August 29, 2015 14:17
-
-
Save alufers/0774a996cf8ce0231eed to your computer and use it in GitHub Desktop.
Hero zero bot quests
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
var missionStats = []; | |
var imission = 1; | |
var lastMissionRaw = null; | |
function Cq(a) { | |
var b = {}, | |
c = ""; | |
if (a.vb.uz) { | |
a.vb.Dm() ? c = p.text("screen/quest/button_fight_quest_tooltip") : a.vb.Nj() && (c = p.text("screen/quest/button_time_quest_tooltip")); | |
var d = a.vb, | |
b = d.qa(), | |
g = b.wc(); | |
if (g) var m = C.b.c().Ja[g]; | |
//console.log(b); // Tu jest tylko coins | |
//console.log(p); TO JEST JAKIEŚ i18n | |
//console.log(JSON.parse(d.s.rewards)); // tu jest JSON z rewardem | |
console.log(d.s); | |
var rewards = JSON.parse(d.s.rewards); | |
var response = { | |
coins: rewards.coins, | |
xp: rewards.xp, | |
honor: rewards.honor, | |
duration: d.s.duration, | |
energy: d.s.energy_cost, | |
raw: d, | |
}; | |
missionStats[imission] = response; | |
imission++; | |
//console.log(response); | |
b = { | |
type: "quest", | |
iu: d.$n(), | |
PE: Xc(d.Fe()), | |
ME: Dq(d), | |
LE: d.Ye(), | |
qG: p.text("general/energy_name", +d.getData("energy_cost")), | |
tg: 0 < b.kg() ? b.zj() : null, | |
ug: 0 < b.He() ? b.xm() : null, | |
PP: m ? m.r() : null | |
}; | |
d.Dm() && (b.Rg = a.vb.Wq()); | |
a.u(Oh(b)); | |
k() && (c = '<table id="dialog-quest-briefing-title"><tr><td width="20%"><button class="arrow-left-orange-button btn-prev" data-role="none"></td><td width="60%">' + | |
c + '</td><td width="20%"><button class="arrow-right-orange-button btn-next" data-role="none"></button></td></tr></table>'); | |
R(a, c); | |
d.qa() ? 0 != d.qa().wc() ? (a.Sc = new V(a.a("#itemSlotReward"), 0), a.Sc.setItem(C.b.c().Ja[d.qa().wc()])) : a.a("#itemSlotReward").hide() : a.a("#itemSlotReward").hide(); | |
d.qa() ? null != Eq(d.qa()) && C.b.c().Ee(Eq(d.qa())).yc() ? (c = C.b.c().Ee(Eq(d.qa())), a.a("#dungeonkeyReward").append($('<div style="background-image: url(' + Fq(c) + ')" class="item-picture"></div>'))) : a.a("#dungeonkeyReward").hide() : | |
a.a("#dungeonkeyReward").hide(); | |
if (d.qa()) | |
if (null != Gq(d.qa())) { | |
a.ik = new zq(Gq(d.qa())); | |
d = $('<div style="background-image: url(' + a.ik.Id() + ')" class="item-picture"></div>').appendTo(a.a("#eventQuestReward")); | |
d.parents().eq(4).css("overflow-x", "visible"); | |
var n = a; | |
I(d, function() { | |
var a = n.ik.getName() + "\n\n" + n.ik.Zc(); | |
new om(n.a("#item-tooltip-container"), Va(a), !0) | |
}) | |
} else a.a("#eventQuestReward").hide(); | |
else a.a("#eventQuestReward").hide() | |
} else c = p.text("screen/quest/button_worldboss_event_tooltip"), k() && | |
(c = '<table id="dialog-quest-briefing-title"><tr><td width="20%"><button class="arrow-left-orange-button btn-prev" data-role="none"></td><td width="60%">' + c + '</td><td width="20%"><button class="arrow-right-orange-button btn-next" data-role="none"></button></td></tr></table>'), R(a, c), d = a.vb, b = { | |
type: "worldboss", | |
bv: d.Ai(), | |
Rg: F("worldboss_npcs/" + d.$c() + "_ts", "png"), | |
EG: F("items/" + d.getData("reward_top_rank_item_identifier") + "_i", "png"), | |
BG: F("items/" + d.getData("reward_top_pool_item_identifier") + "_i", "png"), | |
OE: p.text("dialog/worldboss_attack_briefing/requirement_time_format", Xc(xq())), | |
wG: Wd(Hq(d)), | |
ll: Ud(Iq(d)), | |
GG: p.text("dialog/worldboss_attack_briefing/reward_top_rank"), | |
DG: p.text("dialog/worldboss_attack_briefing/reward_top_pool"), | |
yG: p.text("dialog/worldboss_attack_briefing/reward_other"), | |
vG: p.text("dialog/worldboss_attack_briefing/reward_coins_tooltip", Wd(+d.getData("coin_reward_next_attack"))), | |
HG: p.text("dialog/worldboss_attack_briefing/reward_xp_tooltip", Ud(+d.getData("xp_reward_next_attack"))), | |
FG: p.text("dialog/worldboss_attack_briefing/reward_top_rank_tooltip", p.text("item/" + d.getData("reward_top_rank_item_identifier") + "/name")), | |
CG: p.text("dialog/worldboss_attack_briefing/reward_top_pool_tooltip", p.text("item/" + d.getData("reward_top_pool_item_identifier") + "/name")), | |
tE: p.text("dialog/worldboss_attack_briefing/reward_quest_energy"), | |
uE: p.text("dialog/worldboss_attack_briefing/reward_training_sessions") | |
}, a.u(Sh(b)), a.a("#worldboss-time").text(Tc(d.ba(), "H:m:s")), a.qi = new tq("worldboss-hp-progress"), | |
a.qi.ec(Jq(d)), a.qi.P(Kq(d)), a.N = new Gc(1E3), rc(a.N, Hc, f(a.Ob, a)), a.N.start(), a.Ob(); | |
n = a; | |
a.hC = new J(a.a(".btn-next"), 0, f(a.zN, a)); | |
new J(a.a(".btn-prev"), 0, f(a.NN, a)); | |
new J(a.a(".btn-start"), 0, f(a.yO, a)); | |
null == Lq[0] && null == Lq[2] ? (a.a(".btn-next").hide(), a.a(".btn-prev").hide()) : (a.a(".btn-next").show(), a.a(".btn-prev").show()) | |
} | |
function restart(){ | |
setTimeout(function(){closeEv();}, 1000); | |
setTimeout(function(){closeEv();}, 2000); | |
setTimeout(function(){checkMissionStats();}, 3000); | |
} | |
function closeEv(){ | |
$('.btnClose').each(function(){ | |
$(this).click(); | |
}); | |
} | |
function checkMissionStats(){ | |
closeEv(); | |
$('#menu-quests').click(); | |
$('#quest-button-1').click(); | |
$('.btn-start').last().addClass('bot-start-quest-1'); | |
//$('a.ui-btn-left.ui-btn.ui-shadow.ui-btn-corner-all.ui-btn-icon-notext.ui-btn-up-a').click(); | |
$('#quest-button-2').click(); | |
$('.btn-start').last().addClass('bot-start-quest-2'); | |
//$('div.dialog-page.ui-page.ui-body-c.ui-dialog.ui-overlay-a.ui-page-active.main-dialog-shown > div > div.ui-header.ui-bar-a > a').click(); | |
$('#quest-button-3').click(); | |
$('.btn-start').last().addClass('bot-start-quest-3'); | |
//$('div.dialog-page.ui-page.ui-body-c.ui-dialog.ui-overlay-a.ui-page-active.main-dialog-shown > div > div.ui-header.ui-bar-a > a').click(); | |
for (var i in missionStats) { | |
missionStats[i].ranking = missionStats[i].duration / missionStats[i].xp; | |
} | |
var besti = 1, bestranking = 0; | |
for (var i in missionStats) { | |
if(missionStats[i].ranking >= bestranking){ | |
bestranking = missionStats[i].ranking; | |
besti = i; | |
} | |
} | |
console.log(besti); | |
lastMissionRaw = missionStats[besti].raw; | |
$('.bot-start-quest-' + besti).click(); | |
$('.bot-start-quest-1').remove(); | |
$('.bot-start-quest-2').remove(); | |
$('.bot-start-quest-3').remove(); | |
setTimeout(function(){closeEv();}, (missionStats[besti].duration * 1000) + 10000); | |
setTimeout(function(){closeEv();}, (missionStats[besti].duration * 1000) + 20000); | |
setTimeout(function(){checkMissionStats();}, (missionStats[besti].duration * 1000) + 30000); | |
missionStats = []; | |
imission = 1; | |
} | |
function installBot() { | |
var content = '<!--<label><input type="checkbox" class="bot-do-missions" style="display: inline-block;">Rób misje</label>--><br><button class="bot-start" style="background: #3232dd;" onclick="restart();">Start</button>Start jest z opóźneiniem 3s! Jeżeli przyspeszyłeś misję oponkami to kliknij <b>Start<b> ponownie.'; | |
$('body').append('<div class="bot-config" style="z-index: 90000; background: white; position: fixed; left: 30px; top: 30px; min-height: 100px; min-width: 100px;"><h1>Bot by alufers</h1>' + content + '</div>'); | |
} | |
installBot(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment