For your ease, i have added two separate functions, which make a difference between auto-attacks and actual spells. (I am speaking about OnProcessSpell)
For example if you cast Jax[W] spell, "OnProcessSpellCast" will trigger, also your champ will gain a buff for a certain time.
After a bit, if you auto-attack, it will consume the [W] buff, but instead "OnProcessSpellAttack" will trigger, it will also trigger if you just do a normal auto-attack.
---------------------------
Some more info about the spellProc:
--spellProc.name = the name of the current spell cast (including autoattacks and such)
--spellProc.windUpTime = number holding the value of the required animation time for an attack to complete
--spellProc.animationTime = number holding the full animation time of an attack or spell (always greater than windUpTime)
--spellProc.castSpeed = proportional to "GetAttackSpeed(myHero);", returns the speed value of the casted spell or attack.
--spellProc.startPos.x
--spellProc.startPos.y = returns a VECTOR holding the starting position of the spell cast (often the same as GetOrigin(Object))
--spellProc.startPos.z
--||||||||||||||||||||
--spellProc.endPos.x
--spellProc.endPos.y = returns a VECTOR holding the ending position of the spell cast (often the same as GetOrigin(Object))
--spellProc.endPos.z
--||||||||||||||||||||
--spellProc.target = returns a pointer to a target if there is any (for example Ryze Q is skillshot without target, but his W does have target)
------------------------
A small example:
OnProcessSpellAttack(function(Object,spellProc) if Object == GetMyHero() then MessageBox(0,spellProc.name,"SpellAttack",0); end end) OnProcessSpellCast(function(Object,spellProc) if Object == GetMyHero() then MessageBox(0,spellProc.name,"SpellCast",0); end end)