Quantcast
WoWInterface - View Single Post - (Relatively) simple script help
View Single Post
07-26-18, 07:59 PM   #3
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
I don't see why not. You'd just have to grab the itemlink from the tooltip (local itemName, ItemLink = GameTooltip:GetItem() ). If you know the call that occurs from the command line code you can write a tiny macro script to call it and pass in the item link.

Edit: Nope, you can't. The AV:ToggleJunk() function contains the below line, which could be formed to pass in item name and itemid from gametooltip:getitem()...
Lua Code:
  1. listToggle(self.db.profile.junk, 'junk list', itemId, itemName)

...however, listToggle is a local function, so you can't call it from a /script macro.
Lua Code:
  1. local function listToggle(list, listName, itemId, itemName)

You'll have to contact the author to have them add the function, or you could a function yourself to your local copy of the code.

Edit2:
This might work. It's dry-coded (I can't test it atm) but it might work. Your macro should look like: /script AV:ToggleJunkFromTooltip()
Lua Code:
  1. function AV:ToggleJunkFromTooltip()
  2.     local itemName, ItemLink = GameTooltip:GetItem()
  3.     if itemLink then
  4.         local itemId = tonumber(strmatch(msg, "item:(%d+)"))
  5.         listToggle(self.db.profile.junk, 'junk list', itemId, itemName)
  6.     end
  7. end
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail

Last edited by VincentSDSH : 07-26-18 at 08:11 PM.
  Reply With Quote