This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Is there any command in macro,that can click Item?
Post Reply
Return to board index
Post by
Mates1500
As name of topic says.. I need this
Everyday I am buying tons of Saronite Ores to prospect (golds yeah)
But it is so boring to click Prospecting and "Saronite Ore" everytime I want to prospect,so is there any way to create macro,that will cast Prospecting and click on Saronite Ore? Thanks in Advance
Post by
Merfed
This might help you:
http://www.wowinterface.com/downloads/info8633-Panda.html#info
Post by
Mates1500
Thank you very much for this,this is something that I had on my mind :)
Post by
Wanderingfox
#showtooltip
/cast Prospecting
/use Saronite Ore
Just turn auto-loot on and spam that.
Post by
RedwoodElf
Hmn...I wonder if you could write a script to check the quantity of each stack of ore in your mining sack, and if it finds a stack with itemCount >= 5, use prospecting on it (skipping any further attempts if prospecting is "casting" already) let's say you always keep your mining sack in bag slot 1
/cast Prospecting
/script for s = 1, GetContainerNumSlots(1) do local item = GetContainerItemLink(1,s) Q=getItemCount(item) if Q > 4 then UseContainerItem(1,s) end end
Haven't actually tried that yet, and the syntax may be a bit off...I'm a Java/C programmer, not Lua.
Post by
HighFive
Even if UseContainerItem is not protected in this case (not mentioned on wowwiki and can't check it), that macro will attempt to prospect anything, not just ore. Also, you should use GetContainerItemInfo to get the quantity of ore in the current slot (not too sure here. If you have a stack of 2 and a stack of 3 does it still prospect them?).
Something like:/run for s=1,GetContainerNumSlots(1)do local _,q=GetContainerItemInfo(1,s)if nil~=strfind(GetContainerItemLink(1,s)," Ore")and q>4 then UseContainerItem(1,s)end end
(oh and btw, you defined Q as a global)
Post by
RedwoodElf
Even if UseContainerItem is not protected in this case (not mentioned on wowwiki and can't check it), that macro will attempt to prospect anything, not just ore. Also, you should use GetContainerItemInfo to get the quantity of ore in the current slot (not too sure here. If you have a stack of 2 and a stack of 3 does it still prospect them?).
Something like:/run for s=1,GetContainerNumSlots(1)do local _,q=GetContainerItemInfo(1,s)if nil~=strfind(GetContainerItemLink(1,s)," Ore")and q>4 then UseContainerItem(1,s)end end
(oh and btw, you defined Q as a global)
Picky, picky...Hmn...don't think your syntax is correct...Does GetContainerItemInfo return a numeric value of how much is in the stack? Because you're trying to compare it to an integer, and if it's actually a link/pointer I don't think that'll work.
In any case, I tried this one out...and it WOULD work, if useContainerItem weren't blocked in this context (note that it also has a problem with Gold Ore and other nonprospectable ores):
/cast Prospecting
/run for s=1,GetContainerNumSlots(1)do local item=GetContainerItemLink(1,s) if item and string.find(item,"Ore") and GetItemCount(item)>4 then UseContainerItem(1,s) DEFAULT_CHAT_FRAME:AddMessage("Prospecting "..item) end end
I'm wondering if some variation of HighFive's self-editing macro could be used to make this work? Loop through the bag, looking for " Ore" in the names, and if you find one with an itemcount above 4, edit the last line to /use <ore name>?
Would still have problems with gold ore, etc, but could work?
Post by
HighFive
Should work.
GetContainerItemInfo returns texture, itemCount, locked, quality, readable.
And "_,q=GetContainerItemInfo(1,s)" is the same as "q=select(2,GetContainerItemInof(1,s)" in case you didn't know.
Brb with macro./run for s=1,GetContainerNumSlots(1)do local _,q=GetContainerItemInfo(1,s)if strfind(GetContainerItemLink(1,s)," Ore")and q>4 then local n,m="Prospecting" m=GetMacroBody(n)EditMacro(n,n,1,strsub(m,1,strfind(m,"\n")).."/use "..n.."\n/use 1 "....s))break end end
/use ProspectingUnfortunately well beyond the 255 char limit.
You can still use a macro to edit
another
macro and then click the button it's on:/run local n,q="Prospecting" for s=1,GetContainerNumSlots(1)do _,q=GetContainerItemInfo(1,s)if strfind(GetContainerItemLink(1,s)or "","Ore")and q>4 then EditMacro(n,n,1,"/use "..n.."\n/use 1 "..s)break end end
/click WhateverButtonTheProspectingMacroIsOn
Post by
RedwoodElf
How about this method:
Macro 1 (on actionbar 1): edits macro 2 (which is on actionbar 2, in the same slot) to:
/use prospecting
/use <ore name>
/changeactionbar 1
and is formatted like so:
/run <code to edit the macro here>
/changeactionbar 2
This way, you can name the other macro something really short (Like P1) and it doesnt actually edit itself, cutting out the need to have /use prospecting in macro 1, and giving you enough extra charaacters to make it a bit more robust.
By the by, is the tooltip info available to scripts? If so, instead of searching for " Ore" you could search for "Prospectable" (or some subset thereof) in the item tooltip, and avoid the "tries to prospect gold/Khorium/Truesilver" error.
By the way, the reason I use Quote tags instead of Code tags is, the code tag doesn't visibly display the macro completely, making it hard to see what's going on without cuting and pasting
EDIT: also, you seem to be using the variable 'q' for two different things
"prospecting"
and
_,q=GetContainerItemInfo(1,s)
Is this some oddity of lua that allows the same identifier to be used for multiple things simultaneously, or is there something I'm missing?
Post by
HighFive
I just like the \ font. :P
It looks... code-y...
Anyway, as you can see
here
and
here
, the only types of ore that are common quality (white) but not prospectable are Dark Iron and Nethercite. The shortest check I can think of for this purpose:"ffffffff"==select(3,strfind(link, "^|c(%x+).*Ore$"))and not strfind(link,"^")If I got my RegExps right this should just about work.
EDIT: also, you seem to be using the variable 'q' for two different things
"prospecting"
and
_,q=GetContainerItemInfo(1,s)
Is this some oddity of lua that allows the same identifier to be used for multiple things simultaneously, or is there something I'm missing?This is one of my favorite things about Lua.
"a,b,c=d,e,f" is the same as "a=d b=e c=f".
So "local n,q="Prospecting"" assigns "Prospecting" to n. I just put q in there too, so that I don't have to retype "local" later.
Since GetContainerItemInfo returns more than one value, and the second one is the one we need, "_,q=GetContainerItemInfo(1,s)" dumps the first value and assigns the second to q.
Another pleasant side effect is that "a,b=b,a" will swap their values without the need for a temporary variable.
Post by
RedwoodElf
I just like the \ font. :P
It looks... code-y...
Anyway, as you can see
here
and
here
, the only types of ore that are common quality (white) but not prospectable are Dark Iron and Nethercite. The shortest check I can think of for this purpose:"ffffffff"==select(3,strfind(link, "^|c(%x+).*Ore$"))and not strfind(link,"^")If I got my RegExps right this should just about work.
Ouchie...that's long...heh..O well, can live with the occasional lockup I suppose...so have you got a workable, if maybe two macro, solution yet?
Post by
HighFive
It's getting late here, I'll soon hit the bed.
Just FYI, this will be quite easy to achieve with a short addon to either define the editing part of the macro as a function (to fit in the char limit) or set it to update the macro by itself every time the "BAG_UPDATE" event is fired.
Post by
RedwoodElf
It's getting late here, I'll soon hit the bed.
Just FYI, this will be quite easy to achieve with a short addon to either define the editing part of the macro as a function (to fit in the char limit) or set it to update the macro by itself every time the "BAG_UPDATE" event is fired.
Unfortunately, I'm not a lua programmer, at least not yet. If you could post the lua code, I can try it out.
How about making it update three different macros:
disenchant: updated to the first disenchantable (white or green only) found in bags (Disenchanting blues/purples should be a decision left to the player, not an addon/macro)
/use Disenchant
/use <item>
Prospecting: As above, but with prospectable ore (since it's an addon, it can explicitly exclude "Khorium Ore", "Gold Ore", "Truesilver Ore", etc by name.)
/use Prospecting
/use <Ore>
Milling: As above, but with millable herbs
/use milling
/use <Herb>
We can call it "High Five's Resource Processor Macro Updater"
Post by
HighFive
Haha. I'll cook something up, but that's one
terrible
name. :D
Post by
RedwoodElf
Haha. I'll cook something up, but that's one
terrible
name. :D
Better than "High Five's Application for Resource Management (Yup, it's H-FARM)
Post by
HighFive
I think I'm done with it. (meanwhile: Molinari, which looks great)
Tested with enchanting and ghetto-tested with jewelcrafting.
As soon as I decide on a name, I'll upload it to WoWI.
Post by
Wanderingfox
Another pleasant side effect is that "a,b=b,a" will swap their values without the need for a temporary variable.
Technically speaking, there's still a temporary 'variable' created, it's just created by the Lua backend, and not by you XD
Post by
HighFive
I didn't see no temp var. 0:
Anyway, if nothing else it's very convenient.
yay, addon
Post by
RedwoodElf
Well I downloaded it, but maybe I'm installing it incorrectly, because it's not showing up as installed within the game (though it is in the "load Addons" list)
From an initial glance at the code, it only creates the macros if you actually have the appropriate skill, and, I'm guessing, creates it in the particular characters' personal macro list?
Haven't ever tried to debug an addon yet...how do you pull up the error frame, to see if it's giving a "you have too many macros" or other errors?
Aha! Forgot to create an XML file for it...now it's working...I'll do some testing tomorrow.
For example, let's see if it autoignores something too high level for my prospecting/disenchanting/whatever skill.
Post by
RedwoodElf
Hmn...it deletes the macros when you log off, meaning you can't keep the macro on a toolbar between sessions... (I thought at first that I had to make the macros myself, but then I saw where they were...)
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.