swap.mac -- Complete Auto-Inven Mover Utility. Version 2.5.5

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

swap.mac -- Complete Auto-Inven Mover Utility. Version 2.5.5

Post by Preocts » Mon May 10, 2004 2:57 pm

fuck it
Last edited by Preocts on Tue Jun 01, 2004 3:44 pm, edited 7 times in total.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Ini Example

Post by Preocts » Mon May 10, 2004 2:59 pm

Here is a short example of what part of my ini looks like.
This is only an example and will not work for you. You must write your own commands

Code: Select all

[SwapCommands]
NormNeck=ifin?Qeynos Badge of Honor:Neck?-1?pickup:neck/pickup:Qeynos Badge of Honor/Empty?
FightNeck=ifin?Broken Shore Shell Necklace:Neck?-1?pickup:neck/pickup:Broken Shore Shell Necklace/Empty?
NormMain=ifin?Foraging Machette:MainHand?-1?pickup:MainHand/pickup:Foraging Machette/Empty?
FightMain=ifin?Scimitar of the Emerald Dawn:MainHand?-1?pickup:MainHand/pickup:Scimitar of the Emerald Dawn/Empty?
NormOff=ifin?Grandmaster Baker's Spoon:OffHand?-1?pickup:OffHand/pickup:Grandmaster Baker's Spoon/Empty?
FightOff=ifin?Tactician's Bulwark:OffHand?-1?pickup:OffHand/pickup:Tactician's Bulwark/Empty?
Armswitch=swap:Elder Spiritist's Vambraces=Elysian Armplates

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Mon May 10, 2004 3:29 pm

Nice TFM. Very detailed and easy to follow.
/macro resistanceisfutile
/em cackles maniacally in full resist gear
/em has been slain by random_ae_mob

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon May 10, 2004 3:42 pm

Schweet! :o

Can't wait to test this baby out on my Bard :D

(I got the Qeynos Badge of Honor as well :roll: which reminds me, I need to get some friends to help me finsh that quest)

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon May 10, 2004 3:46 pm

Question: Swapper.ini goes in macros folder as well, correct?

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon May 10, 2004 3:52 pm

Yes. Swapper.ini is not required to run. The macro accepts a parameter command line as well as INI sets. All that is explained in the preface :)

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon May 10, 2004 4:05 pm

I just meant if I wanted to setup an INI file ahead of time, is that where it would go, in the same place as the .mac file?

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon May 10, 2004 5:23 pm

Again Yes. :wink:

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Tue May 11, 2004 12:24 am

Works wonderfully! :arrow: 8)

I put on my thinking cap for this one.
IfIn?Orcish Lute of Singing:offhand?swap:offhand=pack5/swap:mainhand=pack1?swap:mainhand=pack1/swap:offhand=pack5?

Since my string instrument can only be equiped along. Made it into a simple hot key, and it's GREAT for switching between my drum/weapon, or using my guitar for DoTs :)

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue May 11, 2004 8:56 am

Yay, you have no idea how neat it is seeming someone else writing a commandset for the macro I wrote.
Now only two things really remain to be done. The first is pulling the four current places in the macro that actually pass commands to handlecomand and making them into one sub. This will allow INI sets to be called from within INI sets and IFs. And it will allow nested IFs. 8)
Then, and this shall be my summer project, all that will remain is to make this a plugin.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Sat May 15, 2004 9:39 am

Blah, still no nested IFs but much improved handling of parsing. Also removed most the globals and made the subs more 'indepentant'. This will let you just pull what you want out of my macro and use it in includes or your own macs. :wink:
I wrote this to see if I could... I dont expect people to actually want to use the whole damn thing just to rightclick an earpiece.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Neato!

Post by Vexix » Wed May 19, 2004 9:14 am

Awesome macro, Preocts. Nicely done.

Any chance this could be expand this to support bank slots, as well? I spend a fair amount of time in the bazaar, and I would love to be able to swap all my shopping clothes with my battle clothes, as well as putting my trader's satchels back in the bank and depositing my plat so I don't weight 300 lbs. and get stopped dead as soon as I leave the zone!

You mentioned not to use |s in the if statements, but to use / instead? Does that mean you can use // as an or statement in an if, and it will parse correctly?

--Vexix

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Wed May 19, 2004 5:21 pm

Any chance this could be expand this to support bank slots, as well?
I'll look into writing three more core subs that handle slots inside your bank or bigbank window.
You mentioned not to use |s in the if statements, but to use / instead? Does that mean you can use // as an or statement in an if, and it will parse correctly?
No. Don't get confused when I talk about my macro 'parsing' the command line. It isn't using MQ2's parser. The macro simply takes the command line it's given and breaks it down into separate commands via the String.Arg function. The | indicates the end of one command and the begining of the next.
There is no current way to have AND or OR operaters in the if statements.

The different between using |s and /s was simply to allow the String.Arg[] function to properly return the entire IF statement when parsed.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Thu May 20, 2004 12:18 pm

Okay, so here is the deal with bank slots and other slots. I wasn't thinking straight yesterday and didn't even concider this before jumping to the conclution that I'd have to write some more subs.

Code: Select all

#define AddSlotArray(name,count,start)	\
	for (i = 0 ; i < count ; i++)\
	{\
	sprintf(szOut,#name"%d",i+1);\
		ItemSlotMap[szOut]=start+i;\
	}
        [color=yellow]
	AddSlotArray(bank,16,2000);
	AddSlotArray(sharedbank,2,2500);
	AddSlotArray(trade,8,3000);
	AddSlotArray(world,10,4000);
	AddSlotArray(enviro,10,4000);
	AddSlotArray(loot,31,5000);
	AddSlotArray(merchant,80,6000);
	AddSlotArray(bazaar,80,7000);
	AddSlotArray(inspect,31,8000);
        [/color]
#undef AddSlotArray
Directly cut from MQ2 source.

So, just as Pack1!6 would work on Pack1, slot 6 of your main inventory, Bank4!9 will open the bag in bank slot 4 and hit slot 9 in that bag. These will also work as valid slot names, just like arms, neck, pack1, ect.

Moveto:back>Bank2 - will place the item on your back into your bank inventory slot #2

So I guess, in the end, the add these to the valid slot names list:
All of these will work with Pickup/Swap/Moveto/Clicky, though the latter might not do anything.
All of these should also work as CustomSlots. i.e sharedbank2!5.

Code: Select all

  bank1-16
  Sharedbank1-2
  trade1-8
  world1-10
  enviro1-10
  loot1-31
  merchant1-80
  bazaar1-80
  inspect1-31
Guess I just underestimated the way I wrote this macro. A quick change and it will even scan your bank, if open, for item names. There might be a few problems with SharedBank slots and I haven't even tested it for anything else but I'm fairly certain the macro is robust enough to handle any and all valid slot names, numbers, customnames, and itemnames. :twisted:

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Post by Gabby » Thu May 20, 2004 5:41 pm

First off I gotta thank ya Preocts!
You have made some really great macros and also helped me by answering (probably really bonehead) questions reguarding certain MQ variables in other threads. Thanks a million.

I have a question for ya here. I'm haveing a hard time wrapping my head around the commands used within the mac, specificly the IfOn and IfIn commands. What Im trying to do (if its even possible) is to get one master command that checks both Mainhand and Offhand for what is on the cursor and/or slot than put it inside a bag in its appropriate slot.

I have figured out the basics for moveing from one to another so thats no biggy (love it actually)!! AKA:

Code: Select all

Pickup:Mainhand|Moveto:Singing Short Sword>offhand|Moveto:Whip of Unending Pain>mainhand|Empty
But if you could help out with the master command - or guide me in the right dirrection I would be highly greatfull !