Combine.mac

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

Moderator: MacroQuest Developers

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Combine.mac

Post by Chill » Sun May 23, 2004 10:44 am

Assuming you have bought your materials, opened the appropriate container, and highlighted the correct recipie, it will combine that recipie until you run out of materials or reach [combines] if specified. It will then tell you how many combines succeeded and how many failed out of your total attempts, with percentages for both.

I have added a few variables to allow you to:
-stop combining when an item becomes trivial
-specify if you want the success report at the end

Once I figure out how to handle tools differently from the combined items, I also am planning to add support to:
-drop items if you dont wish to keep them (i.e. unfired pottery items)
-sell items to a vendor as you combine them

I will most likely be adding paramater support for these variables in the near future as well so you dont have to edit the variables each time.

Code: Select all

| combine.mac : A Simple Combine macro
| Author      : Chill 
| Version     : v1.2 23-Feb-2007 2:00AM EST 
| Useage      : /macro combine [combines] -- have tradeskill window open with recipie highlighted.
|               /target yourself to pause the macro, target anything else (or nothing) to resume.
| Description : This macro will do the selected recipie until you run out of components or reach
                [combines], pausing whenever you are targeted, and report success/fail rates when done.

#event done "Sorry, but you don't have everything you need for this recipe in your general inventory."
#event success "You have fashioned the items together to create something new:#*#"
#event failure "You lacked the skills to fashion the items together."
#event trivial "You can no longer advance your skill from making this item."
#event skillup "You have become better at#*#"

Sub Main(int max)

/declare triv int outer 0
/declare stats int outer 1
/declare dropit int outer 0
/declare sellit int outer 0
/declare skills int outer 0
/declare wins int outer 0
/declare fails int outer 0
/declare total int outer 0
/declare rate float outer 0

/doevents flush

   :Loop
   /if (${Target.ID}==${Me.ID}) {
     /delay 60m ${Target.ID}!=${Me.ID}
   }
   /if (${Cursor.ID}) {
      /if (${dropit}) /drop
      /autoinventory
      /goto :Loop
   }
   /if (${Defined[max]} && ${total} >= ${max}) /call Event_done
   /nomodkey /notify TradeskillWnd CombineButton leftmouseup 
   /delay 2s ${Cursor.ID}
   /doevents
   /doevents trivial
   /goto :Loop
/return

Sub ShowRate
   /varcalc rate 100*${wins}/${total}
   /echo (${wins}) of (${total}) combines succeeded (${rate}%).
   /if (${fails}) {
      /varcalc rate 100*${fails}/${total}
      /echo (${fails}) of (${total}) combines failed (${rate}%).
   }
/return

Sub Event_trivial
   /if (${triv}) /call Event_done
/return

Sub Event_done
   /if (${stats}) /call ShowRate
   /endmacro
/return

Sub Event_success
   /varcalc wins ${wins}+1
   /varcalc total ${total}+1
/return

Sub Event_failure
   /varcalc fails ${fails}+1
   /varcalc total ${total}+1
   /delay 5s
/return

Sub Event_skillup
   /varcalc skills ${skills}+1
/return
Last edited by Chill on Fri Feb 23, 2007 3:35 am, edited 10 times in total.

topgun
a lesser mummy
a lesser mummy
Posts: 43
Joined: Thu Jan 09, 2003 8:27 am

Post by topgun » Mon May 24, 2004 9:38 am

Could you add the Target Self Pause thingie ???

That is, when your target is yourself, the maro pauses ?

Else this is also excactly what i need in a TS macro :)

eqaussie
a ghoul
a ghoul
Posts: 124
Joined: Tue Mar 16, 2004 5:58 am

Post by eqaussie » Mon May 24, 2004 7:55 pm

Could you add a paramater for attempts?

ie /macro combine 20 just tries combines 20 times.

Would be handy for when combines share components.

Otherwise, its working nicely for me

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Mon May 24, 2004 8:24 pm

Could you add a parameter for attempts?
This should work, add these into the macro. Place the :Loop in the macro between the /for and /if and the /var to the /fo at the top below Sub main

Code: Select all

/varset Attempt  int
/varset NumAttempts ${Param0}

/if (!${Defined[Param0]}) { 
   /varset Attempt 1 
   /echo Useage: /mac combine <# of Attempts> 
   /echo Using default combine attempt of ${NumAttempts} 
} 
.
.
.
/for Attempt 1 to ${NumAttempts}
   :Loop
   .
   .
   .
   /if (${Attempt}==${NumAttempts}) /endmacro
   }
/next
Bob

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Tue May 25, 2004 4:14 pm

May 25, 2004
-Added an optional parameter to end the macro after the specified number of [combines] is reached.
-Added the self-target pause feature.
-Added an extra line to the results Sub to failure stats, if any combines failed.

Only other thing I kinda wanted to add was the name of the recipie that I was doing, and echo that in the results (for later cost tracking). If I can figure out how to capture that from the tradeskill window or someplace, then I will change:

Code: Select all

/echo (${wins}) of (${total}) combines succeeded (${rate}%).
to

Code: Select all

/echo (${wins}) of (${total}) ${recipie} attempts succeeded (${rate}%).
Anyone know how to get the name of the Recipie I have highlighted or just clicked?

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Fri Jul 09, 2004 7:12 am

9 July 2004
-changed ;&gt crap back to < signs

Closer to finding the recipie name...

Code: Select all

${Window[TradeSkillWnd].Child[RecipeList].List[n]}
Gives strings with recipe names, but I still cant figure out how to get the number of the highlighted recipe to put in there.

Anyone have any suggestions on this? thanks.

nightvcd
decaying skeleton
decaying skeleton
Posts: 3
Joined: Mon May 09, 2005 8:52 pm

Post by nightvcd » Mon Apr 03, 2006 8:54 pm

this macro no longer works.. it was great cause it was so simple.

when you run it now it auto ends even though you have all the components and are standing in first person at the tradeskill device with your recipe selected and I didn't have myself on target.

wish I had the time and know how to learn how to make these myself but I don't. so any help would be great.

newgamez88
orc pawn
orc pawn
Posts: 27
Joined: Thu Mar 09, 2006 12:01 pm

Post by newgamez88 » Mon Apr 03, 2006 11:20 pm

Try this: change

Code: Select all

       /notify COMBW_CombineArea CombineButton leftmouseup
to

Code: Select all

      /notify TradeskillWnd CombineButton leftmouseup 

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

Post by eqsolro » Tue Apr 04, 2006 7:24 pm

To stop when Selftarget was

Code: Select all

/if (${Target.ID}) /mqpause
helpfull ... but maybe someone has a better one ...
-----------------------------------
LAX and Devs for government
-----------------------------------

Dont tell my husband, that i use his mailadress.
Dont tell my husband, that i play EverQuest.
Dont tell my husband, that i use MacroQuest2.
Dont tell my husband, that i donated for MQ2.
Dont tell my husband, that i bought a new PC.
Dont tell my husband, that i payed a Menstripper. ( you never seen 6 middladys crying? i was 1 :) ... )

An dont tell my husband, that i used his fucking CreditCard for all above :)

cheers ...

*** And her Husband now that all :) ***
We are back after 5 Years of NO EQ :)

Dbick
orc pawn
orc pawn
Posts: 19
Joined: Thu Sep 01, 2005 7:59 pm

Post by Dbick » Tue Apr 04, 2006 9:09 pm

This one worked for me today 4-4-2006

Code: Select all

#event OutOfStuff "Sorry, but you don't have everything you need for this recipe in your general inventory." 
  
Sub Main 
:Loop 
 
:ClearCursor 
/if (${Cursor.ID}) { 
/autoinventory 
/goto :ClearCursor 
} 
 
/notify TradeskillWnd CombineButton leftmouseup 
/doevents 
/delay 2
/notify TradeskillWnd AutoInvButton leftmouseup
/goto :Loop 
/return 
 
Sub Event_OutOfStuff 
/endmacro 
/return

armysoldier
a hill giant
a hill giant
Posts: 189
Joined: Mon Jun 27, 2005 2:13 am
Location: Florida (Stationed at FT Carson CO)

Post by armysoldier » Wed Apr 05, 2006 9:28 am

there is another posted in the NEW TS macro thread also

army

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

updated

Post by Chill » Fri Feb 23, 2007 1:56 am

I updated this a while back, just forgot to post the update.

I've added a few more variables and events. I will be adding some paramaters eventually to make it more flexible for different uses (i.e. skilling up vs making trivial combines.

aamlord
a lesser mummy
a lesser mummy
Posts: 35
Joined: Wed Feb 07, 2007 3:56 pm

Post by aamlord » Fri Jul 27, 2007 5:41 am

I'd like to add a post. I use this a lot mainly for huge combine run like making 2,000 celestial essence. Without the script, I'd have carpal tunnel syndrome long ago.

However once in a while I get the wrong recipe selected when I run the script and I got tired of divide by zero error so I revised my copy to include an extra if statement:

Code: Select all


Sub Event_done
   /if (${total}) {
      /if (${stats}) /call ShowRate
   } else {
      /echo You had no combines made!  Maybe you have the wrong recipe selected or didn't have everything?
      }
   /endmacro
/return
Now spits out a message if you have the wrong recipe selected or missing something and did zero combine as a result. Less spam this way than divide by zero error message.

EDIT: used quote tag instead of code tag... bleh

vladd
a ghoul
a ghoul
Posts: 122
Joined: Mon Oct 10, 2005 3:27 pm
Contact:

Post by vladd » Tue Jun 24, 2008 12:37 am

Anyone able to tell me if this macro still works with all the changes to MQ?

User avatar
MQWatcher
a ghoul
a ghoul
Posts: 113
Joined: Sun Jan 21, 2007 8:22 am

Post by MQWatcher » Tue Jun 24, 2008 8:50 am

not sure if this one does but I know the one from the VIP trade skill post does.