WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Formatting help needed (https://www.wowinterface.com/forums/showthread.php?t=52349)

Voxxel 06-01-15 06:04 AM

Formatting help needed
 
Hey there,

I have a macro for checking some quests if they're already completed

Code:

/run local t={"quest00",33170,"quest01",33171,"quest02",33172,"quest03",33173,"quest04",33174}for i=1,#t-1,2 do print(t[i],IsQuestFlaggedCompleted(t[i+1])and "\124cffff0000Yes" or "\124cff00ff00No")end
It prints out the quest names + Yes or No (in color codes that shows the completion) aligned underneath each other.
I need to turn this macro to print the result like this:

quest01, quest02, quest03, quest04

.. next to each other not underneath and without the yes/no result. Is it possible somehow?

Thanks for any help!

p3lim 06-01-15 07:02 AM

Code:

/run local t,s={33170,33171,33172,33173,33174},'' for i=1,#t do s=s..(IsQuestFlaggedCompleted(t[i]) and '\124cffff0000' or '\124cff00ff00')..'quest'..i..'\124r, ' end print(s:sub(1,-3))

Voxxel 06-01-15 07:18 AM

Oh well, thanks for the fast solution, much appreciated!

I see your macro uses a shared name pre-tag "quest" and then gives a number. I forgot to mention that I need to keep the possibility to set custom names for each quests, I just simplified to q1, q2, q3 etc in the sample macro. Is that possible somehow?

I mean custom names that I can set like "My first quest", etc.

p3lim 06-02-15 01:40 AM

Code:

/run local t,s={[33170]='quest1',[33171]='quest2',[33172]='quest3',[33173]='quest4',[33174]='quest5'},'' for q,n in next,t do s=s..(IsQuestFlaggedCompleted(q) and '\124cffff0000' or '\124cff00ff00')..n..'\124r, ' end print(s:sub(1,-3))
Or if you're really trying to save some space:

Code:

/run local t,s={'quest1',33170,'quest2',33171,'quest3',33172,'quest4',33173,'quest5',33174},'' for i=1,#t-1,2 do s=s..(IsQuestFlaggedCompleted(t[i+1]) and '\124cffff0000' or '\124cff00ff00')..t[i]..'\124r, ' end print(s:sub(1,-3))

Voxxel 06-03-15 01:46 AM

Thank you very much, kind Sir!


All times are GMT -6. The time now is 03:09 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI