EvenLessSpam
Active member
- Joined
- Oct 31, 2005
- RedCents
- 91¢
It's rather simple in it's use, although with a few features the really simple combine macros doesn't have. The biggest and what I think is the best feature, is actual tracking of progress, skillup rates etc.
It also have 2 simple commands/parameters which can be passed at runtime:
trivial=yes (t=y for short) will stop the macro when your current combine is trivial.
combines=# (c=#) will stop after # combines. # is ofcourse the number of combines you wish to make.
It will autoinventory all final products, if you want something deleted instead just use MQ2Cursor for that purpose.
It also have 2 simple commands/parameters which can be passed at runtime:
trivial=yes (t=y for short) will stop the macro when your current combine is trivial.
combines=# (c=#) will stop after # combines. # is ofcourse the number of combines you wish to make.
It will autoinventory all final products, if you want something deleted instead just use MQ2Cursor for that purpose.
Rich (BB code):
|**
* Combine.mac
* by EvenLessSpam
*
* Version: 1.1.0
*
*
* Changes:
* -----------------------------------------------------------------------------
* 1.0.0
* - Initial release.
*
* 1.1.0
* - Added options for ending on trivial and max number of combines
* Options are:
* trivial=yes -- Will end the macro on trivial combine. Defaults to no
* combines=20 -- Will end the macro after making 20 combines. Defaults
* to everything (till no more components for combine)
* - Added statistic tracking, will be shown when macro is completed or can be
* triggered by typing "/echo stat".
**|
#Event Missing "Sorry, but you don't have everything you need for this recipe in your general inventory."
#Event Trivial "You can no longer advance your skill from making this item."
#Event Salvage "You failed the combine, but you managed to recover #1#. It has been left in your inventory."
#Event Failure "You lacked the skills to fashion the items together."
#Event Skillup "You have become better at #1#! (#2#)"
#Event Stats "[MQ2] stat#*#"
Sub Main
/echo ${Macro.Name} started...
/declare Timeout timer local 30s
/declare EndOnTrivial bool outer false
/declare DoCombines int outer -1
/declare i int local 0
|---------------------------------------------------------------------------
| Variables used for statistics
|---------------------------------------------------------------------------
/declare Skillups int outer 0
/declare Combines int outer 0
/declare Trivials int outer 0
/declare Failures int outer 0
/declare Salvaged int outer 0
/if (${Macro.Params}) {
/declare Param string local
/for i 0 to ${Math.Calc[${Macro.Params}-1]}
/varset Param ${Param${i}}
/if (${Param.Arg[1,=].Left[1].Equal[C]} && ${Param.Arg[2,=]} > 0) {
/varset DoCombines ${Param.Arg[2,=]}
/echo Will stop after ${DoCombines} combines...
} else {
/varset DoCombines -1
}
/if (${Param.Arg[1,=].Left[1].Equal[t]}) {
/varset EndOnTrivial ${If[${Param.Arg[2,=].Left[1].Equal[y]} || ${Param.Arg[2,=].Left[1].Equal[1]} || ${Param.Arg[2,=].Left[1].Equal[t]},true,false]}
/if (${EndOnTrivial}) /echo Will stop when this items becomes trivial...
}
/next i
}
:loop
:cursor
/if (!${Timeout}) {
/echo Stopped! Reason: Timeout.
/endmacro
}
/autoinventory
/if (${Cursor.ID}) /goto :cursor
/if (${Window[TradeSkillWnd].Child[CombineButton].Enabled}) {
/varset Timeout ${Timeout.OriginalValue}
/notify TradeSkillWnd CombineButton LeftMouseUp
/varcalc Combines ${Combines} + 1
/doevents
/if (${DoCombines} > 0) {
/varcalc DoCombines ${DoCombines} - 1
/if (${DoCombines} < 1) /goto :break
}
}
/delay 5
/goto :loop
:break
/echo Stopped due to all combines completed!
/call DisplayStats
/return
Sub DisplayStats
/if (${Combines}) {
/echo You've made a total of ${Combines} combines.
/if (${Skillups}) /echo You've got a total of ${Skillups} skillups -- Skillup rate: ${Math.Calc[${Skillups}/(${Combines}/100)]}%
/if (${Trivials}) /echo You've made ${Trivials} trivial combines.
/echo You've made ${Math.Calc[${Combines}-${Failures}]} successfull combines -- Success rate: ${Math.Calc[(${Combines}-${Failures})/(${Combines}/100)]}%
/if (${Failures}) /echo You've failed the combine ${Failures} times -- Failure rate: ${Math.Calc[${Failures}/(${Combines}/100)]}%
/if (${Salvaged}) /echo You've salvaged ${Salvaged} items -- Salvage rate: ${Math.Calc[${Salvaged}/(${Failures}/100)]}%
}
/if (${DoCombines} > 0) /echo You will stop after another ${DoCombines} combines.
/return
Sub Event_Stats
/call DisplayStats
/return
Sub Event_Missing
/echo Stopped due to missing components!
/call DisplayStats
/endmacro
/return
Sub Event_Skillup(string Line, string Tradeskill, int Skilllevel)
/varcalc Skillups ${Skillups} + 1
/echo You have become better at ${Tradeskill} (${Skilllevel}) (${Skillups} skillups since start)
/return
Sub Event_Salvage(string Line, string ItemName)
/varcalc Salvaged ${Salvaged} + 1
/return
Sub Event_Failure
/varcalc Failures ${Failures} + 1
/return
Sub Event_Trivial
/varcalc Trivials ${Trivials} + 1
/if (${EndOnTrivial}) {
/echo Stopped due to item trivial!
/call DisplayStats
/endmacro
}
/return


