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
11-24-12, 08:33 PM   #9
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
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.
  Reply With Quote
11-24-12, 11:18 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It should be, yes. Adjusting Haleth's macro:

Code:
/run print("You have" .. (IsQuestFlaggedCompleted(32099) and "" or " not") .. " done Sha of Anger this week.")
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
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: 822
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!
  Reply With Quote
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: 793
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
  Reply With Quote
11-25-12, 10:56 PM   #13
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
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.
  Reply With Quote
03-11-13, 02:06 PM   #14
Nihlo
A Murloc Raider
Join Date: Apr 2008
Posts: 7
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.
  Reply With Quote
03-11-13, 04:02 PM   #15
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 03-11-13 at 06:24 PM.
  Reply With Quote
03-11-13, 05:02 PM   #16
Nihlo
A Murloc Raider
Join Date: Apr 2008
Posts: 7
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.
  Reply With Quote
03-11-13, 05:07 PM   #17
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Try replacing | with \124
  Reply With Quote
03-11-13, 05:13 PM   #18
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
I'm not sure, but I thought that all (or at least some) world bosses had their weekly limit removed since patch 5.2.
  Reply With Quote
03-11-13, 05:21 PM   #19
Nihlo
A Murloc Raider
Join Date: Apr 2008
Posts: 7
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
  Reply With Quote
03-11-13, 06:06 PM   #20
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote

WoWInterface » 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