AutoDing by Thorin of Eitrigg

What:
This mod automatically announces level-up's to various definable channels.


Why:
This is mostly for lazy fun. I found myself typing in the same thing every time I Dinged so I looked for an AutoDing mod. I found one that would let you type in a message that was the same for all toons every time you Dinged unless you happened to have changed the message between Dings.

Not good enough for me. I wrote my own that saved the variables out for each toon to allow a different message for each. For example my Tauren Druid could say, "DING $L! MOOOHOOO!" Where as my Human Rogue could say, "Ding $L, aaahhh that felt good." Or whatever I chose to make them say. ($L = new level when posted in game)

That still wasn't good enough. I then got the idea to pull from a list of messages. Well, to give credit where credit is due, my friend Baarwar of Eitrigg came up with the idea. What started as a round-robin of 5 messages turned into a round-robin of 10; 5 general and 5 Race-specific. Along with a few special messages for those all important level 40, 50, 55, and 60 Dings.

What, 5 general and 5 Race-specific, means is; When you Ding there are 5 messages that will post no matter what you are. But, there are five different messages that will post that do depend on what you are. For example: A Troll might say, "Don't be jealous mon, but juss Dinged again, $L!", or a Gnome might say, "Dynamite does come in small packages! Ding $L!"

Of course you can still type in your own "static" Ding message for each toon, but what's the fun in that?


FYI: The list can be found in localization.lua if you wish to change it. (Admittedly, some of the message are quite lame)


When/Where:
When one Dings, if enabled the mod reads the DingString setting for that toon; if it simply says "list" (default) it uses a message from the round-robin list of messages provided. If it says anything other than "list" that text will be used. Remember to use $L to post the correct level each time without having to edit the message.

Next it checks to see which channel it should post to. Your options are Guild, Say, Yell, Party, and Raid. There is another setting that tells it, if enabled, to post to the Party channel as well as the channel specified. So, keep in mind, if Raid is chosen you may Ding in both Raid and Party if Party Ding is enabled. However, it will not Ding twice to the Party channel. It checks for that before posting the Party Ding.

If Guild (default) or Raid is chosen it will check to see if you are in a Guild/Raid before attempting to Ding to that channel. If you are not in a Guild/Raid and not in a party, or have the Party Ding disabled, it will Ding to the Say Channel. At first it was not posting anywhere because I wasnt in a Guild/Raid or Party, and that kills the whole point of the mod. This way it is going to post SOMEWHERE every time.

Finally, it posts your message to the appropriate channel(s) based on your settings.


FYI: The variable that keeps track of which message to pull from the list is initialized with a random number 110. This way there is a better chance of different toons posting different Ding messages at different levels. My friend and I started a couple of Night Elves together and were Dinging within seconds of each other saying the same thing and it got annoying. This helps to avoid this, but isnt 100%. It is random after all.


How:
/ad config - Opens up a Config Window where you can set everything up.
/ad status - Displays current status/settings of the mod and how to switch it on/off.
/ad test - Displays current status, what message will be posted, to which channel, and at what level.


--------------------------------------------------------------------------------------
-- Update/Change Notes:
--------------------------------------------------------------------------------------
v2.1
	Fixed issue where it wasn't saving config

v2.0
	Update 2.0 friendly
	Added 5 new general posts
	Now supports user created channels.
	Code added for future use of:
		Posts for Draenei and Blood Elf races
		Allowing for max lvl change to 70
	
v1.6
	Status, config, and test are the only commands now. Please use config to change settings.
	Now has the option to ding at a specified interval of levels, IE: Every 1, 3rd, 5th, 6th, 18th, level; you pick. (see config window)
	Can now disable all messages and ONLY take a screenshot on level-up. (see config window)
	
v1.5
	Corrected logic that was causing the saved settings to be reset with each load. Settings will now only be reset if the player resets them or the version number changes.
	Now saves channel setting with all caps to be more other-addon-friendly.
	
v1.4
	Update 1.11 Friendly

v1.3
	Added code to the Whisper option. It was giving nil value errors.
	Corrected typos in localization for Gnome specific messages.

v1.2 
	1. Added a 5 second delay to the ding message to help mask the fact the player is using an addon.
	2. Added a delay to the screenshot so it snaps during the in game animation, not before.
	3. Added a message to the player's screen with the ding message that displays before the screenshot snaps. This was added because the ding message delay is longer than the screenshot delay and the message would not be displayed on the screenshot. Does not display if screenshot is disabled.
	4. Added a list of variables that can be used in the ding messages: $L=New lvl, $l=Old lvl, $D=Date, $T=Time, $R=Lvls remaining to 60
	5. Added a whisper option. If a name has been provided it will whisper that player. Blank it out to disable the option.
	6. Added RequestTimePlayed(); to each levelup. This posts the time played with that character and time played at that level.

v1.1 
	Corrected code where the guild info was pulling from target, not player. (oops)


