This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Conjuring stuff into bag 4 using a macro?
Post Reply
Return to board index
Post by
Nevoron
Hey,
i'm a mage and my 4th bag is my consumables / pots bag and i hate to drag the conjured bread and water into that bag by myself so is there any way to directly conjure stuff into that bag?
Is it possible to let a macro run another macro? If so you could just write a macro that drags all conjured items into that bag and i could add a "/macro move-conj" to my conjure macro, meh.
Hope you can help,
ty
-Nevo
Post by
hezec
I don't believe that's possible with just macros, but just get a bag mod that sorts items by their type...
ArkInventory
is a good one.
Post by
beanso
I have no idea how it's done, but it is possible with macros, as I've used a macro to put my extra ammo into my ammo bag.
I could try to look around and try to find the code, but I'm sure a resident macro expert will see this and help you out soon enough.
Post by
6893
This post was from a user who has deleted their account.
Post by
pelf
Well, the functions that can be used to pick up and put down items are still available to macros as far as I know. So you'd just have to write a macro with a few /script or /run lines.
Post by
Tildy
You cannot actually make the items spawn in the bag, but you can run a macro to look at each bag slot and find whatever item you're interested in, and then pick that item up and drop it somewhere else.
Use a simple nested 'for' loop to search every bag, for example..
/run for i=0,4 do for j=1,GetContainerNumSlots(i) do
stuff
"stuff" will be done for every bag slot, but you could change it to i=0,3 to exclude that fourth bag if stuff in there should just be ignored.
I know that multiple items can be moved around between the inventory and the bags in one run of a macro, so this should be similarly possible.
Post by
Tildy
/run for i=0,3 do for j=1,GetContainerNumSlots(i)do s=GetContainerItemLink(i,j)if s then if s:find("Conjured")then PickupContainerItem(i,j)PutItemInBag(23)end end end end
That'll do it for you :]
Checks every slot in bags 0 through 3, if the slot contains an item with "Conjured" in the item link, it picks it up and tries to put it in the first available slot in bag 4. If there are no open slots in bag 4, you get a 'bag is full' error.
Tested on my mage, seems to work well (though I arrange things differently myself, so I don't have a use for it).
edit: it also stacks partial stacks as something of a side-effect of the PutItemInBag function. Anyway, one use of this macro will gather up all your food and drink in partial or full stacks and put them all in your 4th bag, stacking partial stacks as possible.
Post by
Nevoron
Works great, thanks alot chief.
Post by
Tildy
Glad to hear it.
Post by
pelf
Woot, I knew someone would know the right functions ;).
Post by
Tildy
That 'someone' would be
wowwiki
and
lua-users wiki
in this case. I reference them often while writing stuff that acts as a learning experience for me as I go.
Post by
pelf
I'll rephrase: I knew someone would know the right functions or be interested in looking them up ;).
:)
Post by
peeweesweden
...or you could use a mod, such as TBag that removes all multiple-bagging and gives you one big, organized inventory. ^^
Post by
Tildy
Some people are super-minimalists (like me), and really try to avoid AddOns when possible. Running a script that performs the desired function can be desirable, but sometimes AddOns are justified. I've heard of many who don't like single-bag AddOns, too. Naturally, if that's something a person likes, they should go for it.
Post by
pelf
I've considered using a bag mod ... but I don't think I'd like having my bags abstracted for me. I really do use the bags as organizational compartments rather than just a space to throw my stuff.
Post by
56282
This post was from a user who has deleted their account.
Post by
Tildy
Exactly, shoggy. If the script proceeds on an empty slot, we get an error.
"s=GetContainerItemLink(i,j)" can be taken out, and each other instance of "s" replaced with "GetContainerItemLink(i,j)", but it takes up more space that way. In my initial draft of the script, I was extremely pressed for space (255 character limit), and was constantly at 255 characters trying to figure out how to squeeze in one or three more. That was while I was still checking bag 4 for empty slots and controlling exactly how items were placed in there. Turns out that this way (using PutItemInBag) probably works better anyway, and is shorter and more simple.
edit: This isn't a proprietary language, by the way; Blizzard's using
LUA
Post by
56282
This post was from a user who has deleted their account.
Post by
Tildy
Well, it's the LUA language, and blizzard has implemented
its own API
. There's a widget interface too, but I've only barely touched the surface of that.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.