Thread Tools Display Modes
11-24-12, 02:48 PM   #1
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 193
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.)
  Reply With Quote
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,360
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.
  Reply With Quote
11-24-12, 03:18 PM   #3
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
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 <.<
  Reply With Quote
11-24-12, 04:08 PM   #4
Voxxel
A Chromatic Dragonspawn
Join Date: Mar 2009
Posts: 193
Thanks a lot, guys!
  Reply With Quote
11-24-12, 04:57 PM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote
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,360
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.
  Reply With Quote
11-24-12, 05:39 PM   #7
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
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.
  Reply With Quote
11-24-12, 06:36 PM   #8
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote

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


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