Hello.
That's related to your game-client and server, not Bot. Bot is attacking a creature like you would, but game-client is probably failing to send that information to server due its own problem or in your connection. So there's nothing I can do about that.
So this is supposed to be posted on Support, not Bugs, so i'm moving it to Suppor section. You also made a mistake that would be posting in the Bugs area without submitting the mandatory information that is written in "How to Report a Bug", so please pay attention next time if posting a bug report.
You can try using a Persistent to retarget monsters... You just had to search on Forum to find the answer, because I've posted it here a few times.
This will stop attacking a creature if you are attacking the same creture and hp% remains the same for X seconds.
local CHECK_TIME_HPPC = { Min = 8, Max = 12 } -- IN SECONDS. A random number between that values will be sorted, the maximum time attacking a monster. A number will be sorted everytime that it changes target.
local RE_ATTACK = false -- Should reattack monster? It's not necessary use this if you are using Targeting or trainer, but it's your choice.
if LAST_ATTACK_INFO == nil then
LAST_ATTACK_INFO = { hppc = 0, id = 0 }
end
if TIME_CHECK == nil then
TIME_CHECK = 0
end
local attacked_creature = attacked()
if attacked_creature.id > 0 and (attacked_creature.id ~= LAST_ATTACK_INFO.id or attacked_creature.hppc ~= LAST_ATTACK_INFO.hppc) then
TIME_CHECK = runningtime() + random(CHECK_TIME_HPPC.Min, CHECK_TIME_HPPC.Max)
LAST_ATTACK_INFO = { hppc = attacked_creature.hppc, id = attacked_creature.id }
elseif attacked_creature.id > 0 and attacked_creature.id == LAST_ATTACK_ID and attacked_creature.hppc == LAST_ATTACK_INFO.hppc and TIME_CHECK > 0 and runningtime() >= TIME_CHECK then
stopattack()
if RE_ATTACK then
attack(attacked_creature.id)
end
TIME_CHECK = 0
LAST_ATTACK_INFO = { hppc = 0, id = 0 }
end
This will stop attacking a creature if you are attacking the same creture for too long. It's possible to retarget (stop and attack again) the creature or just stop attacking. The last case is the best if you are using Targeting.
local MAX_TIME_ATTACKING = { Min = 30, Max = 60 } -- IN SECONDS. A random number between that values will be sorted, the maximum time attacking a monster. A number will be sorted everytime that it changes target.
local RE_ATTACK = false -- Should reattack monster? It's not necessary use this if you are using Targeting or trainer, but it's your choice.
if LAST_ATTACK_ID == nil then
LAST_ATTACK_ID = 0
end
if TIME_CHECK == nil then
TIME_CHECK = 0
end
local attacked_creature = attacked()
if attacked_creature.id > 0 and attacked_creature.id ~= LAST_ATTACK_ID then
TIME_CHECK = runningtime() + random(MAX_TIME_ATTACKING.Min, MAX_TIME_ATTACKING.Max)
LAST_ATTACK_ID = attacked_creature.id
elseif attacked_creature.id > 0 and attacked_creature.id == LAST_ATTACK_ID and TIME_CHECK > 0 and runningtime() >= TIME_CHECK then
stopattack()
if RE_ATTACK then
attack(attacked_creature.id)
end
TIME_CHECK = 0
LAST_ATTACK_ID = 0
end