zaxcruis
06-12-2010, 07:13 PM
Zax's Addons
-----------------------------------------------------------------------------------------------------
MyDPS version 1.2 New as of Wednesday, June 9th, 2010
This is my personal (ie just the players damage info, not the group) damage itemized list
reporting addon. It also reports non damage data like resists and exp.
** change log **
** 1.0 initial release
** 1.1 changed the non damage data to list by damage type, altered commands. added comments
** 1.2 *fix found a bug in dealing with shared and neutral damage types.
Example:
* Blazo's Fireball - 5,434
* Resist - Blazo's Fireball: 3
... and so on.
/mydps will display all commands and help info.
-------------------------------------------------------------------------------------------------
Gem links 1.0 by Zax New as of Sat. June 12th
-- what is does:
-- Saves you from manually editing item links to see how adding gems affects stats.
-- /gem[space][output location][space][links][space][links] and so on.
-- example: /gem say [[34343]] , where [[...]] is a cop item link.
-- you can have any number of links like, /gem say [[5555]] [[55554]] [[45454]] etc
-- seperated by spaces, but be warned. It will be extremely spammy.
-- ** changelog **
-- 1.0 intial release
-- addon requested by Turbobear
------------------------------------------------------------------------------------------------------
[Right Click on the link and select SAVE LINKED CONTENT AS, in most browsers]
To Install. download the file, and copy it into your Crowns of Power/main/addons directory.
You can always "...save as" and download it directly to this directory.
In windows, this is most likely, C:\Program Files\Crowns of Power\main\addons
Download them here>>>
MyDPS version 1.2 (http://tehothers.clan.su/zaxaddons/mydps.lua)
Gem links 1.0 by Zax (http://tehothers.clan.su/zaxaddons/gem.lua)
If the links don't function here is the code:
--------------------------
mydps.lua
-- Zax_ personal damage list aka MyDPS 1.2
-- This addon lists damages done by the player, with
-- the attack\spells name and the amount of damage dealt.
-- Also counts the non-damage hit types, such as resists, blocks, etc.
-- Exp since last reset, is also accumulated and displayed in the list.
-- /mydps will show the help info, however>>
-- I omitted group and guild because this can be terribly spammy. (and fatal in a raid)
-- ** changelog **
-- 1.0 intial release
-- 1.1 changed the non damage data to list by damage type, altered commands. added comments
-- 1.2 *fix found a bug in dealing with shared and neutral damage types.
-- To install, place it in your /Crowns of Power/main/addons directory, and restart CoP.
-- send bug reports to zaxcruis@gmail.com
addChatCommand("mydps");
addoname = "MyDPS 1.2 by Zax";
-- This function just intializes some globals and sets their default values.
function resetStats()
CharName = "";
totalExp = 0;
damageTable = {};
nondmgTable = {};
totalDamage = 0;
status("MyDPS reset complete.");
end
-- This is called when the script loads, when you log on, or zone.
function onLoaded()
resetStats()
status(addoname .. " loaded.");
isLoaded = true;
nonDamageNames = {["0"]="Miss",["1"]="Dodge",["2"]="Parry",["3"]="Block",["4"]="Resist",["5"]="Absorb",["6"]="Immune",
["20"]="Damage Over Time",["21"]="Hit",["22"]="Critical",["23"]="Shared",["24"]="Neutral"};
end
function onDamageDone(damageDone, attackerName, defenderName, hitType, damageType)
-- Just retrieve information about the player (self)
if (attackerName == "You" or attackerName == "Your") then
-- Retrieve the players character name.
CharName = playerInfo("name")
-- Just intialize this to zero if nil exists
if damageTable[damageType] == nil then
damageTable[damageType] = 0;
end
-- Just intialize this to zero if nil exists
if nondmgTable[nonDamageNames[hitType] .. " - " .. damageType] == nil then
nondmgTable[nonDamageNames[hitType] .. " - " .. damageType] = 0;
end
-- We created a table key with our unique, yet long name :D and add +1, incrementing it.
nondmgTable[nonDamageNames[hitType] .. " - " .. damageType ] = nondmgTable[nonDamageNames[hitType] .. " - " .. damageType ] + 1
-- We just add new damage to the previous accumulated damage.
damageTable[damageType] = damageTable[damageType] + damageDone;
-- Keep a running total of all damage.
totalDamage = totalDamage + damageDone;
end
end
function reportDamage(func)
-- output the the character name in whatever method "func" specifies
func("\n-- Damage report for character: " .. CharName .. " --")
sorttbl = GetSortedTable(damageTable)
place = 1;
for idx,row in pairs(sorttbl) do
-- check to prevent diplaying attacks that have zero damage, such as epic DoTs.
if tonumber(row.value) > 0 then
-- this is where we loop through and display the rows of data.
func("* " .. row.key .. " - " .. commas(row.value) .. " damage" )
end
place = place + 1;
if(place > 20) then break end
end
-- output the the total damage in whatever method "func" specifies
func("Total damage since last reset: " .. totalDamage);
end
function reportNonDamage(func)
-- output the the character name in whatever method "func" specifies
func("\n-- Hit type count report for character: " .. CharName .. " --")
sorttbl = GetSortedTable(nondmgTable)
place = 1;
for idx,row in pairs(sorttbl) do
-- this is where we loop through and display the rows of data.
func("* " .. row.key .. ": " .. commas(row.value) )
place = place + 1;
if(place > 12) then break end
end
-- output the the total exp in whatever method "func" specifies
func("Total exp gained since last reset: " .. totalExp );
end
-- very simple function that adds exp to our variable when the exp event occurs.
function onExpGained(exp)
totalExp = totalExp + exp;
end
-- This is the command function, anything passed after /mydps is processed here.
-- pretty self explainitory if you wish to alter it.
function chatcmd_mydps(text)
string.lower(text);
if text == "reset" then
resetStats();
elseif text == "dmg" then
reportDamage(status);
elseif text == "ldmg" then
reportDamage(chatSay);
elseif text == "non" then
reportNonDamage(status);
elseif text == "lnon" then
reportNonDamage(chatSay);
elseif text == "all" then
reportDamage(status);
reportNonDamage(status);
else
status(addoname)
status("/mydps (shows this text)")
status("/mydps dmg (show damage data in status message)")
status("/mydps ldmg (show damage data in local chat)")
status("/mydps non (shows non damage data in status message)")
status("/mydps lnon (shows non damage data in local chat)")
status("/mydps all (shows all data in status message)")
status("/mydps reset (resets all data)")
end
end
-------------------
gem.lua
-- Zax_ Gem links 1.0
-- what is does:
-- /gem[space][output location][space][links][space][links] and so on.
-- example: /gem say [[34343]] , where [[...]] is a cop item link.
-- you can have any number of links like, /gem say [[5555]] [[55554]] [[45454]] etc
-- seperated by spaces, but be warned. It will be extremely spammy.
-- To install, place it in your /Crowns of Power/main/addons directory, and restart CoP.
-- send bug reports to zaxcruis@gmail.com
-- (ingame names, zaxdruides, zaxcruis, zaxmarr, zaxcrux, zaxundor on Lightscythe)
-- ** changelog **
-- 1.0 intial release
-- addon requested by Turbobear
addChatCommand("gem");
addoname = "Gem links 1.0 by Zax"
function onLoaded()
status(addoname .. " loaded.")
gemreset()
end
function gemreset()
gem_table = {}
end
function gem_help()
status(addoname)
status("Usage: /gem command link")
status("Example: /gem say [[555]]")
status("Output commands: say status group guild")
status("**note: you can have many links, each seperated by a space")
end
function gem_insert_and_report(func)
local gem_output = ""
for index,gems in pairs(gem_table) do
gem_output = "[[" .. gems .. "]]"
for count = 6,9 do
gem_output = gem_output .. "[[" .. count .. string.sub(gems,2) .. "]]"
end
func(gem_output)
end
gem_output = ""
gemreset()
end
function chatcmd_gem(text)
local command_table = {}
string.lower(text)
for cmd in string.gmatch(text, "%a+") do
table.insert(command_table,cmd)
end
if command_table[1] == nil then
status("**Error: No output command found.**")
gem_help()
return
end
for gems in string.gmatch(text, "%d+") do
table.insert(gem_table,gems)
end
if gem_table[1] == nil then
status("**Error: No item links found.**")
gem_help()
return
end
for index,command in pairs(command_table) do
if command == "say" then
gem_insert_and_report(chatSay);
elseif command == "group" then
gem_insert_and_report(chatGroup);
elseif command == "guild" then
gem_insert_and_report(chatGuild);
elseif command == "status" then
gem_insert_and_report(status);
else
status("**Error: Unknown output command.**")
gem_help()
end
end
command_table = {}
end
-----------------------------------------------------------------------------------------------------
MyDPS version 1.2 New as of Wednesday, June 9th, 2010
This is my personal (ie just the players damage info, not the group) damage itemized list
reporting addon. It also reports non damage data like resists and exp.
** change log **
** 1.0 initial release
** 1.1 changed the non damage data to list by damage type, altered commands. added comments
** 1.2 *fix found a bug in dealing with shared and neutral damage types.
Example:
* Blazo's Fireball - 5,434
* Resist - Blazo's Fireball: 3
... and so on.
/mydps will display all commands and help info.
-------------------------------------------------------------------------------------------------
Gem links 1.0 by Zax New as of Sat. June 12th
-- what is does:
-- Saves you from manually editing item links to see how adding gems affects stats.
-- /gem[space][output location][space][links][space][links] and so on.
-- example: /gem say [[34343]] , where [[...]] is a cop item link.
-- you can have any number of links like, /gem say [[5555]] [[55554]] [[45454]] etc
-- seperated by spaces, but be warned. It will be extremely spammy.
-- ** changelog **
-- 1.0 intial release
-- addon requested by Turbobear
------------------------------------------------------------------------------------------------------
[Right Click on the link and select SAVE LINKED CONTENT AS, in most browsers]
To Install. download the file, and copy it into your Crowns of Power/main/addons directory.
You can always "...save as" and download it directly to this directory.
In windows, this is most likely, C:\Program Files\Crowns of Power\main\addons
Download them here>>>
MyDPS version 1.2 (http://tehothers.clan.su/zaxaddons/mydps.lua)
Gem links 1.0 by Zax (http://tehothers.clan.su/zaxaddons/gem.lua)
If the links don't function here is the code:
--------------------------
mydps.lua
-- Zax_ personal damage list aka MyDPS 1.2
-- This addon lists damages done by the player, with
-- the attack\spells name and the amount of damage dealt.
-- Also counts the non-damage hit types, such as resists, blocks, etc.
-- Exp since last reset, is also accumulated and displayed in the list.
-- /mydps will show the help info, however>>
-- I omitted group and guild because this can be terribly spammy. (and fatal in a raid)
-- ** changelog **
-- 1.0 intial release
-- 1.1 changed the non damage data to list by damage type, altered commands. added comments
-- 1.2 *fix found a bug in dealing with shared and neutral damage types.
-- To install, place it in your /Crowns of Power/main/addons directory, and restart CoP.
-- send bug reports to zaxcruis@gmail.com
addChatCommand("mydps");
addoname = "MyDPS 1.2 by Zax";
-- This function just intializes some globals and sets their default values.
function resetStats()
CharName = "";
totalExp = 0;
damageTable = {};
nondmgTable = {};
totalDamage = 0;
status("MyDPS reset complete.");
end
-- This is called when the script loads, when you log on, or zone.
function onLoaded()
resetStats()
status(addoname .. " loaded.");
isLoaded = true;
nonDamageNames = {["0"]="Miss",["1"]="Dodge",["2"]="Parry",["3"]="Block",["4"]="Resist",["5"]="Absorb",["6"]="Immune",
["20"]="Damage Over Time",["21"]="Hit",["22"]="Critical",["23"]="Shared",["24"]="Neutral"};
end
function onDamageDone(damageDone, attackerName, defenderName, hitType, damageType)
-- Just retrieve information about the player (self)
if (attackerName == "You" or attackerName == "Your") then
-- Retrieve the players character name.
CharName = playerInfo("name")
-- Just intialize this to zero if nil exists
if damageTable[damageType] == nil then
damageTable[damageType] = 0;
end
-- Just intialize this to zero if nil exists
if nondmgTable[nonDamageNames[hitType] .. " - " .. damageType] == nil then
nondmgTable[nonDamageNames[hitType] .. " - " .. damageType] = 0;
end
-- We created a table key with our unique, yet long name :D and add +1, incrementing it.
nondmgTable[nonDamageNames[hitType] .. " - " .. damageType ] = nondmgTable[nonDamageNames[hitType] .. " - " .. damageType ] + 1
-- We just add new damage to the previous accumulated damage.
damageTable[damageType] = damageTable[damageType] + damageDone;
-- Keep a running total of all damage.
totalDamage = totalDamage + damageDone;
end
end
function reportDamage(func)
-- output the the character name in whatever method "func" specifies
func("\n-- Damage report for character: " .. CharName .. " --")
sorttbl = GetSortedTable(damageTable)
place = 1;
for idx,row in pairs(sorttbl) do
-- check to prevent diplaying attacks that have zero damage, such as epic DoTs.
if tonumber(row.value) > 0 then
-- this is where we loop through and display the rows of data.
func("* " .. row.key .. " - " .. commas(row.value) .. " damage" )
end
place = place + 1;
if(place > 20) then break end
end
-- output the the total damage in whatever method "func" specifies
func("Total damage since last reset: " .. totalDamage);
end
function reportNonDamage(func)
-- output the the character name in whatever method "func" specifies
func("\n-- Hit type count report for character: " .. CharName .. " --")
sorttbl = GetSortedTable(nondmgTable)
place = 1;
for idx,row in pairs(sorttbl) do
-- this is where we loop through and display the rows of data.
func("* " .. row.key .. ": " .. commas(row.value) )
place = place + 1;
if(place > 12) then break end
end
-- output the the total exp in whatever method "func" specifies
func("Total exp gained since last reset: " .. totalExp );
end
-- very simple function that adds exp to our variable when the exp event occurs.
function onExpGained(exp)
totalExp = totalExp + exp;
end
-- This is the command function, anything passed after /mydps is processed here.
-- pretty self explainitory if you wish to alter it.
function chatcmd_mydps(text)
string.lower(text);
if text == "reset" then
resetStats();
elseif text == "dmg" then
reportDamage(status);
elseif text == "ldmg" then
reportDamage(chatSay);
elseif text == "non" then
reportNonDamage(status);
elseif text == "lnon" then
reportNonDamage(chatSay);
elseif text == "all" then
reportDamage(status);
reportNonDamage(status);
else
status(addoname)
status("/mydps (shows this text)")
status("/mydps dmg (show damage data in status message)")
status("/mydps ldmg (show damage data in local chat)")
status("/mydps non (shows non damage data in status message)")
status("/mydps lnon (shows non damage data in local chat)")
status("/mydps all (shows all data in status message)")
status("/mydps reset (resets all data)")
end
end
-------------------
gem.lua
-- Zax_ Gem links 1.0
-- what is does:
-- /gem[space][output location][space][links][space][links] and so on.
-- example: /gem say [[34343]] , where [[...]] is a cop item link.
-- you can have any number of links like, /gem say [[5555]] [[55554]] [[45454]] etc
-- seperated by spaces, but be warned. It will be extremely spammy.
-- To install, place it in your /Crowns of Power/main/addons directory, and restart CoP.
-- send bug reports to zaxcruis@gmail.com
-- (ingame names, zaxdruides, zaxcruis, zaxmarr, zaxcrux, zaxundor on Lightscythe)
-- ** changelog **
-- 1.0 intial release
-- addon requested by Turbobear
addChatCommand("gem");
addoname = "Gem links 1.0 by Zax"
function onLoaded()
status(addoname .. " loaded.")
gemreset()
end
function gemreset()
gem_table = {}
end
function gem_help()
status(addoname)
status("Usage: /gem command link")
status("Example: /gem say [[555]]")
status("Output commands: say status group guild")
status("**note: you can have many links, each seperated by a space")
end
function gem_insert_and_report(func)
local gem_output = ""
for index,gems in pairs(gem_table) do
gem_output = "[[" .. gems .. "]]"
for count = 6,9 do
gem_output = gem_output .. "[[" .. count .. string.sub(gems,2) .. "]]"
end
func(gem_output)
end
gem_output = ""
gemreset()
end
function chatcmd_gem(text)
local command_table = {}
string.lower(text)
for cmd in string.gmatch(text, "%a+") do
table.insert(command_table,cmd)
end
if command_table[1] == nil then
status("**Error: No output command found.**")
gem_help()
return
end
for gems in string.gmatch(text, "%d+") do
table.insert(gem_table,gems)
end
if gem_table[1] == nil then
status("**Error: No item links found.**")
gem_help()
return
end
for index,command in pairs(command_table) do
if command == "say" then
gem_insert_and_report(chatSay);
elseif command == "group" then
gem_insert_and_report(chatGroup);
elseif command == "guild" then
gem_insert_and_report(chatGuild);
elseif command == "status" then
gem_insert_and_report(status);
else
status("**Error: Unknown output command.**")
gem_help()
end
end
command_table = {}
end