I am trying to write code that will check incoming text for the following: Your SPELL heals TARGETNAME for XXX points of health.
Searching for just the word "heals" does not register. Is there an Event I am unaware of? (See below code)
Searching for just the word "heals" does not register. Is there an Event I am unaware of? (See below code)
Code:
function main()
{
;-------------------------------------------
; Add in any events
;-------------------------------------------
Event[VG_OnIncomingText]:AttachAtom[ChatEvent]
Event[VG_OnIncommingCombatText]:AttachAtom[CombatEvent]
Event[VG_onAlert]:AttachAtom[CombatEvent]
variable bool IsRunning = TRUE
while ${IsRunning}
{
wait 20
waitframe
}
}
function atexit()
{
;-------------------------------------------
; Remove any events
;-------------------------------------------
Event[VG_OnIncomingText]:DetachAtom[ChatEvent]
Event[VG_OnIncommingCombatText]:DetachAtom[CombatEvent]
Event[VG_onAlert]:DetachAtom[CombatEvent]
}
;-------------------------------------------
; ChatEvent is used to monitor messages
;-------------------------------------------
atom(script) ChatEvent(string aText, string ChannelNumber, string ChannelName)
{
if ${aText.Find[heals ${Me.Target.Name} for]}
call DebugIt "${aText}"
}
;-------------------------------------------
; CombatEvent is used to monitor messages
;-------------------------------------------
atom(script) CombatEvent(string aText, int aType)
{
if ${aText.Find[heals]}
call DebugIt "${aText}"
}
;-------------------------------------------
; Echo our messages
;-------------------------------------------
function DebugIt(string aText)
{
echo "${aText}"
vgecho "${aText}"
}