Code: Select all
| - Tinker.mac -
|
#include routines.mac
Sub Main
| I prefer to use named vars, so will define those first.
#define nToolbox v1
#define nStartingPlat v2
#define nAttempts v3
#define nStartSkill v4
#define nCurrSkill v5
#define nSuccess
#define nFail
| Setting up my "events" to record successes and failures
#event CombineFail "You lacked the skills to fashion the items together."
#event CombineSuceed "You have fashioned the items together to create something new!"
/varset nStartSkill $char(skill,"Tinkering")
/varcalc nStartingPlat $char(plat)+$char(gold)/10
/varset nCurrSkill $nStartSkill
/varset nAttempts 0
/varset nSuccess 0
/varset nFail 0
/mqlog Starting Macro with skill $nStartSkill and $nStartingPlat platinum.
/call FindCombiner Tinkering
/if $return==99 /return
/varset nToolbox $return
:StartCombine
/cleanup
/click right inv $nToolbox
/sendkey down ctrl
:MakeItem
/if $count("Gears")==0 {
/echo Buy More Gears!
/return }
/if $count("Grease")==0 {
/echo Buy More Grease!
/return }
/if $count("Gnomish Bolts")==0 {
/echo Buy More Bolts!
/return }
| /if n $freeinv(space)<8 {
| /echo No Free Space!
| /return }
| The above line was failing last night when attempted
/if $pack($nToolbox,empty)!=FALSE {
/echo Toolbox not empty!
/return }
/click left auto
/finditem "Gears"
/if $find()==FALSE /goto :Done
/click left pack $nToolbox 0
/finditem "Grease"
/if $find()==FALSE /goto :Done
/click left pack $nToolbox 1
/finditem "Gnomish Bolts"
/if $find()==FALSE /goto :Done
/click left pack $nToolbox 2
/click left pack $nToolbox combine
:WaitTillDone
/delay 1
/if $pack($nToolbox,empty)==FALSE /goto :WaitTillDone
/delay 1
/click left auto
/varadd nAttempts 1
/doevents
/echo $nAttempts attempts, $nSuccess successes, $nFail failures, current skill $char(skill,"Tinkering")
/goto :MakeItem
:Done
/sendkey up ctrl
/return
Sub Event_CombineFail
/varadd nFail 1
/return
Sub Event_CombineSuccess
/varadd nSuccess 1
/return
See any glaring problems in any of this? Also, while posting this, I noticed my tabs in the source code didn't translate correctly over to here. Does MQ allow for tabs in the source for easy reading, or do I need to convert tabs to normal spaces? Nothing about that in the readme file :/
Thanks for any help or pointers!
- Aaryn

