combine.mac - General Purpose Combine Macro

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

serberus
a lesser mummy
a lesser mummy
Posts: 58
Joined: Tue Nov 19, 2002 5:04 am

combine.mac - General Purpose Combine Macro

Post by serberus » Sun Oct 12, 2003 12:01 am

This is a general purpose combine macro, the usage and features are as follows:

syntax: /macro combine <KEEP/DESTROY> <Container> <Item 1> <Item 2> <Item 3> <Item 4> <Item 5> <Item 6> <Item 7> <Item 8> <Item 9> <Item 10>
example: /macro combine keep "Pottery Wheel" "small block of clay" "water flask" "ceramic lining sketch"

By default the macro matches item names exactly, you can use the # symbol as a prefix with a wildcard effect.

example: /macro combine keep "Pottery Wheel" #clay #water #lining

The problem with the above is when an item you don't want to combine matches the search parameters, "Ceramic Lining"; "Unfired Ceramic Lining"; "Ceramic Lining Sketch" etc etc

When using "/macro combine DESTROY" it will destroy the first item that appears on your cursor after a successful combine, it will not destroy subsequent items as not to destroy any tools or misc items that appear on the cursor on certain combines, you can change the number of items that are destroyed after a successful combine by adding in another "/if n "@COMBINE_Destroy"=="1" /click left destroy " under the "Event_COMBINE_Success" sub.

By default, the macro will stop producing items when your free space is less than 1, or less than or equal to 0, this can be changed by setting the "COMBINE_FREEINVSPACE" #define at the top of the macro to your desired number.

If you use a key to open your inventory that is NOT the "i" (I) button, then you can change that via the "COMBINE_InventoryButton" #define.

If you are having trouble getting the macro to find a specific combiner, find the name of the combiner by typing "/echo $pack(x,combine)" where x is the the number 0 - 7 based on the packs location in your inventory.

You can get help on how to use it by calling the macro without any parameters... "/macro combine"

Features:
-Easy Integration with Other Macros (all combine.mac variables/subroutines prefixed COMBINE_).
-Supports 10 item combines in inventory and enviromental containers .
-Uses /doevents - doesn't have any /delay commands, runs as quickly as it can, should not be effected by lag.
-Option to automatically destroy the items you create.
-Will stop producing if you run out of free inventory space.
-Exact/Wildcard item name matching:
#meat - will match any item in your inventory that has "meat" in it's title
"bear meat" - will only pick up "bear meat"

This macro will not function properly if #turbo is enabled. It skips items and behaves eratically
This macro will open all your bags, inventory window and, if necessary, enviromental containers, please ensure they do not overlap.

Code: Select all

| All Purpose Combine Macro
| /macro combine KEEP/DESTROY "Combiner" "Item 1" "Item 2" "Item 3" "Item 4" "Item 5" "Item 6" "Item 7" "Item 8" "Item 9" "Item 10" 
| Example: /macro combine KEEP "Pottery Wheel" "water flask" "ceramic lining sketch" "small brick of clay"
| KEEP will put all items produced into your inventory, DESTROY will destroy the first item produced on a successful combine.
| By default the combine mac works with exact item names, you can use similar item names by prefixing the name with a #
| Example: /macro combine KEEP "Pottery Wheel" #water #ceramic #clay
|
| Using #turbo with this macro seems to break it.
| This macro will open all your bags, inventory window and an enviromental combiner if necessary, it's important they don't overlap.

#event COMBINE_AlternateProduct "You have fashioned the items together to create an alternate product."
#event COMBINE_LackedSkills "You lacked the skills to fashion the items together."
#event COMBINE_Success "You have fashioned the items together to create something new!"
#event COMBINE_Skillup "You have become better at"
#event COMBINE_Trivial "You can no longer advance your skill from making this item."
#event COMBINE_DNC "You cannot combine these items in this container type!"
#define COMBINE_InventoryButton i
#define COMBINE_FREEINVSPACE 1

Sub Main

/if "@Param0"!="DESTROY" /if "@Param0"!="KEEP" /call COMBINE_Syntax

/cleanup

/declare COMBINE_CombinerLoc global
/declare COMBINE_CombinerInvEnv global
/declare COMBINE_Combined global
/declare COMBINE_AlternateProductTotal global
/declare COMBINE_LackedSkillsTotal global
/declare COMBINE_SuccessTotal global
/declare COMBINE_CombinesTotal global
/declare COMBINE_TrivialTotal global
/declare COMBINE_SkillupTotal global
/declare COMBINE_Destroy global
/varset COMBINE_AlternateProductTotal 0
/varset COMBINE_LackedSkillsTotal 0
/varset COMBINE_SuccessTotal 0
/varset COMBINE_TrivialTotal 0
/varset COMBINE_SkillupTotal 0
/varset COMBINE_CombinesTotal 0
/varset COMBINE_Combined 0
/call COMBINE_FindCombiner "@Param1"
/if n @COMBINE_CombinerLoc<=7 /call COMBINE_OpenInv
/if n @COMBINE_CombinerLoc==8 /call COMBINE_OpenEnv
/if n @COMBINE_CombinerLoc==99 {
				/echo "Cannot find container-aborting"
				/endmacro
				}
/call COMBINE_OpenPacks

/if "@Param0"=="DESTROY" {
	/echo DESTROYING FIRST ITEM FROM A SUCCESSFUL COMBINE!!!
	/varset COMBINE_Destroy 1
	}

/if "@Param0"=="KEEP" /varset COMBINE_Destroy 0

:COMBINE_MakeItem
/sendkey down ctrl
/if "$cursor()"=="TRUE" /goto :COMBINE_ClearCursor

/if "@Param2"~~# {
	/finditem similar "$right($calc($strlen("@Param2")-1),"@Param2")"
	/goto :COMBINE_Continue
	}
	/finditem "@Param2"
	:COMBINE_Continue
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 0

/if "@Param3"~~"Param3" /goto :COMBINE_Combine
/if "@Param3"~~# {
	/finditem similar "$right($calc($strlen("@Param3")-1),"@Param3")"
	/goto :COMBINE_Continue2
	}
	/finditem "@Param3"
	:COMBINE_Continue2
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 1

/if "@Param4"~~"Param4" /goto :COMBINE_Combine
/if "@Param4"~~# {
	/finditem similar "$right($calc($strlen("@Param4")-1),"@Param4")"
	/goto :COMBINE_Continue3
	}
	/finditem "@Param4"
	:COMBINE_Continue3
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 2

/if "@Param5"~~"Param5" /goto :COMBINE_Combine
/if "@Param5"~~# {
	/finditem similar "$right($calc($strlen("@Param5")-1),"@Param5")"
	/goto :COMBINE_Continue4
	}
	/finditem "@Param5"
	:COMBINE_Continue4
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 3

/if "@Param6"~~"Param6" /goto :COMBINE_Combine
/if "@Param6"~~# {
	/finditem similar "$right($calc($strlen("@Param6")-1),"@Param6")"
	/goto :COMBINE_Continue5
	}
	/finditem "@Param6"
	:COMBINE_Continue5
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 4

/if "@Param7"~~"Param7" /goto :COMBINE_Combine
/if "@Param7"~~# {
	/finditem similar "$right($calc($strlen("@Param7")-1),"@Param7")"
	/goto :COMBINE_Continue6
	}
	/finditem "@Param7"
	:COMBINE_Continue6
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 5

/if "@Param8"~~"Param8" /goto :COMBINE_Combine
/if "@Param8"~~# {
	/finditem similar "$right($calc($strlen("@Param8")-1),"@Param8")"
	/goto :COMBINE_Continue7
	}
	/finditem "@Param8"
	:COMBINE_Continue7
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 6

/if "@Param9"~~"Param9" /goto :COMBINE_Combine
/if "@Param9"~~# {
	/finditem similar "$right($calc($strlen("@Param9")-1),"@Param9")"
	/goto :COMBINE_Continue8
	}
	/finditem "@Param9"
	:COMBINE_Continue8
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 7

/if "@Param10"~~"Param10" /goto :COMBINE_Combine
/if "@Param10"~~# {
	/finditem similar "$right($calc($strlen("@Param10")-1),"@Param10")"
	/goto :COMBINE_Continue9
	}
	/finditem "@Param10"
	:COMBINE_Continue9
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 8

/if "@Param11"~~"Param11" /goto :COMBINE_Combine
/if "@Param11"~~# {
	/finditem similar "$right($calc($strlen("@Param11")-1),"@Param11")"
	/goto :COMBINE_Continue10
	}
	/finditem "@Param11"
	:COMBINE_Continue10
	/if "$find()"=="FALSE" /goto :COMBINE_Done
	/click left @COMBINE_CombinerInvEnv 9

	:COMBINE_Combine
	/sendkey up ctrl

	:COMBINE_WaitCombine
	/click left @COMBINE_CombinerInvEnv combine
	/doevents
	/if n @COMBINE_Combined==1 /goto :COMBINE_ClearCursor
	/goto :COMBINE_WaitCombine

	:COMBINE_ClearCursor
	/if n $freeinv(space)<COMBINE_FREEINVSPACE /if n $freeinv(space)<=0 /call COMBINE_OutofSpace
	/varset COMBINE_Combined 0
	/click left auto
	/if "$cursor()"=="TRUE" /goto :COMBINE_ClearCursor

/goto :COMBINE_MakeItem

:COMBINE_Done
/call COMBINE_Finish

/return

Sub COMBINE_OpenInv
	/varset COMBINE_CombinerInvEnv "pack @COMBINE_CombinerLoc"
	/cleanup
	/if "$invpanel"=="FALSE" /press COMBINE_InventoryButton
	/click right inv @COMBINE_CombinerLoc
	/if $pack(@COMBINE_CombinerLoc,empty)==FALSE /call COMBINE_CleanPack
/return

Sub COMBINE_OpenEnv
	/cleanup
	/varset COMBINE_CombinerLoc e
	/varset COMBINE_CombinerInvEnv enviro
	/face item

	:COMBINE_WaitOpen
	/click left item
	/if $pack(@COMBINE_CombinerLoc,open)==NULL /goto :COMBINE_WaitOpen
	/if $pack(@COMBINE_CombinerLoc,empty)==FALSE /call COMBINE_CleanPack
/return

Sub COMBINE_OpenPacks
	/declare COMBINE_OpenPacksLoop local
	/if "$invpanel"=="FALSE" /press COMBINE_InventoryButton
	/for COMBINE_OpenPacksLoop 0 to 7
		/if "$pack(@COMBINE_OpenPacksLoop,open)"=="FALSE" /click right inv @COMBINE_OpenPacksLoop
	/next COMBINE_OpenPacksLoop

/return

Sub COMBINE_CleanPack
	/declare COMBINE_CleanPackCombinerSlots local
	/declare COMBINE_CleanPackLoop local
	/varcalc COMBINE_CleanPackCombinerSlots $pack(@COMBINE_CombinerLoc,slots)-1

	/sendkey down shift

	/for COMBINE_CleanPackLoop 0 to @COMBINE_CleanPackCombinerSlots
	/click left @COMBINE_CombinerInvEnv @COMBINE_CleanPackLoop
	/click left auto
	/next COMBINE_CleanPackLoop

	/sendkey up shift

	/if "$pack(@COMBINE_CombinerLoc,empty)"=="TRUE" /goto :COMBINE_PackClean
		/echo Cannot empty combiner, free up some inventory space. Ending Macro.
		/call COMBINE_Finish
		/return

	:COMBINE_PackClean
/return

Sub COMBINE_OutOfSpace
	/echo Out of inventory space, please make space. Macro Ending
	/call COMBINE_Finish
	/return

Sub COMBINE_FindCombiner
	/declare COMBINE_FindCombinerSearchLoop local
	/varset COMBINE_CombinerLoc 99
	/for COMBINE_FindCombinerSearchLoop 0 to 7
		/if "$pack(@COMBINE_FindCombinerSearchLoop,combine)"=="@Param0" /varset COMBINE_CombinerLoc @COMBINE_FindCombinerSearchLoop
	/next COMBINE_FindCombinerSearchLoop

	/if n @COMBINE_CombinerLoc==99 {
					/itemtarget @Param0
					/if "$GETLASTERROR"=="ITEM_NOTFOUND" {
						/echo Enviromental combiner not found. Ending macro.
						/cleanup
						/endmacro
						}
					/if n $distance(item)<=15 /varset COMBINE_CombinerLoc 8
					}
/return @FIND_CombinerSlot

Sub COMBINE_Finish
	/sendkey up ctrl
	/call COMBINE_CleanPack
	/cleanup

	/echo Alternate Products: $int(@COMBINE_AlternateProductTotal) $int($calc(@COMBINE_AlternateProductTotal/@COMBINE_CombinesTotal*100))%
	/echo Failures: $int(@COMBINE_LackedSkillsTotal) $int($calc(@COMBINE_LackedSkillsTotal/@COMBINE_CombinesTotal*100))%
	/echo Success: $int(@COMBINE_SuccessTotal) $int($calc(@COMBINE_SuccessTotal/@COMBINE_CombinesTotal*100))%
	/echo Trivial: $int(@COMBINE_TrivialTotal) $int($calc(@COMBINE_TrivialTotal/@COMBINE_CombinesTotal*100))%
	/echo Skillup: $int(@COMBINE_SkillupTotal) $int($calc(@COMBINE_SkillupTotal/@COMBINE_CombinesTotal*100))%
	/echo Non-Trivial: $int($calc(@COMBINE_CombinesTotal-@COMBINE_TrivialTotal-@COMBINE_LackedSkillsTotal)) $int($calc($calc(@COMBINE_CombinesTotal-@COMBINE_TrivialTotal)/@COMBINE_CombinesTotal*100))%
	/echo Total Combines: $int(@COMBINE_CombinesTotal)
/endmacro

Sub Event_COMBINE_AlternateProduct
	/varset COMBINE_Combined 1
	/varcalc COMBINE_AlternateProductTotal @COMBINE_AlternateProductTotal+1
	/varcalc COMBINE_CombinesTotal @COMBINE_CombinesTotal+1
/return

Sub Event_COMBINE_LackedSkills
	/varset COMBINE_Combined 1
	/varcalc COMBINE_LackedSkillsTotal @COMBINE_LackedSkillsTotal+1
	/varcalc COMBINE_CombinesTotal @COMBINE_CombinesTotal+1
/return

Sub Event_COMBINE_Success
	:COMBINE_SuccessCursorWait
		/if $cursor()==NULL /goto :COMBINE_SuccessCursorWait

	/varset COMBINE_Combined 1
	/varcalc COMBINE_SuccessTotal @COMBINE_SuccessTotal+1
	/varcalc COMBINE_CombinesTotal @COMBINE_CombinesTotal+1

	/if n "@COMBINE_Destroy"=="1" /click left destroy
/return

Sub Event_COMBINE_Trivial
	/varcalc COMBINE_TrivialTotal @COMBINE_TrivialTotal+1
/return

Sub Event_COMBINE_Skillup
	/varcalc COMBINE_SkillupTotal @COMBINE_SkillupTotal+1
/return

Sub COMBINE_Syntax
/echo Error in macro parameters. Ending macro.
/echo /macro combine KEEP/DESTROY "Combiner" "Item 1" "Item 2" "Item 3" "Item 4" "Item 5" "Item 6" "Item 7" "Item 8" "Item 9" "Item 10" 
/echo Example: /macro combine KEEP "Pottery Wheel" "water flask" "ceramic lining sketch" "small brick of clay"
/echo KEEP will put all items produced into your inventory, DESTROY will destroy the first item produced on a successful combine.
/echo By default the combine mac works with exact item names, you can use similar item names by prefixing the name with a #
/echo Example: /macro combine KEEP "Pottery Wheel" #water #ceramic #clay
/endmacro

Sub Event_COMBINE_DNC
/echo That recipe appears to be invalid, please check and try again.
/call COMBINE_Finish
/return
Last edited by serberus on Mon Oct 13, 2003 12:00 pm, edited 3 times in total.

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

Post by Amadeus » Sun Oct 12, 2003 3:03 am

Does this work with any UI ..or does it require the default?

|| Napolion ||
a ghoul
a ghoul
Posts: 96
Joined: Sat Dec 28, 2002 7:45 am

Post by || Napolion || » Sun Oct 12, 2003 6:42 am

I have been running a non stardard UI and it looks like it works just fine.

Bio_War
a lesser mummy
a lesser mummy
Posts: 36
Joined: Sun Sep 29, 2002 1:03 pm

non enviromental combine containers

Post by Bio_War » Sun Oct 12, 2003 1:19 pm

tryin to use it with a medicine bag for doing potions, says it can not find medicine bag, and ends looking for an enviromental container

Thanks
Bio

bakkal
decaying skeleton
decaying skeleton
Posts: 4
Joined: Thu Sep 11, 2003 4:28 am

Post by bakkal » Sun Oct 12, 2003 2:27 pm

cant get this working, can you send a link to the UI that you are using that is working with this?

-ty

serberus
a lesser mummy
a lesser mummy
Posts: 58
Joined: Tue Nov 19, 2002 5:04 am

Standard UI

Post by serberus » Sun Oct 12, 2003 2:31 pm

i'm using the default interface, what exactly isn't it doing? What bag name are you using for the medicine bag Bio_War????

Serberus

serberus
a lesser mummy
a lesser mummy
Posts: 58
Joined: Tue Nov 19, 2002 5:04 am

Updated

Post by serberus » Sun Oct 12, 2003 2:51 pm

ok, i've changed it so it should be working now, you need to call a medicine bag "Medicine"..

you can find out the name you need to use for a container by typing "/echo $pack(0,combine)" when it's put in your first inventory slot, just change 0 for 0-7 depending on slot.

Serberus

Tracker451
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Oct 15, 2003 12:40 pm

combiners not working

Post by Tracker451 » Wed Oct 15, 2003 1:08 pm

could just be me as I am in the default NEW UI (can't seem to get the old ui to come back) but I constantly get the Enviromental containter not found message.

Tried "Make Poison" and "Tinkering"

then decided to go external and try "Tailoring" and still no dice. I'm hoping that it's just me and the new ui (default skin) and not the macro.

Yes, could just be a nooooobie problem. /sigh

Socky

Hey

Post by Socky » Sun Oct 19, 2003 12:24 am

Weird thing, this sometimes will run perfectly for lots of combines, but it seems that when the server starts to lag some the macro breaks liek I get an error saying you cant combine these items in this containter, and are you sure you wish to drop item to the ground, is there anyway to fix this?

tac8357
orc pawn
orc pawn
Posts: 25
Joined: Fri Oct 17, 2003 5:18 pm
Contact:

problem

Post by tac8357 » Tue Oct 21, 2003 12:53 am

Still cannot get it to work just want to combine 2 spider silks in a large sewing kit .

Dadsa
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Oct 22, 2003 11:26 am

Missing Items

Post by Dadsa » Wed Oct 22, 2003 11:28 am

Need some help with the "Item" defination

starting the Macro, he open the Begs and the Brew Barrel as it should but then he stop with MSG cant find "Item"

and it also looks running a bit fast is there a way to set a timer so he slowes down a bit ?


Thanks for help

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Oct 22, 2003 12:59 pm

Lag, computer speed, etc. can affect how long it takes for EQ to recognize a click after MQ executes it. I always suggest putting /delay 2 after any /click command. Of course if you are running EQ on a Cray with a T1 or better you probably don't need that :D

Try adding a global

/define ClickDelay global
/varset ClickDelay 2

Then put in /delay @ClickDelay after every /click. Adjust the varset up or down depending on your computer and connection.
MQ2: Think of it as Evolution in action.

Amerzel
decaying skeleton
decaying skeleton
Posts: 7
Joined: Mon Oct 20, 2003 6:05 am

Post by Amerzel » Fri Oct 24, 2003 2:42 am

Im having trouble having it recognize a "planar jeweller's kit", i've tried #planar and it still didn't work.

DyvimTvar
orc pawn
orc pawn
Posts: 16
Joined: Wed Oct 22, 2003 1:21 pm

Reply and request

Post by DyvimTvar » Mon Nov 03, 2003 8:17 am

All,

In response to:
Im having trouble having it recognize a "planar jeweller's kit", i've tried #planar and it still didn't work.
I didn't use a planar kit but the kit I used was called "Jeweller's Kit" which IDed as "Jewelery Making", that may help some.

Also a request, can someone brigher than me help me out with what it would take to add buying and selling to this. I am trying to raise jewlcrafting and since none of the results stack, the buying and selling is criving me bonkers. Thanks in advance.
DyvimTvar

gnome001
a ghoul
a ghoul
Posts: 109
Joined: Fri Jan 24, 2003 1:01 am

Post by gnome001 » Mon Nov 03, 2003 10:20 am

just use a sell macro.... there is one posted here in the forum.. as for buying.. its easy enough to shift click and buy stacks.. fully automated macros like that make me cringe about afk macroers...