bot continue to use an default logic that i couldnt find (sic)
Im using it to power up my pets lvl 10+ so i changed the logic of the low lvl pets to: "attack the higher lvl mob (23~25) with one hit from the low lvl one (10~19), them change pet to a max lvl and kill it all"
The problem is that sometimes the bot try to kill the high level one with the low level or the bot just swap the low level without attacking... =(
The logic is designed in 2 parts, attack and swapout. When you want to remove the pet, the default should be to trigger a swap out, and then the bot will calculate what pet is the best one to be swapped out to.
Swapping is controlled by a score that is generated from a set of values including health and level difference which rates each pet and generates a value. Pet ratings are calculated for swapping to a new pet, but, it only gets used when the swapout is called. There is a downside to using this kind of code and it's a good bit harder to reconcile as a variable. Essentially, the suicide swap scenarios where all 3 pets are below 30% and the pet wants to swap out instead of fight to the death because it's injured.
This would require 2 changes. One, in the rating system to allow the swapout logic to be ignored as an override for level 25 pets, but it could lead to problems with PvP and fighting with an opponent who swaps out to roll combos like weather, poison and group heals, and keeps rotating.
The second, is to remove the swapout line for pets and have a more intelligent swapout system hard coded to jump between pets using a swapout logic. Or, integrated into the pet logic to handle meta and complementary abilities with teams. A team logic manager. This option, while necessary for some trainer battles, would be incredibly hard to develop infallible routines. It would require the same kind of effort as a hearthstone bot development to accommodate the random variety of different battle options with trainers.
The third option, is to hardcode a simpler and yet more elegant pet rating system designed around the scenario, ie safe boosting with the 2 25's, reckless boosting with 1 25 and 2 1-5's, pvp and pvp @ 25, and the relative level battle of enemy +/-2 levels for capturing and general practice.
It's hard to say what would be a better and easier edit, because everyone comes at the problem differently.
Enabling the swapout line if the pet is under level 25, is probably the quickest fix.
[PB] Logic SWAPOUT HASBUFF(248) = false & TURNNUMBER > 1
When this return "True" the bot swap pet without attacking, when it returns "False" the bot works the way i want... i dont know what cause it to change the "turnnumber" value from 1 to 28 (or another value) but sometimes it happens and the only way to stop this is restarting HB. I cant find the file with this setup, so i cant change it =(
Any reason why this is happening?
Turn number is not a casual setting to use. It is designed to override the Battle logic in the very first round, and usually goes up first in each and every battle. The round/turn number is taken from each battle, I can't initially remember the LUA, but it seems to have a limited application in logic unless you want to measure rounds for cooldown usage, or precisely time a swapout /forfeit condition. Good for specific purposes, not so much for levelling.
Eg. Turn number 1, is the first turn. For a low level boost pet, you could have it only attack once, and then force a swap. The survival odds are low, but who wants to go back to vanilla to level pets...
It's hard to imagine what the point of that line of logic is, since the buff (i might be wrong) is usually is one of the condition ones, ie "critter" as a buff. (I'll look it up), it should be attached to a castspell line as well to act as a limited condition trigger.