2H<>1H+Shield toggle
#1
How to set up a macro

1. Type /macro
2. Press New
3. Enter a name
4. Select an icon
5. Type in your macro

Once your macro is made, you can either drag the icon to a toolbar or access it by typing /macro <name> from the command line.

Note on the /script command. You may include a /script [string] command in your macro, where [string] can be any valid chunk of Lua code. Multiple statements should be delimited with a semi-colon. The World of Warcraft API page lists global Lua functions that may be called.

A one button toggle (to switch from 2H to sword+board or vice versa): cut & paste the following 2 lines into your macro: (Ref. 3)

/script if( not GetInventoryItemQuality("player",17)) then PickupContainerItem(X,1) PickupInventoryItem(16) UseContainerItem(X,2) else PickupInventoryItem(17) PickupContainerItem(X,2) UseContainerItem(X,1);end


Usage

X = bag#
1,2 = slot#


Example: for a 10 slot bag in (leftmost) position 4

1. Equip 1H weapon & shield
2. Place 2H weapon in bag 4, slot 9
3. Don't put loot items in slot 10!


/cast Bloodrage
/script if( not GetInventoryItemQuality("player",17)) then PickupContainerItem(4,9) PickupInventoryItem(16) UseContainerItem(4,10) else PickupInventoryItem(17) PickupContainerItem(4,10) UseContainerItem(4,9);end


I cast Bloodrage first, you don't have to. I put the macro icon in the - (minus) position on the buttonbar and Shield Bash in position 0 (zero) to do a quick swat to interrupt a cast.


References

1. http://wowvault.ign.com/
2. http://www.wowwiki.com/
3. http://forums.worldofwarcraft.com/thread.a...&tmp=1#post7427

[Image: spangles_sig_3.jpg]
Reply
#2
Very cool.

I currently have my weapons and shield in a bar for quick switch. The drawback to this is of course two clicks or hot keys when equipping one-hand/shield. Do you know how to activate such from a bar in a macro instead of having set locations in inventory? Seems like there ought to be a way to launch a shortcut from a bar this way...

The problem is that (iirc) when you select the 2-hand (for example), you have no guarantee where the shield and one-hand weapon are going to end up in your bags so your macro won't work the next time. I guess that's why you caution against putting loot in such a slot, but I don't get to pick where my loot goes as I just click (I don't drag) when looting.
Reply
#3
The syntax for using an itm on an action bar from a macro is given in an example I found as

/script UseAction(ActionID, x, y);

"Itm must be placed in the action bar at the slot given by ActionID. ActionID is a number from 1 to 120. Slot1-ActionBar1 is ActionID1, Slot12 is ActionID12, Slot1-ActionBar2 is ActionID13 and so on up to Slot12 of ActionBar10. "

Presumably x is the slot number and y is the bar number, but the example does not make this clear. I have not tried this, not having insufficient slots on my action bars for itms.
[Image: spangles_sig_3.jpg]
Reply
#4
The weapons will always be found in the appropriate bag slots. One can toggle back and forth indefinitely if the weapon bag is closed. Certain actions such as opening several bags and closing some will confuse the macro.

Do not use the macro when a vendor window is open, I accidentally sold my polearm by activating the toggle while repairing things.

There is space in the macro to add

/cast Berserker Rage

which generates error messages but has the intended effect. This is a useful alternative to Impact, the Berserker equivalent of Charge, for generating rage.

I can Charge things easily in Battle stance but Impact seems more difficult to use. The interval between Too Close and Too Far Away seems smaller making it hard to use in group melee. One can use it stalking solo tho.
[Image: spangles_sig_3.jpg]
Reply
#5
Ynir,Jan 4 2005, 02:33 PM Wrote:The syntax for using an itm on an action bar from a macro is given in an example I found as

/script UseAction(ActionID, x, y);

"Itm must be placed in the action bar at the slot given by ActionID. ActionID is a number from 1 to 120. Slot1-ActionBar1 is ActionID1, Slot12 is ActionID12, Slot1-ActionBar2 is ActionID13 and so on up to Slot12 of ActionBar10. "

Presumably x is the slot number and y is the bar number, but the example does not make this clear.&nbsp; I have not tried this, not having insufficient slots on my action bars for itms.
[right][snapback]64341[/snapback][/right]

Huh, I have lots of spots on the 12 action bars--my inventory will fill up first (plus I reorganize it). If x and y refer to a bar and slot, that is redundant with the ActionID, so this bears some experimentation.

Now that I am running WoW under Linux and have the tools I want to start playing with customization, perhaps I'll start with a few simple in-game macros like the above before writing any lua.

Thanks for the response and further tip!
Reply
#6
vor_lord,Jan 4 2005, 04:04 PM Wrote:Huh, I have lots of spots on the 12 action bars--my inventory will fill up first (plus I reorganize it).&nbsp; If x and y refer to a bar and slot, that is redundant with the ActionID, so this bears some experimentation.

Now that I am running WoW under Linux and have the tools I want to start playing with customization, perhaps I'll start with a few simple in-game macros like the above before writing any lua.

Thanks for the response and further tip!
[right][snapback]64353[/snapback][/right]

I played around for a few minutes, and the syntax seems to be:

UseAction(ActionID, [checkCursor])

I couldn't seem to figure out a rational ordering with the numbers in general for ActionID (it didn't seem to match the description above, with consecutive numbers not being on the same toolbar) but as a Cosmos user the last numbers (from 120 down) are the sidebars.

Next time I'm on I'll fully implement your macro (with the logic for what to switch).
Reply
#7
vor_lord,Jan 5 2005, 03:18 PM Wrote:I played around for a few minutes, and the syntax seems to be:

UseAction(ActionID, [checkCursor])

I couldn't seem to figure out a rational ordering with the numbers in general for ActionID (it didn't seem to match the description above, with consecutive numbers not being on the same toolbar) but as a Cosmos user the last numbers (from 120 down) are the sidebars.

Next time I'm on I'll fully implement your macro (with the logic for what to switch).
[right][snapback]64421[/snapback][/right]


I thought that the usage for the function I posted

UseAction(ActionID, x, y)

would be

x, y = bar, slot (or vice versa)

and ActionID was the returned parameter. I could not find this function in the Lua list in this form, however.

[Image: spangles_sig_3.jpg]
Reply
#8
Ynir,Jan 5 2005, 09:04 AM Wrote:I thought that the usage for the function I posted

UseAction(ActionID, x, y)

would be

x, y&nbsp; = bar, slot&nbsp; (or vice versa)

and ActionID was the returned parameter.&nbsp; I could not find this function in the Lua list in this form, however.
[right][snapback]64427[/snapback][/right]

It doesn't appear so. There is a single integer (the ActionID) which identifies which bar and slot, just as the text you posted indicates. There are 10 bars, each with 12 slots, meaning your parameter needs to be between 1 and 120.

I am reporting what the game indicated back to me--you get a script error if you pass three parameters and it gives you the expected usage of the function.

One caveat--I understand that is easy to override functions in Lua. As I use Cosmos, they may have overridden this one and changed its form--hence the discrepancy.


One more tidbit: I stumbled upon this bit of info from WoWWiki:

Code:
If you are using Cosmos, you can use the following commands :

/equip <Item Name>
/unequip <Item Name>
/saveset <Number>
/loadset <Number>

I haven't played with this yet, but /saveset and /loadset looks to be of general use for
this kind of thing and might be a better way for me to go about switching between my
defensive and offensive setups.

I'm hoping what is saved is a set of equipped items.
Reply
#9
[quote=Ynir,Jan 4 2005, 09:41 PM]
The weapons will always be found in the appropriate bag slots. One can toggle back and forth indefinitely if the weapon bag is closed. Certain actions such as opening several bags and closing some will confuse the macro.

Another activity that will confuse the macro is to switch at exactly the same time that yo u take a hit. This will put the switched-out weapon in an arbitrary place in one of the bags. Switch out of phase with taking hits, and all is well.
[Image: spangles_sig_3.jpg]
Reply
#10
Well with one more addition I will be able to write a perfect macro for my current situation (which is simply two setups).

The problem is that I want to leverage some / commands using a conditional in a lua script. Basically (not syntax checked, not able to check now):

Code:
/script if GetInventoryItem(17) /saveset 2; /loadset 1; else /saveset 1; /loadset 2; end

This keeps my saved sets up to date automatically (as I add different equipment). The boolean nature of it however doesn't allow for more than 2 setups on the same toggle.

I just need to find out what lua functions are called by /saveset and /loadset.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)