Question

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Question

Post by Amadeus » Wed Jul 10, 2002 7:15 pm

What would be the routine, in a macro, to:
- pick up an item that's in your inventory
- equip. it (replace what you already have in that equip. slot)
- put the item you replaced in your inventory.


For example, I want to write a macro that will automatically "wear" my charisma gear :)

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Wed Jul 10, 2002 7:22 pm

Salutations,

Code: Select all

| - Equip.mac
| syntax:
|   /macro equip.mac slot piece

sub main
  /click left equip $p0
  /finditem similar $p1
  /click left equip $p0
/return

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Wed Jul 10, 2002 8:07 pm

By slot, you mean these, correct?

Code: Select all

	CHAR *szInvSlot[] = {
		NULL,       "ear1",   "neck",    "face",      "head",   "ear2",
		"finger1",  "wrist1", "arms",    "hands",     "wrist2", "finger2",
		"shoulder", "chest",  "back",    "waist",     "legs",   "feet",
		NULL,       NULL,     "primary", "secondary", "ranged", "ammo"
	};
...or, is there another list of 'slot' terms in the code?


Also....don't you have to "/click left auto" after you pick up the piece of equipment from what you're wearing? Or, does MacroQuest do that for you when you're holding something and pick up something else?
Last edited by Amadeus on Wed Jul 10, 2002 8:09 pm, edited 1 time in total.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Wed Jul 10, 2002 8:08 pm

Salutations,
yes, they are also listed in the readme...

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Wed Jul 10, 2002 9:55 pm

Better (working) code chunk...

Code: Select all

| Equip.mac
| /macro Equip <slot> <item>
| ie. /macro Equip arms "Gatorscale Sleeves"
Sub Main
   /finditem $p1
   /click left equip $p0
   /if $cursor()==TRUE /click left auto
/return
- Plazmic