-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathStatter!.xml
83 lines (70 loc) · 3.72 KB
/
Statter!.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<HBProfile>
//Created by EchoTiger of the BuddyForums.
<Name>Statter! - A LUA Gold Monitor [$Rev$]</Name>
<QuestOrder>
<CustomBehavior File="Misc\RunLua" Lua="
SLASH_SHOWSTATS1 = '/stats';
SLASH_SHOWSTATS2 = '/statter';
SLASH_SHOWSTATS3 = '/statter!';
SLASH_RESET1 = '/statsreset';
SLASH_TIMERRESET1 = '/timerreset';
starttime = GetTime();
currtime = GetTime();
beginningmoney = GetMoney();
function calculate()
local itemSellPrice = 0
local itemID = 0
local itemBagCount = 1
local itemStackCount = 1
total_value_of_bags = 0
for i = 0, NUM_BAG_SLOTS do
bagslots = GetContainerNumSlots(i)
for bagslotscounter = 1, bagslots do
itemID = GetContainerItemID(i, bagslotscounter)
if (itemID == nil) or (itemSellPrice == nill) then
else
itemSellPrice = select(11, GetItemInfo(itemID))
if (itemSellPrice == nil) then
itemSellPrice = 0
end
itemBagCount = select(2, GetContainerItemInfo(i, bagslotscounter))
total_value_of_bags = total_value_of_bags + (itemSellPrice * itemBagCount)
end
end
end
totals = GetCoinTextureString(total_value_of_bags);
currmoney = GetMoney();
currtime = GetTime();
tdiftime = (currtime - starttime);
tHours = string.format("%02.f", math.floor(tdiftime/3600));
tMins = string.format("%02.f", math.floor(tdiftime/60 - (tHours*60)));
tSecs = string.format("%02.f", math.floor(tdiftime - tHours*3600 - tMins *60));
difmoney = math.floor(currmoney-beginningmoney)
completetotal = math.floor(difmoney+total_value_of_bags)
farmscore = math.floor((difmoney/tdiftime)/10)
farmscore2 = math.floor((completetotal/tdiftime)/10)
gph = GetCoinTextureString(math.floor(difmoney/(tdiftime/3600)))
gph2 = GetCoinTextureString(math.floor(completetotal/(tdiftime/3600)))
gpm = GetCoinTextureString(math.floor(difmoney/(tdiftime/60 - (tHours*60))))
gpm2 = GetCoinTextureString(math.floor(completetotal/(tdiftime/60 - (tHours*60))))
end
function SlashCmdList.SHOWSTATS()
calculate()
print("|cFF00CCFF~Total Stats!|r\n|cFF85C2FFTime since activation:|r ", tHours .. "h,", tMins .. "m,", tSecs .. "s \n|cFF85C2FFObtained Gold:|r ", GetCoinTextureString(difmoney), "\n|cFF85C2FFBag Loot Value:|r ", totals, "\n|cFF85C2FFTotal Obtained + Bag Loot:|r ", GetCoinTextureString(completetotal));
print("|cFF00CCFF~Estimates!|r\n|cFF85C2FFGPH:|r ", gph, " \n|cFF85C2FFGPH (+ Bag Value):|r ", gph2, "\n|cFF85C2FFGPM:|r ", gpm, "\n|cFF85C2FFGPM (+ Bag Value):|r ", gpm2, "\n|cFF85C2FFFarm Score:|r ", farmscore, "\n|cFF85C2FFFarm Score (+Bag Value)|r ", farmscore2);
end
function SlashCmdList.RESET()
starttime = GetTime();
currtime = GetTime();
beginningmoney = GetMoney();
print("|cFF00CCFFStatter!|r has been reset.");
end
function SlashCmdList.TIMERRESET()
starttime = GetTime();
print("|cFF00CCFFStatter!|r timers have been reset.");
end
print("|cFF00CCFFStatter! is now active.|r\nType |cFF00CCFF/stats|r to show statistics!\nYou may also use |cFF00CCFF/statsreset|r to reset the stats!\nAlso, using |cFF00CCFF/timerreset|r will reset the timer.\nTo cleanly disable Statter! use the command |cFF00CCFF/reload|r.\n");
" />
<CustomBehavior File="Message" Text="\n\n|Statter!|r is now active!\n\nType /stats to show statistics!\nYou may also use /statsreset to reset the stats!\nAlso, using /timerreset will reset the timer.\n" LogColor="LightBlue" />
</QuestOrder>
</HBProfile>