Why do not put this weap on hand when we are on a melee range !
Finally, this is the same function as ranger with Bow.
But as I am a deceitful person, it seems normal to optimize the focus and also have the right weapon when I cast spells.
Code: Select all
Sub POTMeleeWeaponCheck
/if (${Cursor.ID}) /return
/if (${FindItem[=Staff of Rallos Zek].ID}) {
/if (!(!${Cast.Ready} || ${Me.Casting.ID} || ${Window[TargetWindow].Child[Casting_SpellName].Text.Length} || ${Window[CastingWindow].Open} || ${CastStep} || ${Me.Stunned} || ${NetBots[${Me.CleanName}].Buff.Find[3011]} || (${Cast.Active} && !${Cast.Status.Find[I]}))) {
/if (${TargetCastID}==999999 || (${Spawn[id ${TargetCastID}].ID} && ${Spawn[id ${TargetCastID}].Distance} <= ${MeleeRange} && (${AttackMode.Equal[0]} || ${AttackMode.Equal[1]}))) {
/if (${Me.Inventory[MainHand].ID}) {
/if (!${Defined[POTItem3]} && !${Select[${Me.Inventory[MainHand].Name},Staff of Rallos Zek]}) {
/declare POTItem3 string global
/varset POTItem3 ${Me.Inventory[MainHand].Name}
| Set POT_INI in file
/ini "./Bots_Data/Bot_${Me.CleanName}.ini" "POTWeapon" "POTItem3_${Me.CleanName}" "${POTItem3}"
}
}
/if (!${Select[${Me.Inventory[MainHand].Name},Staff of Rallos Zek]}) {
/exchange "Staff of Rallos Zek" MainHand
/delay 5s (${Select[${Me.Inventory[MainHand].Name},Staff of Rallos Zek]})
}
} else /if (${Defined[POTItem3]}) {
/exchange "${POTItem3}" MainHand
/delay 5s (!${Select[${Me.Inventory[MainHand].Name},Staff of Rallos Zek]})
/deletevar POTItem3
| Reset POT_INI in file
/ini "./Bots_Data/Bot_${Me.CleanName}.ini" "POTWeapon" "POTItem3_${Me.CleanName}" ""
}
}
}
/return