Thread Tools Display Modes
04-13-08, 11:59 PM   #1
lifetapt
A Murloc Raider
 
lifetapt's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 6
Targeting another unit using LUA

Hey fellow modders...

I was wondering if there is any way to target another unit in a similar fashion to the /target command via the API? I've updated the mod Paranoia to work with the 2.4 combat log, and I'd like to add a feature to allow it to target an enemy player it detects.

I know WoW 2.0 broke many things like auto-targeting/spellcasting, but SmartBuff is able to autocast a buff for you if you hit a hotkey or scroll the mousewheel. Can I do something similar with targeting? I don't necessarily need the addon to target without user intervention, I'd just like to add a feature like "Press F12 to target hostile" or something along those lines.

Thanks.
  Reply With Quote
04-14-08, 01:53 AM   #2
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Only if you create a secure frame to do it for you, or some other form of secure capability. TargetUnit(), etc., are now protected and cannot be called directly.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Targeting another unit using LUA


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off