SHOW:
|
|
- or go back to the newest paste.
| 1 | var rarities = [ItemRarity.COMMON, ItemRarity.UNCOMMON, ItemRarity.RARE, ItemRarity.EPIC, ItemRarity.LEGENDARY]; | |
| 2 | var monsters = [MonsterRarity.COMMON, MonsterRarity.RARE, MonsterRarity.ELITE, MonsterRarity.BOSS]; | |
| 3 | var mercs = ['footman', 'cleric', 'commander', 'mage', 'thief', 'warlock']; | |
| 4 | var maxMonster = 2; | |
| 5 | ||
| 6 | function efficiency() {
| |
| 7 | return mercs.map(function(m){return {name : m.toUpperCase(), efficiency : game.mercenaryManager[m + 'Price'] / parseFloat(game.mercenaryManager.getGps().replace(/,/g,'')) + game.mercenaryManager[m + 'Price'] / game.mercenaryManager.getMercenariesGps(m.toUpperCase())}}).sort(function(a,b){return a.efficiency > b.efficiency});
| |
| 8 | } | |
| 9 | ||
| 10 | var autoSell = setInterval(function(){
| |
| 11 | game.inventory.slots.forEach(function(i,x){
| |
| 12 | if (i != null) {
| |
| 13 | var equipped = game.equipment.slots.filter(function(e){return e != null && e.type == i.type})[0];
| |
| 14 | if (equipped == null || i.maxDamage > equipped.maxDamage || (i.maxDamage == equipped.maxDamage && i.goldGain > equipped.goldGain) || (i.maxDamage == equipped.maxDamage && i.goldGain == equipped.goldGain && i.itemRarity > equipped.itemRarity) || (i.maxDamage == equipped.maxDamage && i.goldGain == equipped.goldGain && i.itemRarity == equipped.itemRarity && i.sellValue > equipped.sellValue)) {
| |
| 15 | game.equipment.equipItem(i, x); | |
| 16 | } else {
| |
| 17 | game.inventory.sellItem(x); | |
| 18 | } | |
| 19 | } | |
| 20 | - | },0); |
| 20 | + | |
| 21 | },0); | |
| 22 | ||
| 23 | var autoFight = setInterval(function() {
| |
| 24 | if (game.player.health * 2 >= game.player.getMaxHealth()) {
| |
| 25 | attackButtonClick(); | |
| 26 | } | |
| 27 | },0); | |
| 28 | ||
| 29 | var autoBuy = setInterval(function() {
| |
| 30 | var bestPurchase = efficiency()[0]; | |
| 31 | if (game.player.gold > game.mercenaryManager[bestPurchase.name.toLowerCase() + "Price"]) {
| |
| 32 | game.mercenaryManager.purchaseMercenary(bestPurchase.name); | |
| 33 | } | |
| 34 | }, 0); | |
| 35 | ||
| 36 | var autoFlee = setInterval(function() {
| |
| 37 | if (monsters.indexOf(game.monster.rarity) > maxMonster) {
| |
| 38 | game.leaveBattle(); | |
| 39 | game.enterBattle(); | |
| 40 | } | |
| 41 | }, 0); |