blizzhackers / kolbot

d2bs: core + d2bot (noah) + kolbot libs (kolton) | January 2020's clone of https://github.com/kolton/d2bot-with-kolbot/ + further development
247 stars 160 forks source link

Config.MFSwitchPercent > 0 not working anymore in restructure branch #396

Closed curry2810 closed 7 months ago

curry2810 commented 10 months ago

If I for example set Config.MFSwitchPercent = 20 in character config file, the bot will not switch to secondary weapon slot if boss health drops below 20%. It will just stick to primary weapon slot.

I tried with both Config.PrimarySlot = -1 and Config.PrimarySlot = 0, as I was not sure if the setting is affected by the line above. It didnt make any difference though.

As the following line in Attack.js didnt make any sense for me (why switch to primary if you want to switch to secondary?):

Config.MFSwitchPercent && target.hpPercent < Config.MFSwitchPercent && me.switchToPrimary();

I modified it to

Config.MFSwitchPercent && target.hpPercent < Config.MFSwitchPercent && me.switchWeapons(1);

Now it seems to be working fine.