Defend Yourself 4.3!

-Biggest update: Turn has been broken. Boo hoo. I'm really sorry everyone, it's much easier to simply use your arrow key,
rather than attempt to work within the scripting nuances to do the required tasks. Sorry =/ -

Everything should be in working order! So here's the deal, there's 3 modules that are included here.

First is DefendYourself.xml and .lua, this is the main addon and are required.
On top of this, there are 2 removable modules that you can use, or delete at your leisure.
They are:

panic.xml and panic.lua - > Panic routines
menu.xml and menu.lua -> Menu routines


You should be able to delete them without any problems or any negative impact on the addon. If you do somehow find a negative impact
like an error message or whatever, let me know so i can fix it.

Slash commands are as follows:

/dy help - Shows the "help" screen, lets you know the status of your toggles.
/dy on - turns the addon on
/dy off - turns the addon off.
	-Option: /dy off s(ession) will turn off the addon for the current session only, and restart it the next time you log on.
/dy toggle - toggles between addon on/off.
/dy yellow - When on, you won't attack yellow creatures
/dy faction - When on, you won't attack members of the opposite faction (unless you're both pvp)
/dy debuff - When on, you won't attack crowd controlled creatures
/dy tlhp - When on, you'll attempt to target the lowest hp creature when you deselect something.
/dy assist - When on, you'll aquire your party member's targets(not attack them)
/dy dk - When on, you won't attack Civilian-marked npc's.
/dy debug - Shows you the debug screen! If you're curious why it's not working a certain way, use this.
/dy button (optional - off) - Toggles the panic button's different states, same as right-clicking on it. use /dy button off to remove it.
/dy bar (optional - off) - Toggle the panic bar's different states(between off, on, and hide when not in use). use /dy bar off to remove it.
/dy defaultpanic (required - #) - Sets the default panic time in seconds.
/dy panic (optional - #) - Puts you in panic status for the default time. If you supply a number, will ignore default time and use the time input.

/dy defaultpanic will toggle between having dy configured per-character-per-server, or use one profile over all characters and servers.

/dy blood and /dy blvl (0-3) are disabled as of 1.7. terribly sorry.

For those that like to play with the debug screen, here's what everything means:

Attacking - This is the main toggle. If it's on, nothing else should be tripped.
Once - This prevents you from doing AttackTarget() 50000 times. Should only be tripped once for your initial attack.
Combat - If you're physically beating on something.
Hate - If you're on someone's hate list, and regen is shut down. This has to be tripped for Attacking to work.
Shot - If you're using a ranged attack, Attacking should be nil.
Crazy - If you're currently feared/mind controlled/on a taxi/not in control, you won't attack.
Cast - ...I don't remember, honestly. Give me a few. heh.
Target - If your target exists, you're good to attack.
Dead - Attacking = nil if the target is dead.
Friend - If this is a friendly player. Note that friend means if you can attack them or not. If you're in a duel with a buddy, they shouldn't evaluate to be friend.
Yellow - Won't attack a creature if it's yellow.
Mount - This one should actually always be off. Unless you're on a mount. If you are, you won't attack.
Buff - Don't attack if you've got a buff, like Stealth or Drinking.
Debuff - Don't attack if the target is slept, sheeped, etc.
Use - This works VERY fast, so keep your eye open. it'll be tripped when using Aimed shot, Sap, and Gouge. Check line 115 to see the code behind it.


Pretty simple to understand. Everything there should pretty much be green.
If you're not attacking, check and make sure everything's green. if something isn't, that's the prob.
Likewise, if you're attacking and you think you shouldn't, check all the values, make sure it's reading them properly.

-----------------------------------------------------------------------------------------
FAQ:
WHY IS THERE A PANIC BUTTON?

when i first wrote the addon, i always wanted a temporary power-off button because it was really brutish with what it would attack. Flagged horde, neutral npc's, and especially stuff with crowd control. I wanted to always make sure if i did that i could immediately hit a button and it'd shut down until i got things under control. that's where the first idea came from. from there, it became an answer for most technical problems i hadn't solved yet. "Hey, DY Breaks my gouges." or "Hey, i want dy to turn off when i do this, then turn back on a little later" was always answered with "use the panic button." Now, DY works pretty damn well now all things considered, pending lag. It turns off if you have certain options selected, and what have you. Sadly for rogues and hunters, every once in a while someone who's too laggy or whatever has a problem with dy. It'll break their gouges. It'll interrupt their aimed shots. really weird buggy things. so if that's the case, they can throw the "/dy panic 5" in a gouge macro so it immediately shuts down and will auto re-enable in 5 seconds, giving them time to gouge and not knock it off, do whatever they were planning, and go back to attacking. It's stuff like that. like if something's CC'd and you want to actually attack it without using an instant and without it turning off attack for you(btw, you can still hit attack and if you're quick it'll still get off one swing before it tries to turn it off) you can just panic out of dy, attack the cc target, and it'll auto turn back on when it's done. easier than remembering to turn it off and back on later.
---------------------------------------------------------------------------------------------

Contact Info:
mail: skademon@catsonmars.com
aim: Ska Demon X
in-game: Velora (Server: Silver Hand)

Feel free to give me a yell and talk to me about anything. i'll get around to it eventually....i swear!

Ok, have fun!