Go Back   WowAce Forums > Official Addon Threads > General AddOns
General AddOns Authors, post your release ready addons here to get feedback or just to let everyone know about it.

Reply
 
Thread Tools
Old 04-03-2009   #1
kunda
Senior Member
 
Join Date: Oct 2006
Posts: 464
Default PickPocketTimer

Pick Pocket Countdown Timer for Rogues.

Code:
-- -------------------------------------------------------------------------- --
-- PickPocketTimer by kunda                                                   --
-- -------------------------------------------------------------------------- --
--                                                                            --
-- PickPocketTimer shows a small movable frame when you target a unit whose   --
-- pocket was picked by you. This frame shows a countdown which indicates     --
-- when this units' pocket can picked again.                                  --
--                                                                            --
-- This addon was mainly created as a little helper addon for the achievement --
-- 'Insane in the Membrane'.                                                  --
--                                                                            --
-- Textcolor:                                                                 --
-- red    = Pick Pocket NOT possible    = 480-180 seconds (8:00-3:00 minutes) --
-- yellow = Pick Pocket MAY BE possible = 179-  0 seconds (2:59-0:00 minutes) --
--                                                                            --
-- This Pocket-'Respawn Times' are based on empiric experience. The result of --
-- my tests varied from 314 (5:14) to 472 (7:52) seconds.                     --
-- Conclusion:                                                                --
--  After 300 seconds there is a chance to pick the same units' pocket again. --
--  After 480 seconds every units' pocket is 'respawned'.                     --
--  If you have other results, please let me know, thanks.                    --
--                                                                            --
-- -------------------------------------------------------------------------- --
Download:
http://www.wowace.com/addons/pick-pocket-timer/files/

For the 'Insane in the Membrane' Freaks!
kunda

Last edited by kunda; 12-04-2012 at 10:24 PM. Reason: update
kunda is offline   Reply With Quote
Old 05-10-2009   #2
kunda
Senior Member
 
Join Date: Oct 2006
Posts: 464
Default Re: PickPocketTimer

Code:
check above post

Last edited by kunda; 10-15-2010 at 12:34 AM. Reason: update
kunda is offline   Reply With Quote
Old 05-12-2011   #3
Veyska
Junior Member
 
Join Date: Jul 2005
Posts: 55
Default Re: PickPocketTimer

Installed your mod earlier today on a freshly rolled rogue, but once I got pick pocket it didn't want to play nicely. Kept complaining about comparing nil to number on line 265 (forgot to copy exact error message, sorry). After much fiddling around, it seemed to be tied to XLoot (the older version). I poked at the numLootItems variable, and found a mention of a method with a similar name (GetNumLootItems) and replacing line 265 with a call to that method fixed the errors and gave me "respawn" timers...

...except when I moved. Much more fiddling ensued to no end, until I started messing with the macro I'd cobbled together to autoloot only when I pick pockets. My best guess was/is that the "/in #" toggle off for autoloot was being called too fast for PickPocketTimer and the mod was thinking autoloot had in fact been off when the pocket was picked. Increasing the delay in the toggling off resulted in timers showing up again. I poked at the code to see where all calls for autoloot's status were, and decided to try consolidating them. New local variable, a single call, subsequent references repointed to said variable, and it seems to be working even with a shorter "/in #" toggle off of autoloot.

I can post/PM the file or the snippets I changed/added if you'd like, I added I think 2 lines and modified 3.

/legitthreadnecro?
Veyska is offline   Reply With Quote
Old 05-12-2011   #4
kunda
Senior Member
 
Join Date: Oct 2006
Posts: 464
Default Re: PickPocketTimer

I do not use a loot addon, therefore I never had an error. Like you said, it's a XLoot problem (it's not nice to destroy default interface variables).

The autoloot setting is checked with GetCVar("AutoLootDefault") after LOOT_OPENED/LOOT_CLOSED...hmm is there a faster (better) way? if so, please post.

Quote:
Originally Posted by Veyska View Post
/legitthreadnecro?
you are welcome. thanks.

Quote:
Originally Posted by Veyska View Post
I can post/PM the file or the snippets I changed/added if you'd like, I added I think 2 lines and modified 3.
Sure, please post or PM.
kunda is offline   Reply With Quote
Old 05-16-2011   #5
kunda
Senior Member
 
Join Date: Oct 2006
Posts: 464
Default Re: PickPocketTimer

Veyska, I added your modifications, thanks. (http://www.wowace.com/addons/pick-pocket-timer/files/ PickPocketTimer-40100-2)

1.) GetNumLootItems() is indeed much better than LootFrame.numLootItems and should now work with all Loot Addons.

2.) Your 'Auto Loot' problem is mainly a SetCVar("AutoLootDefault", [1/0]) problem, because SetCVar is very slow, even if the 'save-cvar-to-server'-setting 'synchronizeSettings'-cvar is set to 0 (1 is the default blizz setting and means: save cvar to server). And more important: multiple SetCVar("AutoLootDefault", [1/0]) calls in a macro does not work 100% correct! Sometimes it works, but very often does not.

I recommend to enable always AutoLoot (ESC -> Interface -> Game -> Controls -> 'Auto Loot') and not to use a Pick Pocket macro that change SetCVar("AutoLootDefault", [1/0]). The simple Pick Pocket spell from the spellbook is enough. Anyway, hope the changes works for you. Happy pocket-picking.
kunda is offline   Reply With Quote
Old 11-10-2011   #6
Xuerian
Senior Member
 
Xuerian's Avatar
 
Join Date: Jan 2006
Posts: 281
Default Re: PickPocketTimer

Quote:
Originally Posted by kunda View Post
I do not use a loot addon, therefore I never had an error. Like you said, it's a XLoot problem (it's not nice to destroy default interface variables).

The autoloot setting is checked with GetCVar("AutoLootDefault") after LOOT_OPENED/LOOT_CLOSED...hmm is there a faster (better) way? if so, please post.



you are welcome. thanks.



Sure, please post or PM.
This is a bit random, but I decided to do a quick search of the forums since I was here to see if there were any outstanding issues I was unaware of, and I can't seem to find any tainting or modification of global variables that you are mentioning in the legacy version of XLoot.
If it is or was causing a issue, I would very much like to rectify it.

Also inb4 thread necro, etc. Still a valid question.
Xuerian is offline   Reply With Quote
Old 11-11-2011   #7
kunda
Senior Member
 
Join Date: Oct 2006
Posts: 464
Default Re: PickPocketTimer

The problem was:
I expect a global variable 'LootFrame' and 'LootFrame.numLootItems' after the event LOOT_OPENED. This is the default. If you have no loot changing addon installed you get a valid number in LootFrame.numLootItems after every LOOT_OPENED.

I didn't validate the variable LootFrame.numLootItems, nor LootFrame.

Because one was nil, my addon produced an error.

XLoot changed that variable(s). ([LootFrame.lua] LootFrame_Show(): 'LootFrame.numLootItems = GetNumLootItems();')

Like I wrote above, I corrected that problem, I simply use GetNumLootItems(). Thats better.

anyway:
It's a question in general if I must validate a global variable that is present by default.
__________________
addons

Last edited by kunda; 11-11-2011 at 12:47 AM.
kunda is offline   Reply With Quote
Old 11-11-2011   #8
Xuerian
Senior Member
 
Xuerian's Avatar
 
Join Date: Jan 2006
Posts: 281
Default Re: PickPocketTimer

Quote:
Originally Posted by kunda View Post
The problem was:
I expect a global variable 'LootFrame' and 'LootFrame.numLootItems' after the event LOOT_OPENED. This is the default. If you have no loot changing addon installed you get a valid number in LootFrame.numLootItems after every LOOT_OPENED.

I didn't validate the variable LootFrame.numLootItems, nor LootFrame.

Because one was nil, my addon produced an error.

XLoot changed that variable(s). ([LootFrame.lua] LootFrame_Show(): 'LootFrame.numLootItems = GetNumLootItems();')

Like I wrote above, I corrected that problem, I simply use GetNumLootItems(). Thats better.

anyway:
It's a question in general if I must validate a global variable that is present by default.
It should be considered external input to your application, as it were, so yes.
I suppose it is indeed irrelevant now that you use the appropriate function, but XLoot disables the default loot events so those variables are never properly filled. As most loot frame mods do that do not try to commandeer LootFrame
Xuerian is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:18 PM.