Reply
Thread Tools Display Modes
Unread 11-24-12, 02:48 PM   #1
Voxxel
A Black Drake
Join Date: Mar 2009
Posts: 84
Question macro for Sha / Galleon lock

Hello,

I'm curious how can I check if my character is saved for Sha of Anger or Galleon on a given week.
It comes to an issue when you play 7-8 characters everyday and just cannot follow which character is already locked and which one is not.

I can't find any in-built UI option to check this and this isn't included in /raidinfo list but I heard around the internet there is a macro that can tell you in a way if your current character is saved (or already looted) or not.

Could you share it please?

(I know there is a version for AILO that can track Sha but I really don't want to use one more completely addon just for this minor issue.)
Voxxel is offline   Reply With Quote
Unread 11-24-12, 03:18 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,191
Code:
/run for k,v in pairs{GetQuestsCompleted()} do if k=32099 then print("Sha done")break end print("Sha not done")end
might work for Sha.
drycoded.
Dridzt is offline   Reply With Quote
Unread 11-24-12, 03:18 PM   #3
Clamsoda
A Cobalt Mageweaver
Join Date: Nov 2011
Posts: 243
Code:
/run local z,t,s={[32099]='Sha of Anger this week.'},GetQuestsCompleted();for c,v in pairs(z) do if t[c] then s='' else s=' not' end print('You have'..s,'done',v) end
Copied from WoWHead, apparently works.

@Dridzt: Jerk <.<
Clamsoda is offline   Reply With Quote
Unread 11-24-12, 04:08 PM   #4
Voxxel
A Black Drake
Join Date: Mar 2009
Posts: 84
Thanks a lot, guys!
Voxxel is offline   Reply With Quote
Unread 11-24-12, 04:57 PM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Mod
Featured
Join Date: Sep 2008
Posts: 1,168
I've seen that Wowhead script before and I find it mind-boggling that someone would create a table just for storing one number and one string, both of which are only used once. It's not even less characters. Here's what I would do, seems to work:

Code:
/run print("You have"..(GetQuestsCompleted()[32099] and "" or " not").." done Sha of Anger this week.")
Dridzt; Your code will iterate over every key in the table until it gets to 32099, and then it doesn't actually check whether or not the value for that key is true. You can simply use the number as the key directly and then check its value.

Last edited by Haleth : 11-24-12 at 05:01 PM.
Haleth is online now   Reply With Quote
Unread 11-24-12, 05:17 PM   #6
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,191
I did warn it's drycoded (as in if there was an obvious oversight I expected someone to correct it)
To clarify I typed it from memory and assumed the non-completed quests are nil not false, so no check was necessary.

Last edited by Dridzt : 11-24-12 at 05:23 PM.
Dridzt is offline   Reply With Quote
Unread 11-24-12, 05:39 PM   #7
Clamsoda
A Cobalt Mageweaver
Join Date: Nov 2011
Posts: 243
Additionally, Galleon's Loot quest ID is "32098".

Code:
/run print("You have"..(GetQuestsCompleted()[32098] and "" or " not").." done Galleon this week.")
That will perform the same task for Galleon, using Haleth's code of course.
Clamsoda is offline   Reply With Quote
Unread 11-24-12, 06:36 PM   #8
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Mod
Featured
Join Date: Sep 2008
Posts: 1,168
Originally Posted by Dridzt View Post
I did warn it's drycoded (as in if there was an obvious oversight I expected someone to correct it)
To clarify I typed it from memory and assumed the non-completed quests are nil not false, so no check was necessary.
You still don't have to iterate over a key-value table though, you can just use the key directly. That's what hash keys are there for after all

Last edited by Haleth : 11-24-12 at 06:38 PM.
Haleth is online now   Reply With Quote
Unread 11-24-12, 08:33 PM   #9
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 565
Shouldn't IsQuestFlaggedCompleted nowadays be faster? (for single quests)

I just remember this post about it

Last edited by Ketho : 11-24-12 at 08:36 PM.
Ketho is offline   Reply With Quote
Unread 11-24-12, 11:18 PM   #10
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,282
It should be, yes. Adjusting Haleth's macro:

Code:
/run print("You have" .. (IsQuestFlaggedCompleted(32099) and "" or " not") .. " done Sha of Anger this week.")
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 11-25-12, 02:01 AM   #11
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 548
There are way too few macroslots to waste them

http://www.wowinterface.com/download...Worldboss.html
__________________
The cataclysm broke the world ... and the pandas could not fix it!
Rilgamon is offline   Reply With Quote
Unread 11-25-12, 05:29 AM   #12
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 762
It's good that Ketho mentioned the IsQuestFlaggedCompleted because I was face-palming when I saw iteration of tables and such just to look up a specific questID. :P
__________________
Profile: Curse | Wowhead
Vlad is offline   Reply With Quote
Unread 11-25-12, 10:56 PM   #13
Talyrius
A Frostmaul Preserver
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 293
Galleon doesn't conform to the same once-a-week lockout restriction that the Sha of Anger has. I have killed Galleon twice within the typical weekly lockout timeframe on several occasions and have been eligible for loot each time.
Talyrius is offline   Reply With Quote
Unread 03-11-13, 02:06 PM   #14
Nihlo
A Murloc Raider
Join Date: Apr 2008
Posts: 5
Hi Guys, I'd like to create a macro which checks all 4 World Bosses. Something like:

Code:
/run print("Galleon: "..(GetQuestsCompleted()[32098] and "Yes" or "No"))
/run print("Sha: "..(GetQuestsCompleted()[32099] and "Yes" or "No")) 
/run print("Nalak: "..(GetQuestsCompleted()[32518] and "Yes" or "No"))
/run print("Oondasta: "..(GetQuestsCompleted()[32519] and "Yes" or "No"))
It works but I run out of Characters although that's the shortest version of quest-checking I found. Is there a way to check multiple quests with different output ?

I made a max-short ugly version:
Code:
/run print("G:"..(GetQuestsCompleted()[32098] and "Y" or "N"))
/run print("S:"..(GetQuestsCompleted()[32099] and "Y" or "N")) 
/run print("O:"..(GetQuestsCompleted()[32519] and "Y" or "N")) 
/run print("N:"..(GetQuestsCompleted()[32519] and "Y" or "N"))

Last edited by Nihlo : 03-11-13 at 02:15 PM.
Nihlo is offline   Reply With Quote
Unread 03-11-13, 04:02 PM   #15
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,282
Use a table:

Code:
/run for k, v in pairs({ Galleon = 32098, Sha = 32099, Nalak = 32518, Oondasta = 32519}) do print(format("%s: %s", k, IsQuestFlaggedCompleted(v) and "\124cff00ff00Yes\124r" or "\124cffff0000No\124r")) end
There's even room for COLORS!

Also, use IsQuestFlaggedCompleted(qID) instead of GetQuestsCompleted()[qID] to check single quests.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!

Last edited by Phanx : 03-11-13 at 06:24 PM.
Phanx is offline   Reply With Quote
Unread 03-11-13, 05:02 PM   #16
Nihlo
A Murloc Raider
Join Date: Apr 2008
Posts: 5
Yeah you're a genius...and you've got the right feeling for styling^^ But it doesn't take the colours in the "".
The output is sth like "Nalak: |cffff0000No|r".

But thanks anyway helped me a lot.
Nihlo is offline   Reply With Quote
Unread 03-11-13, 05:07 PM   #17
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 552
Try replacing | with \124
semlar is online now   Reply With Quote
Unread 03-11-13, 05:13 PM   #18
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Mod
Featured
Join Date: Sep 2008
Posts: 1,168
I'm not sure, but I thought that all (or at least some) world bosses had their weekly limit removed since patch 5.2.
Haleth is online now   Reply With Quote
Unread 03-11-13, 05:21 PM   #19
Nihlo
A Murloc Raider
Join Date: Apr 2008
Posts: 5
Originally Posted by semlar View Post
Try replacing | with \124
yeah...didn't even know this way

Originally Posted by Haleth View Post
I'm not sure, but I thought that all (or at least some) world bosses had their weekly limit removed since patch 5.2.
You can kill them every 20min but you can only get loot once a week.


For those macro-noobies like me, here's the perfect code:
Code:
/run for k, v in pairs({ Galleon = 32098, Sha = 32099, Nalak = 32518, Oondasta = 32519}) do print(format("%s: %s", k, IsQuestFlaggedCompleted(v) and "\124cff00ff00Yes\124r" or "\124cffff0000No\124r")) end
Nihlo is offline   Reply With Quote
Unread 03-11-13, 06:06 PM   #20
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Mod
Featured
Join Date: Sep 2008
Posts: 1,168
Well, the Oondasta one is strange then, because I did kill/loot him this week (160 man raid, was awesome) yet the quest doesn't indicate that.
Haleth is online now   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » Macro Help » macro for Sha / Galleon lock

Thread Tools
Display Modes

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

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