So forgive me for being a complete and total noob at this, but I can't figure this out for the life of me.
My guild is working on a new DKP system that is based on a natural log scale, so the more DKP you have, the less DKP you earn. In trying to find numbers that work to assign for how much a boss kill is worth, how much items are worth to purchase, I wanted to create a simple mod (My first, surprise surprise) that just lived in the chat window, where you would type /dkpformula X or /dkpf X and it would output how much your X is worth when the player has 0, 50, 100, 250, 500, and 750 DKP, using the formula we have decided to use.
The formula isn't the issue. I can't get the damn slash command to work at all, and I feel so dumb that
that is where I'm getting hung up on this whole thing.
I hope someone with a kind heart could look this over and tell me what I'm doing wrong... (I can probably figure out other errors going forward if I could just get the slash command to work in the first place)
Code:
## Interface: 20400
## Title: DKP Formula
## Notes: by |cffff7d0aMailah
## Dependencies:
DKPFormula.lua
DKPFormula.xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
<Script file="DKPFormula.lua"/>
<Frame name="DKPFormulaCore" frameStrata="LOW" enableMouse="false" hidden="false">
<Scripts>
<OnLoad>DKPFormula_OnLoad();</Onload>
</Scripts>
</Frame>
</Ui>
Code:
function DKPFormula_OnLoad()
SlashCmdList["DKPFORMULA"] = DKPFormula_Command(var);
SLASH_DKPFORMULA1 = "/dkpformula";
SLASH_DKPFORMULA2 = "/dkpf";
CONSTANT_E = 2.71828182845904523536;
DKP_ZERO = 0;
DKP_FIFTY = 0;
DKP_ONE_HUNDRED = 0;
DKP_TWO_FIFTY = 0;
DKP_FIVE_HUNDRED = 0;
DKP_SEVEN_FIFTY = 0;
end
function DKPFormula_Command(var)
DKP_ZERO = 1000 - (1000 * CONSTANT_E ^ ( -(-300 * math.log((1000-0)/1000)+var) / 300 ));
DKP_FIFTY = 1000 - (1000 * CONSTANT_E ^ ( -(-300 * math.log((1000-50)/1000)+var) / 300 ));
DKP_ONE_HUNDRED = 1000 - (1000 * CONSTANT_E ^ ( -(-300 * math.log((1000-100)/1000)+var) / 300 ));
DKP_TWO_FIFTY = 1000 - (1000 * CONSTANT_E ^ ( -(-300 * math.log((1000-250)/1000)+var) / 300 ));
DKP_FIVE_HUNDRED = 1000 - (1000 * CONSTANT_E ^ ( -(-300 * math.log((1000-500)/1000)+var) / 300 ));
DKP_SEVEN_FIFTY = 1000 - (1000 * CONSTANT_E ^ ( -(-300 * math.log((1000-750)/1000)+var) / 300 ));
DEFAULT_CHAT_FRAME:AddMessage("With an award of "..var.." base DKP, you would be awarding as follows:",1,1,0);
DEFAULT_CHAT_FRAME:AddMessage("To someone with 0 DKP: "..DKP_ZERO,1,1,0);
DEFAULT_CHAT_FRAME:AddMessage("To someone with 50 DKP: "..DKP_FIFTY,1,1,0);
DEFAULT_CHAT_FRAME:AddMessage("To someone with 100 DKP: "..DKP_ONE_HUNDRED,1,1,0);
DEFAULT_CHAT_FRAME:AddMessage("To someone with 250 DKP: "..DKP_TWO_FIFTY,1,1,0);
DEFAULT_CHAT_FRAME:AddMessage("To someone with 500 DKP: "..DKP_FIVE_HUNDRED,1,1,0);
DEFAULT_CHAT_FRAME:AddMessage("To someone with 750 DKP: "..DKP_SEVEN_FIFTY,1,1,0);
end
I realize this is probably horribly organized and everything, but I don't care if it's not "efficient" or whatever, I just want it to work, or at least not give me the "Type /help for a list of commands" when I use the /dkpf or whatever... Any pointers would be MUCH appreciated.