Thread Tools Display Modes
01-10-06, 12:25 AM   #1
Camera
A Murloc Raider
Join Date: Jan 2006
Posts: 4
DART scripting help

I was wondering what the code would be to hide certain textures based on gaining a target. For some reason I'm just hitting a mental block, right now I have:

ON LOAD:

this:RegisterEvent("Target_Selected")
this:RegisterEvent("Unit_Pet")

ON EVENT:

if Target_Selected("target") then
DART_Show(interface//ect...);
else
DART_Hide(interface//ect...);
end

If anyone could help it'd be greatly appreciated.
  Reply With Quote
01-10-06, 07:59 AM   #2
Lozareth
An Onyxian Warder
 
Lozareth's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 366
You can find a list of real events here: http://www.wowwiki.com/Events

DART's function need an id to a texture object, not a texture path/filename. DART_Hide(5) to hide texture #5 for instance. There's also the special variable ti which always holds the id of the texture which caused the script to run. Lastly capitalization is important.

OnLoad:
this:RegisterEvent("PLAYER_TARGET_CHANGED");

OnEvent:
if UnitName("target") then
DART_Show(ti);
else
DART_Hide(ti);
end
__________________
High Pope of the Divine Chihuahua
http://www.discordmods.com
  Reply With Quote
01-10-06, 04:29 PM   #3
Camera
A Murloc Raider
Join Date: Jan 2006
Posts: 4
I'm still getting an error with the script, this is what I updated it to

On Load:
this:RegisterEvent("PLAYER_TARGET_CHANGED");

OnEvent:
if UnitName("target") then
DART_Show(6);
else
DART_Hide(6);
end

This should show / hide Texture 6 correct? The error I'm getting is:

[string "function DART_Texture6_Script_OnEvent(param, ti)..."]:2: `=' expected near `UnitName'


Not exactly sure what I'm doing wrong, haven't coded in a few years. Thanks for the help so far, if you could help me here I'd be very greatful.
  Reply With Quote
01-10-06, 05:50 PM   #4
Lozareth
An Onyxian Warder
 
Lozareth's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 366
If you're getting that error then that's not exactly what you have entered in OnEvent.
__________________
High Pope of the Divine Chihuahua
http://www.discordmods.com
  Reply With Quote
01-10-06, 06:53 PM   #5
Camera
A Murloc Raider
Join Date: Jan 2006
Posts: 4
I copy / pasted, then I completely re-wrote it based off exactly what I put down, and the error went away. That's weird.


Thanks a lot Loz.

Is there a command for Target's target? I couldn't find it.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » DART scripting help


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