This is a great How-To
Only problem is that Lua doesn't have regular expressions. They look like REs to a layman, but... real regular expressions are one heck of a lot more powerful (and more complex). Jae 15:01, 22 Dec 2005 (EST)
how do i use this in TBC2? Edit
/script if (string.find(UnitName("target"),"Bob")~=nil) then CastSpellByName("Hunter's Mark") else ClearTarget() end
now,can not work in TBC2,how do i get this function in TBC by string Pattern ?
- I don't know when this was asked; however, CastSpellByName is a protected function and cannot be used in this manner except to activate tracking abilities and open crafting frames.