Quantcast
Download
(5 Kb)
Download
Updated: 11-01-09 05:16 PM
Pictures
File Info
Updated:11-01-09 05:16 PM
Created:10-29-09 10:42 PM
Downloads:2,501
Favorites:17
MD5:

InstanceCounters

Version: 1.0.2
by: aktlingit [More]

Blizzard has a 5 instance per account per hour limitation that is kind of annoying when the collector in you is trying to farm up a recipe or piece of gear from an instance you tear through in 20 minutes or less.

This DataBroker plugin provides a tooltip that shows your 5 "locks" and what they are occupied by, as well as the time until that lock expires.

Unfortunately, at this time, there is no event triggered when you specify "Reset Instances" so in order for this addon to work properly you will need to get used to using it's right-click ability to reset instances instead of the others exposed in your UI (such as right-clicking on your portrait).

Known Bugs: None at the moment

1.0.2
====
* Added player and realm names to the instance lock entry
* Fixed boundary issue for 60 minutes exactly and not counting those instance locks as expired

1.0.1
====
* Rewrote parts to support TitanPanel in addition to ChocolateBar

1.0.0
====
* Initial release
Archived Files (1)
File Name
Version
Size
Author
Date
1.0.1
5kB
aktlingit
11-01-09 11:56 AM


Post A Reply Comment Options
Unread 10-31-09, 07:14 PM  
62shane
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
cant see icon

I love the concept of this addon but i cant seem to find the icon for it anywhere, i have tried to bring up
the icon with titan panel but as soon as I enable it in titan, I get an instant error.
This is the error I am getting

Message: ...terface\AddOns\InstanceCounters\InstanceCounters.lua:246: Usage: GameTooltip:SetOwner(frame)
Time: 11/01/09 11:17:42
Count: 1
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
(tail call): ?
[C]: ?
[C]: in function `SetOwner'
...terface\AddOns\InstanceCounters\InstanceCounters.lua:246: in function <...terface\AddOns\InstanceCounters\InstanceCounters.lua:245>
Interface\AddOns\Titan\LDBToTitan.lua:257: in function <Interface\AddOns\Titan\LDBToTitan.lua:224>

Locals: (*temporary) = GameTooltip {
SetUnitBuff = <function> defined =[C]:-1
updateTooltip = 0.033999995142221
SetUnitDebuff = <function> defined =[C]:-1
0 = <userdata>
comparing = false
SetUnitAura = <function> defined =[C]:-1
shoppingTooltips = <table> {
}
}
(*temporary) = nil
(*temporary) = "ANCHOR_NONE"
Last edited by 62shane : 11-01-09 at 05:02 AM.
Report comment to moderator  
Reply With Quote
Unread 11-01-09, 05:06 AM  
lewal
A Kobold Labourer

Forum posts: 0
File comments: 155
Uploads: 0
Talking Error..Error will robison

Date: 2009-11-01 05:04:55
ID: 1
Error occured in: Global
Count: 5
Message: ...terface\AddOns\InstanceCounters\InstanceCounters.lua line 246:
Usage: GameTooltip:SetOwner(frame)
Debug:
[C]: ?
[C]: SetOwner()
...terface\AddOns\InstanceCounters\InstanceCounters.lua:246:
...terface\AddOns\InstanceCounters\InstanceCounters.lua:245
Titan\LDBToTitan.lua:257:
Titan\LDBToTitan.lua:224
AddOns:
Swatter, v5.6.4424 (KangaII)
Corpse, v3.2.0.1
NPCScan, v3.2.0.8
NPCScanOverlay, v3.2.0.4
Ace2, v
AckisRecipeList, v1.0 2570
ActionButtonColors, v1.3
AlarBGHelper, v3.5.10 r48
AlphaMap, v3.76.30100
AlphaMapBattlegrounds, v
AlphaMapExteriors, v
AlphaMapInstances, v
AlphaMapPOIFlightMasters, v
AlphaMapPOIInstances, v
AlphaMapPOITravelAgents, v
AlphaMapPOIUtilities, v
AlphaMapWorldBosses, v
AraBrokerReputations, vr3
ArenaCalculator, v1.6.3
Atlas, v1.15.1
AtlasBattlegrounds, v1.15.1
AtlasDungeonLocs, v1.15.1
AtlasOutdoorRaids, v1.15.1
AtlasTransportation, v1.15.1
AtlasLoot, vv5.08.06
AtlasLootBurningCrusade, vv5.08.06
AtlasLootCrafting, vv5.08.06
AtlasLootOriginalWoW, vv5.08.06
AtlasLootWorldEvents, vv5.08.06
AtlasLootWrathoftheLichKing, vv5.08.06
AtlasLootFu, vv5.08.06
AtlasWorld, vv3.1.1.11
AucAdvanced, v5.6.4424 (KangaII)
AucDb, v5.1.DEV.3583
AucFilterBasic, v5.6.4424 (KangaII)
AucFilterOutlier, v5.6.4424.2531
AucMatchUndercut, v5.6.4424.2531
AucScanData, v5.6.4424 (KangaII)
AucStatClassic, v5.6.4424 (KangaII)
AucStatHistogram, v5.6.4424 (KangaII)
AucStatiLevel, v5.6.4424 (KangaII)
AucStatPurchased, v5.6.4424 (KangaII)
AucStatSales, v5.6.4424.2842
AucStatSimple, v5.6.4424 (KangaII)
AucStatStdDev, v5.6.4424 (KangaII)
AucStatWOWEcon, v5.6.4424.2530
AucUtilAHWindowControl, v5.6.4424.3311
AucUtilAppraiser, v5.6.4424.2530
AucUtilAskPrice, v5.6.4424.3175
AucUtilAutoMagic, v5.6.4424.3142
AucUtilCompactUI, v5.6.4424.2530
AucUtilEasyBuyout, v5.6.4424.3583
AucUtilFixAH, v5.6.4424 (KangaII)
AucUtilItemSuggest, v5.6.4424.3108
AucUtilPriceLevel, v5.6.4424.2545
AucUtilScanButton, v5.6.4424.2530
AucUtilScanFinish, v5.6.4424.2530
AucUtilScanProgress, v5.6.4424.2530
AucUtilSearchUI, v5.6.4424.3655
AucUtilSimpleAuction, v5.6.4424.0
AucUtilVendMarkup, v5.6.4424.2530
AuctionValue, v1.1
AvgItemLevel, vv2.0-Release
AwesomePlayerPortrait, v1.1
azHideSpam, v1.2
Babylonian, v5.1.DEV.130
BeanCounter, v5.6.4424 (KangaII)
BloodyRare, v1.4
BonusScanner, v5.2
BrokerHitCrit, v2.11.1-release
BrokerTankInfo, vb0.3.1beta
BUFX, v1.09
BuyEmAll, v
CattleProd, v2.3.0
ComeHere, v1.6
Comix, v1.777
Compass, v1.0.2
Configator, v5.1.DEV.130
DBMBurningCrusade, v
DBMCore, v
DBMInterrupts, v1.0
DBMLDB, v
DBMRaidLeadTools, v
DBMSpellTimers, v
DBMVictorySound, v1.6
DeathDealer, v1.2
DebugLib, v5.1.DEV.130
DefenseCheck, v1.0
DepositBox, v30000.2
DirtyGear, v1.2
Dominos, v1.12.1
DominosBuff, v
DominosCast, v
DominosRoll, v
DominosXP, v
Doomed, v1.0.1
ElkBuffBars, v2.2.5-150
EMLib, v
Enchantrix, v5.6.4424 (KangaII)
EnchantrixBarker, v5.6.4424 (KangaII)
EnhTooltip, v5.1.3715 (SnaggleTooth)
EquipCompare, v2.16
Examiner, v09.08.13
Fizzle, vv1.3.2
FlightMap, v
FocusFrame, v2.5.1
FuBarPlugin20, v2.0 $Revision: 66634 $
Gatherer, v3.1.14
GearDPS, v0.77b
GearScore, v3.0.011 - Release
GemQuota, v
GetOpt, v
GFWLevelator, v3.2
GhostRecon, v0.10.5
Hush, v1.0.0
ImprovedMerchant, v3.6x5
Informant, v5.6.4424 (KangaII)
InspectEquip, v1.6.2
InstanceCounters, v
Intel, v0.43
ItemRack, v
LanguageCycle, v
LastWords, v2.0.10
LibRareSpawns, v1.0.30100
LightHeaded, v298
MagicRunes, v1.0.63
MagicRunesIconDisplay, v1.0.63
MagicRunesRuneBars, v1.0.63
MagicTargets, v2.0.89
MapNotes, v5.16.30200
MapNotesBrowser, vv1.00.30200
MapNotesForAtlas, v1.00.30200
MapNotesIconLib, v1.04.30200
MapNotesIconLibFancy, v
MapNotesIconLibLegacy, v
MapNotesIconLibNeptunia, v
MapNotesIconLibNumbers, v
MinimapButtonFrame, v3.0.8
MinimapButtonFrameSkinPack, v3.0
MinimapButtonFrameTitanPlugin, v2.2
MovableBags, v
MozzFullWorldMap, v3.34.30200
MrDamage, vr813
naiStats, v
OhNoesQueues, v1.4
Omen, v3.0.8
Overcharge, v3.1.2.2
Postal, v3.2.2
PVPtimer, v
QuickMountEquip, v
RatingBuster, v
Rebar, v
RecipeKnown, v0.114a
Recount, v
Redeemer, v
sct, v6.2
sctd, v3.1
SharedMedia, v3.0.1-177
SharedMediaAdditionalFonts, v1.0
shieldmonitor, v1.5.0
SlideBar, v5.6.4424 (KangaII)
SnoofPigments, v1.1.0
Stackpack, v2.4
StealYourCarbon, v3.0.3.16
Stubby, v5.6.4424 (KangaII)
TalentedLoader, v
TankPoints, v
TipCounter, vv1.6.1
Titan, v4.3.0.30200 - Revision 316
TitanClock, v4.3.0.30200
TitanCompanion, v1.00.30000
TitanCoords, v4.3.0.30200
TitanItemBonuses, v4.1.6.30000
TitanMail, v3.0-r1
TitanMount, v1.00.30000
TitanPerformance, v4.3.0.30200
TitanRecZone, v3.0.3
TitanRegen, v4.3.0.30200
TitanRepair, v4.3.0.30200
TitanRider, v3.0 r2
TitanSkills, v1.0.9
TitanSpec, v1.4.5.30200
TitanVolume, v4.3.0.30200
TitanXP, v4.3.0.30200
Toons, v2.5.2
UrbanAchiever, v
WhereToNow, v1.6
WowLife, v1.0.0
BlizRuntimeLib_enUS v3.2.2.30200 <us>
(ck=12fb)

Report comment to moderator  
Reply With Quote
Unread 11-01-09, 11:55 AM  
aktlingit
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 8
Uploads: 4
TitanPanel

Well, being my first LibDataBroker addon I made a bad assumption - if it works in ChocolateBar it should work in TitanPanel lol.

Anyways, rewrote parts of it and tested on TitanPanel and ChocolateBar.

Uploading a new version

NOTE: Removing the initial release because it behaved SO badly in TitanPanel. Please come back and download the latest version once it's been approved if it's not available when you try to download right now.
Last edited by aktlingit : 11-01-09 at 11:57 AM.
Report comment to moderator  
Reply With Quote
Unread 11-01-09, 05:20 PM  
62shane
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Thankyou

Thankyou for the quick response, it is working very well now with titan.
I have been looking for an addon like this for ages, as itís so annoying when you get that message
You have entered too many instances today.
Cheers and thank you for making this addon.
Report comment to moderator  
Reply With Quote
Unread 11-02-09, 10:36 AM  
Tuhljin
A Flamescale Wyrmkin
 
Tuhljin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 106
File comments: 233
Uploads: 11
Originally Posted by Addon Info.
Unfortunately, at this time, there is no event triggered when you specify "Reset Instances"
You could try using hooksecurefunc with ResetInstances.
Code:
hooksecurefunc("ResetInstances", INSTANCECOUNTERSResetInstances)
INSTANCECOUNTERSResetInstances should be defined before you use this, and you'd of course have to remove the "manual" call to INSTANCECOUNTERSResetInstances you've got after your ResetInstances() call since you don't want to call it twice.
Last edited by Tuhljin : 11-02-09 at 10:38 AM.
Report comment to moderator  
Reply With Quote
Unread 11-03-09, 01:20 AM  
aktlingit
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 8
Uploads: 4
Thanks for that tip Tuhljin - didn't develop any addons for a while and missed Blizz adding the hooksecurefunc stuff.

I'll look at getting it implemented and tested over the next few days - unfortunately I'm having RAM issues though and gotta get some replacements.
Report comment to moderator  
Reply With Quote
Unread 09-14-10, 09:42 AM  
hankthetank
A Theradrim Guardian
 
hankthetank's Avatar
AddOn Author - Click to view AddOns

Forum posts: 64
File comments: 132
Uploads: 6
Found this quite useful when farming Dire Maul. As Tuhljin stated you need to make 2 changes to make it work correctly:

Code:
-- [ VERSION: 1.0.2 ] --
-- [ MODIFIED: 20091101 ] --

-- [ Instance Lock Information ] --
-- { Name, Year, Month, Day, Hour, Minute, Been Reset, Player, Realm } 
INSTANCECOUNTERSinstances = {
	{"---", -1, -1, -1, -1, -1, false, "---", "---"},
	{"---", -1, -1, -1, -1, -1, false, "---", "---"},
	{"---", -1, -1, -1, -1, -1, false, "---", "---"},
	{"---", -1, -1, -1, -1, -1, false, "---", "---"},
	{"---", -1, -1, -1, -1, -1, false, "---", "---"}};

-- [ Text Colors & Other Objects] --
local colorWhite = "|cFFFFFFFF";
local colorRed = "|cFFFF0000";
local colorGreen = "|cFF00FF00";
local debugHeader = "InstanceCounters: ";
local classcolors = {};
for i,v in pairs(RAID_CLASS_COLORS) do classcolors[i] = string.format("|cff%02x%02x%02x", v.r*255, v.g*255, v.b*255) end

-- [ Core Databroker Object & Libraries ] --
local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("InstanceCounters", {type = "data source", text = "InstanceCounters"});

-- [ Namespace ] --
local f = CreateFrame("Frame");
f:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, event, ...) end end);

-- [ Initialization ] --
function f:PLAYER_LOGIN()
	print(colorRed .. debugHeader .. colorWhite .. "Loaded");
	self:Show();
	self:RegisterEvent("PLAYER_ENTERING_WORLD");
	self:UnregisterEvent("PLAYER_LOGIN");
	self.PLAYER_LOGIN = nil;
end

function f:PLAYER_ENTERING_WORLD()
	inInstance, instanceType = IsInInstance();
	if (inInstance and (instanceType == "party" or instanceType == "raid")) then
		local iName, iType, iDifficulty, iDifficultyName = GetInstanceInfo();
		local lDate = date("*t");
		local weekday, month, day, year = lDate.wday, lDate.month, lDate.day, lDate.year;
		local hour, minute = lDate.hour, lDate.min;
		INSTANCECOUNTERSAddInstance(iName, year, month, day, hour, minute);
	end
end

-- [ OnClick Handler ] --
function dataobj.OnClick(self,button)
	if (button == "RightButton") then
		inInstance, instanceType = IsInInstance();
		if (not inInstance) then
			ResetInstances();
		else
			print(colorRed .. debugHeader .. colorWhite .. "Cannot reset instances while inside an instance.");
		end
	end
end

-- [ Tooltip Stuffs ] --
local tip = LibStub("tektip-1.0").new(6, "LEFT", "LEFT", "CENTER", "RIGHT", "RIGHT", "RIGHT")
function dataobj.OnLeave() tip:Hide() end
function dataobj.OnEnter(self)
	tip:AnchorTo(self);

	tip:AddLine(colorRed .. "Current Instance Timers");
	tip:AddLine(colorWhite .. "All timestamps use local time of your computer");
	tip:AddLine(" ");

	for i = 1, 5, 1	do
		dataobj:CheckTimeStamp(i);
			
		-- Instance Values
		local iName = INSTANCECOUNTERSinstances[i][1];
		local iYear = INSTANCECOUNTERSinstances[i][2];
		local iMonth = INSTANCECOUNTERSinstances[i][3];
		local iDay = INSTANCECOUNTERSinstances[i][4];
		local iHour = INSTANCECOUNTERSinstances[i][5];
		local iMinute = INSTANCECOUNTERSinstances[i][6];
			
		-- Format the timestamp
		local iTimestamp = "";
		if (iMonth < 10) then iTimestamp = iTimestamp .. "0" .. iMonth;
		else iTimestamp = iTimestamp .. iMonth;	end
		iTimestamp = iTimestamp .. "/";
			
		if (iDay < 10) then iTimestamp = iTimestamp .. "0" .. iDay;
		else iTimestamp = iTimestamp .. iDay; end
		iTimestamp = iTimestamp .. "/" .. iYear .. " ";
			
		if (iHour < 10) then iTimestamp = iTimestamp .. "0" .. iHour;
		else iTimestamp = iTimestamp .. iHour; end
		iTimestamp = iTimestamp .. ":";

		if (iMinute < 10) then iTimestamp = iTimestamp .. "0" .. iMinute;
		else iTimestamp = iTimestamp .. iMinute; end

		-- Current Values
		local lDate = date("*t");
		local weekday, month, day, year = lDate.wday, lDate.month, lDate.day, lDate.year;
		local hour, minute = lDate.hour, lDate.min;
			
		local minuteDiff = iMinute - minute;
		if (minuteDiff <= 0) then
			minuteDiff = 60 + minuteDiff;
		end
			
		if (iName == "---") then
			tip:AddLine(i .. ": " .. iName);
		else
			local left = i .. ": " .. iTimestamp .. " - " .. iName .. colorGreen .. " (Free in " .. minuteDiff .. " minutes)";
			local right = "     " .. INSTANCECOUNTERSinstances[i][8] .. colorWhite .. " (" .. INSTANCECOUNTERSinstances[i][9] .. ")";
			tip:AddMultiLine(left, right);
		end
	end

	tip:AddLine(" ");
	tip:AddLine(colorWhite .. "Right click to reset instances.");
	tip:Show();
end

function dataobj.CheckTimeStamp(self,index)
	if (INSTANCECOUNTERSinstances[index][1] == "---") then return end

	-- Instance Values
	local iYear = INSTANCECOUNTERSinstances[index][2];
	local iMonth = INSTANCECOUNTERSinstances[index][3];
	local iDay = INSTANCECOUNTERSinstances[index][4];
	local iHour = INSTANCECOUNTERSinstances[index][5];
	local iMinute = INSTANCECOUNTERSinstances[index][6];
	
	-- Current Values
	local lDate = date("*t");
	local weekday, month, day, year = lDate.wday, lDate.month, lDate.day, lDate.year;
	local hour, minute = lDate.hour, lDate.min;
	
	local hourDiff = hour - iHour;
	local minuteDiff = minute - iMinute;
	
	-- Big difference in time
	if (year > iYear or month > iMonth) then
		INSTANCECOUNTERSRemoveInstance(index);
	end
	
	if ((hourDiff == -23) or (hourDiff == 1)) then
		if (minuteDiff >= 0) then
			INSTANCECOUNTERSRemoveInstance(index);
		end
	elseif (((hourDiff > -23) and (hourDiff < 0)) or (hourDiff >= 2)) then
		INSTANCECOUNTERSRemoveInstance(index);
	end
end

-- [ Helper Methods, Made Global To Test Without Using Instances ] --
function INSTANCECOUNTERSClearInstances()
	for i = 1, 5, 1	do
		INSTANCECOUNTERSinstances[i][1] = "---";
		INSTANCECOUNTERSinstances[i][2] = -1;
		INSTANCECOUNTERSinstances[i][3] = -1;
		INSTANCECOUNTERSinstances[i][4] = -1;
		INSTANCECOUNTERSinstances[i][5] = -1;
		INSTANCECOUNTERSinstances[i][6] = -1;
		INSTANCECOUNTERSinstances[i][7] = false;
		INSTANCECOUNTERSinstances[i][8] = "---";
		INSTANCECOUNTERSinstances[i][9] = "---";
	end
end

function INSTANCECOUNTERSAddInstance(iName, year, month, day, hour, minute)
	local needToAdd = true;
	for i = 1, 5, 1	do
		dataobj.CheckTimeStamp(self,i);
		if (INSTANCECOUNTERSinstances[i][1] == iName and not INSTANCECOUNTERSinstances[i][7]) then
			needToAdd = false;
		end
		if (INSTANCECOUNTERSinstances[i][1] == "---" and needToAdd) then
			local _, class = UnitClass("player");
			INSTANCECOUNTERSinstances[i][1] = iName;
			INSTANCECOUNTERSinstances[i][2] = year;
			INSTANCECOUNTERSinstances[i][3] = month;
			INSTANCECOUNTERSinstances[i][4] = day;
			INSTANCECOUNTERSinstances[i][5] = hour;
			INSTANCECOUNTERSinstances[i][6] = minute;
			INSTANCECOUNTERSinstances[i][7] = false;
			INSTANCECOUNTERSinstances[i][8] = classcolors[class] .. UnitName("player");
			INSTANCECOUNTERSinstances[i][9] = GetRealmName();
			dataobj.CheckTimeStamp(self,i);
			break
		end
	end
end

function INSTANCECOUNTERSRemoveInstance(index)
	for i = index, 4, 1 do
		INSTANCECOUNTERSinstances[i][1] = INSTANCECOUNTERSinstances[i + 1][1];
		INSTANCECOUNTERSinstances[i][2] = INSTANCECOUNTERSinstances[i + 1][2];
		INSTANCECOUNTERSinstances[i][3] = INSTANCECOUNTERSinstances[i + 1][3];
		INSTANCECOUNTERSinstances[i][4] = INSTANCECOUNTERSinstances[i + 1][4];
		INSTANCECOUNTERSinstances[i][5] = INSTANCECOUNTERSinstances[i + 1][5];
		INSTANCECOUNTERSinstances[i][6] = INSTANCECOUNTERSinstances[i + 1][6];
		INSTANCECOUNTERSinstances[i][7] = INSTANCECOUNTERSinstances[i + 1][7];
		INSTANCECOUNTERSinstances[i][8] = INSTANCECOUNTERSinstances[i + 1][8];
		INSTANCECOUNTERSinstances[i][9] = INSTANCECOUNTERSinstances[i + 1][9];
	end
	INSTANCECOUNTERSinstances[5][1] = "---";
	INSTANCECOUNTERSinstances[5][2] = -1;
	INSTANCECOUNTERSinstances[5][3] = -1;
	INSTANCECOUNTERSinstances[5][4] = -1;
	INSTANCECOUNTERSinstances[5][5] = -1;
	INSTANCECOUNTERSinstances[5][6] = -1;
	INSTANCECOUNTERSinstances[5][7] = false;
	INSTANCECOUNTERSinstances[5][8] = "---";
	INSTANCECOUNTERSinstances[5][9] = "---";
end

function INSTANCECOUNTERSResetInstances()
	for i = 1, 5, 1 do
		INSTANCECOUNTERSinstances[i][7] = true;
	end
end

hooksecurefunc("ResetInstances", INSTANCECOUNTERSResetInstances);

if IsLoggedIn() then f:PLAYER_LOGIN() else f:RegisterEvent("PLAYER_LOGIN") end
Last edited by hankthetank : 09-14-10 at 09:47 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: