Thread Tools Display Modes
11-25-14, 05:16 PM   #1
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Macro for Gnomish Gearworks items

The Gnomish Gearworks building in my WoD garrison has a daily "invention" that you can pickup and use.

I'd like a macro that contains all possible items and uses whichever one you have for today. Is this possible?

http://www.wowhead.com/building=162#rel-items gives a list of the items.
  Reply With Quote
05-06-15, 03:03 PM   #2
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Here's a macro that works, but the tooltip is only shown when I have a "Sticky Grenade Launcher". If I only have a "Sentry Turret Dispenser", then the macro "uses" the item, but the tooltip is "?".

Since I normally have at most two items from the gearworks, this macro plus another in the opposite order can be put on two action buttons and cover whatever two I have, but it would sure be nice to have them display the correct icon.

Anyone have any ideas?

Code:
#showtooltip
/use Sticky Grenade Launcher
/use Sentry Turret Dispenser
/use Pneumatic Power Gauntlet
/use XD-57 "Bullseye" Guided Rocket Kit
/use Prototype Mekgineer's Chopper
/use "Skyterror" Personal Delivery System
  Reply With Quote
05-06-15, 05:06 PM   #3
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
I think castsequence is what you're after. Read through this thread to see if it helps shed some light.
http://us.battle.net/wow/en/forum/topic/15551555136


I use it for both Kill Command and Bestial Wrath and it works quite well to show the correct icons.
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!
  Reply With Quote
05-06-15, 06:03 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
No, because he wants to use whatever's available, not go through each item one-by-one.

bsmorgan: what you want isn't possible within the restrictions of a macro. It will only look at the first line of what you have there for the icon. You'll need to pick an icon to use for the macro as a whole.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
05-06-15, 09:23 PM   #5
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
Originally Posted by Seerah View Post
No, because he wants to use whatever's available,
I misunderstood. I use both spells in one macro, and it shows both icons.
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!
  Reply With Quote
05-06-15, 10:34 PM   #6
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
http://us.battle.net/wow/en/forum/topic/15006901215
__________________
"In this world nothing can be said to be certain, except that fractional reserve banking is a Ponzi scheme and that you won't believe it." - Mandrill
  Reply With Quote
05-07-15, 06:38 AM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Banknorris View Post
You won't be able to fit the required script into the character limit of a macro.
  Reply With Quote
05-07-15, 07:14 AM   #8
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
Just a suggestion if any addon developer is looking for something to do. I would do it but I am working on another addon at the moment and it would require me a lot of time to test parsing (I will get good at it some day). But you pros could do it in 15 minutes I think.
First, an addon that suppress the need of using #showtooltip (only in the cases you don't use parameters after it) in macros with this simple code (not only in the item macros but no macro would need a #showtooltip anymore to display the tooltip)
Lua Code:
  1. hooksecurefunc(GameTooltip,"SetAction",function(self,action)
  2.     local action_type,macro_id = GetActionInfo(action)
  3.     if action_type=="macro" then
  4.         local _,_,spell_id = GetMacroSpell(macro_id)
  5.         if spell_id then
  6.             GameTooltip:SetSpellByID(spell_id)
  7.         else
  8.             local _,link = GetMacroItem(macro_id)
  9.             if link then
  10.                 GameTooltip:SetHyperlink(link)
  11.             end
  12.         end
  13.         GameTooltip:Show()
  14.     end
  15. end)
This will give you space to put a /click N_items and N_items would pick the current macro text (by using GetMacroInfo(GetRunningMacro())), parse the lines with /use on them, get all items in the order they were put in the macro and do a check like in the link I provided. In this way you would avoid hardcoding the macro items into the addon. Just using the macro would inform the addon all the items to check and update the icon accordingly. This might not be all but I think the idea is clear enough.
__________________
"In this world nothing can be said to be certain, except that fractional reserve banking is a Ponzi scheme and that you won't believe it." - Mandrill

Last edited by Banknorris : 05-07-15 at 07:23 AM.
  Reply With Quote
05-07-15, 08:03 AM   #9
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Thanks for all the responses. Rather than create my own addon, I've decided to use Select.

While I'd like the icons to change based on which items I currently have available, I can live with a manual selection process. Generic icons won't work very well because most of these engineering gadgets have charge counts and I usually have two random items and a N.U.K.U.L.A.R. Target Painter).
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Macro for Gnomish Gearworks items

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