WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Macro Help (http://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   macro for Sha / Galleon lock (http://www.wowinterface.com/forums/showthread.php?t=45223)

Voxxel 11-24-12 02:48 PM

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.)

Dridzt 11-24-12 03:18 PM

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.

Clamsoda 11-24-12 03:18 PM

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 <.<

Voxxel 11-24-12 04:08 PM

Thanks a lot, guys!

Haleth 11-24-12 04:57 PM

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.

Dridzt 11-24-12 05:17 PM

I did warn it's drycoded :o (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.

Clamsoda 11-24-12 05:39 PM

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.

Haleth 11-24-12 06:36 PM

Quote:

Originally Posted by Dridzt (Post 269368)
I did warn it's drycoded :o (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 :)

Ketho 11-24-12 08:33 PM

Shouldn't IsQuestFlaggedCompleted nowadays be faster? (for single quests)

I just remember this post about it

Phanx 11-24-12 11:18 PM

It should be, yes. Adjusting Haleth's macro:

Code:

/run print("You have" .. (IsQuestFlaggedCompleted(32099) and "" or " not") .. " done Sha of Anger this week.")

Rilgamon 11-25-12 02:01 AM

There are way too few macroslots to waste them ;)

http://www.wowinterface.com/download...Worldboss.html

Vlad 11-25-12 05:29 AM

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

Talyrius 11-25-12 10:56 PM

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.

Nihlo 03-11-13 02:06 PM

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"))


Phanx 03-11-13 04:02 PM

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.

Nihlo 03-11-13 05:02 PM

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.

semlar 03-11-13 05:07 PM

Try replacing | with \124

Haleth 03-11-13 05:13 PM

I'm not sure, but I thought that all (or at least some) world bosses had their weekly limit removed since patch 5.2.

Nihlo 03-11-13 05:21 PM

Quote:

Originally Posted by semlar (Post 274495)
Try replacing | with \124

yeah...didn't even know this way

Quote:

Originally Posted by Haleth (Post 274497)
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

Haleth 03-11-13 06:06 PM

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.


All times are GMT -6. The time now is 05:44 AM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC