Is this working CalcAutoAttackTimer ?

bob_the_builder

Well-Known Member
Is this currently working in EQ2bot.iss?

Code:
function CalcAutoAttackTimer()
{

	if !${AutoAttackReady}
	{
		PrimaryDelay:Set[${EQ2DataSourceContainer[GameData].GetDynamicData[Stats.Primary_Delay].ShortLabel}]
		RunningTimeInSeconds:Set[${Script.RunningTime}/1000]
		TimeUntilNextAutoAttack:Set[${PrimaryDelay}-(${RunningTimeInSeconds}-${LastAutoAttack})]
	}

	if ${TimeUntilNextAutoAttack} < 0 && !${AutoAttackReady}
	{
		;echo AutoAttackReady: TRUE
		AutoAttackReady:Set[TRUE]
	}
}
Thought I'd add it in to my troub script, I've seen examples but just want to make sure it works. Im using this in my timed auto attacks between CA's )as an example using spell 62)

Code:
call CalcAutoAttackTimer
if ${TimeUntilNextAutoAttack} > ${Math.Calc[${Me.Ability[${SpellType[62]}].CastingTime}+${Me.Ability[${SpellType[62]}].RecoveryTime}]}
	call CastSpellRange 62 0 0 0 ${KillTarget} 0 0 1
 

jondough

Active Member
I would try it without the +recovery time piece since autoattacks can fire during recovery time there's no need to wait until it's finished unless I'm missing something.
 

VianSK

Well-Known Member
This is what I use and it works great for me, however I do not use EQ2 bot.


Code:
[COLOR="Red"]; Variables[/COLOR]
declare strWeaponType string script "slashing"
declare tmrAutoAtk int script ${System.TickCount}
declare tmrMyWpnDelay float script ${EQ2DataSourceContainer[GameData].GetDynamicData[Stats.Primary_Delay].ShortLabel}
declare DoMeleeBuff bool script FALSE

[COLOR="Red"]; Trigger to set your auto attack attempts[/COLOR]
Event[EQ2_onIncomingText]:AttachAtom[IncTxtEvt]

atom IncTxtEvt(string Text)
{
  ; --> AUTO ATTACK TIMER <--
  if (${Text.Find[YOU hit]} || ${Text.Find[YOU critically hit]}) && ${Text.Find[${strWeaponType} damage.]}
  {
[COLOR="Red"]; Recalc wpn delay on every hit as it changes with buffs procs etc[/COLOR]
    tmrMyWpnDelay:Set[${EQ2DataSourceContainer[GameData].GetDynamicData[Stats.Primary_Delay].ShortLabel}]
    tmrAutoAtk:Set[${System.TickCount}]
  }
  elseif ${Text.Find[YOU try]} && ${Text.Find[but miss]}
  {
    tmrMyWpnDelay:Set[${EQ2DataSourceContainer[GameData].GetDynamicData[Stats.Primary_Delay].ShortLabel}]
    tmrAutoAtk:Set[${System.TickCount}]
  }
 }

function F_DD()
{
  declare X int local 1
  declare abiTime float local
  declare tmrTillNext float local
[COLOR="Red"]; ability to use spells longer then your auto attach delay[/COLOR]
  if ${DoMelee} && ${Math.Calc[${Me.Ability[${DD[${X}]}].CastingTime}+${Me.Ability[${DD[${X}]}].RecoveryTime}]}<${tmrMyWpnDelay}
  {
    abiTime:Set[${Math.Calc[${Me.Ability[${DD[${X}]}].CastingTime}+${Me.Ability[${DD[${X}]}].RecoveryTime}]}]
    tmrTillNext:Set[${Math.Calc[${tmrMyWpnDelay}-((${System.TickCount}-${tmrAutoAtk})/1000)]}]
    if ${tmrTillNext}<=.075 || ${abiTime}<=${tmrTillNext}
    {
      call F_UseAbility "${DD[${X}]}"
      return TRUE
    }
  elseif ${DoMelee} && ${Math.Calc[${Me.Ability[${DD[${X}]}].CastingTime}+${Me.Ability[${DD[${X}]}].RecoveryTime}]}>${tmrMyWpnDelay}
  {
    call F_UseAbility "${DD[${X}]}"
    return TRUE 
  }
  }
  if !${DoMelee}
  {
    call F_UseAbility "${DD[${X}]}"
    return TRUE 
  } 
}
 
Last edited:
Top Bottom