Correct siege calc?
![]() ![]() |
I'm working on Castle Age Autoplayer, and made an updated version of the T2K calculation to account for siege completions, i.e. if you have 1 click left for a Last Stand that will kill a hydra, it won't last as long. On the other hand, if the Last Stand is already done and the hydra has 10% left, it will still be a while. Here's the code: t2kCalc: function (boss, time, percentHealthLeft, siegeStage, clicksNeededInCurrentStage) {
var T2K = 0;
gm.log('T2K based on siege: ' + T2K + ' T2K estimate without calculating siege impacts: ' + percentHealthLeft / (100 - percentHealthLeft) * timeLeft);
Hope that came out ok. Some of the less than and greater than signs might have gotten messed up a bit with the HTML post. |
![]() ![]() |
Why didn't you just modify the handleAttack function? It already does most of this (figuring out siege damage, enemy HP, time left to kill, etc.)... I think it's only missing the clicksToNextSiege and the formulas you want (plus it shows some of the variables and conditional formatting you might need). Your code would also be easier to read if you used the < pre> block so the spaces are maintained.
like this |


