Moderator: MacroQuest Developers
Code: Select all
|
| brewing.mac
| Takes you from 1 to 248 in Brewing
| Version 2.8
| Date: September 14, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/
|
| Before are the settings you need to change for you.
| This Macro can take you up to 248 in brewing.
| SkillMaxWanted can be change to what skill you want to stop at.
| MerchantNameA is which merchant has the brewing components.
| MerchantNameB is which merchant has the water and short beer components.
| You will need to change the DelayMult to higher if you are laggy, this
| number will be multiplied to the default delay.
|
| This Macro works best in the Abysmal Sea since all the components are there.
| You WILL need to be between both merchants to be able to use this macro.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
| This macro may not work any other place then the Abysmal Sea.
|
#event CombineError "#*#There was no place to put that#*#"
#event CombineError "#*#You cannot combine these items in this container type!#*#"
#event CombineError "#*#did not accept these items#*#"
#event ContUsed "#*#Someone else is using that. Try again later.#*#"
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc
Sub Main
/declare OldSkill int outer
/declare SkillMaxWanted int outer
/declare PackCode string outer
/declare Component[10] string outer
/declare i int outer
/declare MerchantNameA string Outer
/declare MerchantNameB string Outer
/declare CompA item outer
/declare CompB item outer
/declare CompC item outer
/declare CompD item outer
/declare CompE item outer
/declare CombItemName string outer
/declare ItemToA string outer
/declare ItemToB string outer
/declare ItemToC string outer
/declare EndingVar int outer
/declare Levelname int outer
/declare DelayMult int outer
/varset OldSkill ${Me.Skill[Brewing]}
/varset CompA "none"
| ************************************************
| * Change these settings to what you want. *
| ************************************************
/varset MerchantNameA "Galidnus Corkpopper"
/varset MerchantNameB "Dray Cuves"
/varset SkillMaxWanted 248
/varset DelayMult 1
| ************************************************
| ************************************************
:start
/echo Brewing is at ${Me.Skill[Brewing]}
/if (${Me.Skill[Brewing]}>=${SkillMaxWanted}) {
/echo Brewing is at ${SkillMaxWanted}. Quiting!
/endmacro
}
/if (${Me.Skill[Brewing]}<${SkillMaxWanted}) {
/varset CompA "cask"
/varset CompB "malt"
/varset CompC "short beer"
/varset CompD "water flask"
/varset CompE "yeast"
/varset CombItemName "MHB"
/varset ItemToA "Minotaur Hero's Brew"
/varset ItemToB "bottle"
/varset ItemToC "cask"
}
/varset EndingVar 1
/call GoToMerchant
/delay ${Math.Calc[${DelayMult}*1]}s
/target ${MerchantNameA}
/face
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click right target
/call OpenPacks
/delay ${Math.Calc[${DelayMult}*2]}s
/call Sell ${ItemToA}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${ItemToB}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompA}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompB}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompC}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompD}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompE}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompA} 40
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompB} 120
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompE} 40
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /notify MerchantWnd DoneButton leftmouseup
/call ClosePacks
/delay ${Math.Calc[${DelayMult}*2]}s
/target ${MerchantNameB}
/face
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click right target
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompC} 80
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompD} 100
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /notify MerchantWnd DoneButton leftmouseup
/delay ${Math.Calc[${DelayMult}*1]}s
/call GoToBarrel
/look
/mouseto 500, 500
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click left
/delay ${Math.Calc[${DelayMult}*2]}s
/doevents
/delay ${Math.Calc[${DelayMult}*1]}s
/call OpenPacks
/delay ${Math.Calc[${DelayMult}*2]}s
/call readIni "${CombItemName}"
:Begin
/if (${EndingVar}==1) /call ClearCursor
/for i 1 to 10
/if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i}
/next i
/if (${EndingVar}==1) /call DoCombine
/call FixShit
/if (${EndingVar}==1) /goto :Begin
/delay ${Math.Calc[${DelayMult}*1]}s
/call ClosePacks
/nomodkey /keypress esc
/nomodkey /keypress esc
/call GoToMerchant
/delay ${Math.Calc[${DelayMult}*1]}s
/target ${MerchantNameA}
/face
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click right target
/delay ${Math.Calc[${DelayMult}*2]}s
/call OpenPacks
/call Sell ${ItemToA}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${ItemToB}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${ItemToC}
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /notify MerchantWnd DoneButton leftmouseup
/call ClosePacks
/goto :start
/return
Sub FixShit
/call ClosePacks
/nomodkey /keypress esc
/nomodkey /keypress esc
/delay ${Math.Calc[${DelayMult}*5]}
/call ClearCursor
/delay ${Math.Calc[${DelayMult}*5]}
/look
/mouseto 500, 500
/nomodkey /click left
/doevents
/call OpenPacks
/return
Sub readIni(RecipeName)
/declare Container string local
/echo Running ${RecipeName} recipe, which makes ${ItemToA}.
/if (${Ini["brewing.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) {
/echo Recipe ${RecipeName} not found
/endmacro
}
/varset Container ${Ini[brewing.ini,${RecipeName},Cont,Enviro]}
/if (${Container.Equal[Enviro]}) {
/varset PackCode Enviro
} else {
/varset PackCode ${FindItem[=${Container}].InvSlot}
/if (${PackCode.Equal[NULL]}) {
/echo Could not find container ${Container}
/varset EndingVar 2
/return
}
| pack1 = 22, ... , pack8 = 29
/varset PackCode pack${Math.Calc[${PackCode}-21].Int}
}
/call cleanPack "${Container}"
/for i 1 to 10
/varset Component[${i}] ${Ini[brewing.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]}
/next i
/return
sub ClearCursor
:Loop
/if (!${Cursor.ID}) /return
/autoinv
| /destroy
/delay ${Math.Calc[${DelayMult}*1]}s
/doevents
/goto :Loop
/return
sub DoCombine
:Loop
/combine ${PackCode}
/delay 1s
/if (${PackCode.Equal[Enviro]}) /delay 1s
/doevents
/if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop
/delay 5
/if (${Me.Skill[Brewing]}>${OldSkill}) {
/echo Your Brewing Went Up!! It's now ${Me.Skill[Brewing]}!
/varset OldSkill ${Me.Skill[Brewing]}
}
/return
sub AddComp(CompName, PackSlot)
/if (${CompName.Equal[NOTFOUND]}) /return
/if (!${FindItem[=${CompName}].ID}) {
/echo Could not find ${CompName} in inventory
/beep
/varset EndingVar 2
/return
}
:Loop
/nomodkey /ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup
/if (!${Cursor.ID}) {
/delay ${Math.Calc[${DelayMult}*1]}s
/goto :Loop
}
/if (${PackCode.Equal[Enviro]}) {
/nomodkey /itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup
} else {
/nomodkey /itemnotify in ${PackCode} ${PackSlot} leftmouseup
}
/return
Sub Event_CombineError
/varset EndingVar 2
/return
Sub Event_ContUsed
/echo Container in use. Waiting 30 seconds and trying again.
/delay 30s
/itemtarget "Brew Barrel"
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click left item
/delay ${Math.Calc[${DelayMult}*2]}s
/doevents
/return
Sub GoToMerchant
/echo Going to Merchants.
:PullMoveLoop
/if (${Me.State.Equal[SIT]}) /stand
/face nolook loc -165.30,178.83
/if (${Math.Distance[-165.30,178.83]}>2) /nomodkey /keypress forward hold
/if (${Math.Distance[-165.30,178.83]}<=2) {
/nomodkey /keypress forward
/return
}
/goto :PullMoveLoop
/return
Sub GoToBarrel
/echo Going to Brewing Barrel.
/itemtarget "Brew Barrel"
:PullMoveLoop
/if (${Me.State.Equal[SIT]}) /stand
/face
/if (${Target.Distance}>10) /nomodkey /keypress forward hold
/if (${Target.Distance}<=10) {
/nomodkey /keypress forward
/return
}
/goto :PullMoveLoop
/return 
I would try to up the delay multiplier at the beginning of the macro up a little and try that.BigDaddyDinDin wrote:It keeps giving me the error that Dray Cuves does not sell cheese when I clearly see it on the vendor. Is this an error in the macro or an erro with the way I am running it?