| Updated: | 10-03-11 07:44 PM |
| Created: | 03-01-10 10:06 AM |
| Downloads: | 1,123 |
| Favorites: | 21 |
| MD5: |
File Name |
Version |
Size |
Author |
Date |
30300.1-Beta |
2kB |
p3lim |
03-01-10 10:06 AM |
![]() |
Comment Options |
|
|
||
|
A Kobold Labourer
Forum posts: 1
File comments: 57
Uploads: 0
|
the third edit was an attempt to understand the exact reason for the %(.*%) part of the code...since if you were just looking for the name of the spell the $s part should give you that regardless of localization since the first value returned should always be the spell name... further testing on both the tiny rogue who couldn't unlock even the easiest of boxes and the level 80 rogue who has maxed lockpicking '$s' works just fine...it glows nicely when I press alt and mouseover the box and it attempts to cast "Pick Lock" when I click on it...I'm using the enUS client...I'd help you test further but you likely need someone with a non-english client to make sure it really does work in other localizations... |
|
|
|
|
|
||
|
||
|
|
|
|
|
|
The whole point of this addon is to aid you with lockpicking, holding down alt and clicking on any lockbox and such items that can be unlocked.
It does not check for skill required and the error should pop up like it should if you don't meet the requirements. The whole point of the syntax is to check for the exact string inside the tooltip and match it to allow the button that overlaps the bag item to work. I use the GetSpellInfo merely for localization, but I have only tested this on enGB. I'll test this when I have the time for it during this week, so check in with my github page for new commits if you'd like to test it. Direct link to the alpha here: http://github.com/p3lim/Criminal/ |
|
|
|
|
|
|
|
A Kobold Labourer
Forum posts: 1
File comments: 57
Uploads: 0
|
tossing in my two cents after much trial and error....I'm no coder but sometimes I can make things work that don't....
local LOCKED_SKILL = string.gsub(ERR_USE_LOCKED_WITH_SPELL_KNOWN_SI, '%%s %%d', string.format('%s ()', GetSpellInfo(1810))) works....at least on the boxes I played with unlocking....tho my skill is maxed at 400 so there aren't any boxes I can't unlock.... but the shiny shows up when i press the alt key and the box unlocks when i click it... edit 1: I'll go level a baby rogue and see what happens when I don't have the required skills.... edit 2: I found a level 175 required box for my baby rogue to play with...when I alt-click the box it says "Item is Locked" but it still glows like it needs unlocking...I'm not yet high enough level to have the Pick Lock spell yet...else I would assume it would pop a message that says "Skill not High Enough" knowing Blizzard... edit 3: if I understand the code right you are using this to look for something like "Lockpicking (175)" in the tooltip to determine it's a locked box that can be unlocked since you can't just look for the word "Locked" since some items contain that word in the tooltip without actually being an unlockable item...you also cannot just look for the word "Lockpicking" alone...since that too is a possible false positive...so '%s ()' should work as it would always return ''Lockpicking ()'' the actually value that exists inside the () is immaterial...it only matter that the () are there along with the word Lockpicking....because that is what tells us the box is unlockable...yes? Do hope I'm not being a pest...I like puzzles, and this certainly is one ![]()
Last edited by Katardre : 03-10-10 at 03:17 PM.
|
|
|
|
|
|
|
A Defias Bandit
Forum posts: 2
File comments: 15
Uploads: 0
|
This is a bit of a feature request...could u make it so that when you right click the box it simply unlocks? There was an addon that did this a while back but it's now defunct.
|
|
|
|
|
||
|
||
|
|
|
|
|
|
Then '%s' should work just fine.
|
|
|
|
|
|
||
|
||
|
|
|
|
|
|
Upon actually finally getting to someplace where I can find lockboxes, I find that my fix didn't fix anything. Upon further investigation, it turns out that the second returned argument from GetSpellInfo(1810) is "Journeyman" on my rogue atm. I'm guessing you're using this to try to verify that the rogue is high-enough to actually pick the lockbox. But even if the rank of Lock picking returned as "125" instead of "Journeyman", the lockbox would still say what it requires, which wouldn't equal the rogue's exact skill except very rarely, wouldn't it?
I've now changed mine formatstring to '%s' and am ignoring all but the first argument returned from GetSpellInfo and it works fine for lockboxes I'm high enough to pick. I'm not sure how you'd actually check if I'm high enough level for a box, but I hope you can get it working! |
|
|
|
|
|
|
|
And so it does. Thank you for providing me with some good sample code for tracking down some more thorough documentation on Lua patterns than I've previously found. I've copied a few tricky functions that use patterns for my addons, but never really delved into understanding them.
My apologies if I sounded cocky and just came across as stupid. I'm not sure what motivated me to try putting extra % symbols in there, but it made the error go away, and then your mod worked fine. Here's the replacement that after some digging, I believe does what you intend: '%s (%s)' According to the lua-users wiki, string.format takes a formatstring as its first argument, not a Lua pattern. Thus you just have to tell it what types of data it should insert into the string, and the first two returned arguments from GetSpellInfo are both strings. You don't have to actually match the characters in the strings it returns. If I'm still wrong, please forgive me; I'm really curious now what the correct solution to this puzzle is. |
|
|
|
|
|
|
|
Thats not a fix, its a temporary change, which also breaks the whole point of the syntax
|
|
|
|
|
|
|
|
Fix: Line 9, just change '%s %(.*%)' after the string.format to '%s %%(.*%%)'
Voila! |
|
|
|
![]() |
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.