| Alchemy.mac
|
| Created December 2005
|
| Takes you from 1 to 202 in Alchemy
|
| Written by Armysoldier based on code written by override
|
| 12/28/05: ADDED Salvage event
|
| Before you start, there are the settings you need to change for you.
|
| SkillMaxWanted can be change to what skill you want to stop at.
|
| MerchantName is which merchant you are at.
|
| 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 up to skill 176 since all the components are there.
| Then this macro will move to Shadow Haven if you are not there .. and go from 176 to 202
|
|
| Requirements:
| Have Toon Standing BETWEEN Lita Hegeway @ loc 122,-50
| AND Jorlan Hegeway in Abysmal Sea
| You will need a Medicine Bag (in the last slot).
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
|
|
#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.#*#"
#Event Salvage "You failed the combine, but you managed to recover #*#"
#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 CompA item outer
/declare CompB item outer
/declare CompC item outer
/declare CompD item outer
/declare CompE item outer
/declare CompF item outer
/declare CombItemName string outer
/declare ItemTo string outer
/declare EndingVar int outer
/declare Levelname int outer
/declare DelayMult int outer
/varset OldSkill ${Me.Skill[Alchemy]}
| ************************************************
| * Change these settings to what you want. *
| ************************************************
/varset SkillMaxWanted 300
/varset DelayMult 1
| ************************************************
| Set components for recipies
| ************************************************
:start
/echo Alchemy is at ${Me.Skill[Alchemy]}
/if (${Me.Skill[Alchemy]}>=${SkillMaxWanted}) {
/echo Alchemy is at ${SkillMaxWanted}. Quiting!
/endmacro
}
/if (${Me.Skill[Alchemy]}<83) {
/varset MerchantNameA "Lita Hegeway"
/varset CompA "acaana"
/varset CompB "cicino"
/varset CompC "cork"
/varset CompD "empty vial"
/varset CompE "flamewort"
/varset CompF "yellow rheum"
/varset CombItemName "CFI"
/varset ItemTo "Concoction of Flame I"
}
/if (${Me.Skill[Alchemy]}>=82 && ${Me.Skill[ALchemy]}<97) {
/varset MerchantNameA "Lita Hegeway"
/varset CompA "acaana"
/varset CompB "belan"
/varset CompC "cork"
/varset CompD "empty vial"
/varset CompE "flamewort"
/varset CompF "yellow rheum"
/varset CombItemName "CFII"
/varset ItemTo "Concoction of Flame II"
}
/if (${Me.Skill[Alchemy]}>=96 && ${Me.Skill[Alchemy]}<112) {
/varset MerchantNameA "Lita Hegeway"
/varset CompA "acaana"
/varset CompB "berterine"
/varset CompC "cork"
/varset CompD "empty vial"
/varset CompE "flamewort"
/varset CompF "yellow rheum"
/varset CombItemName "CFIII"
/varset ItemTo "Concoction of Flame III"
}
/if (${Me.Skill[Alchemy]}>=111 && ${Me.Skill[Alchemy]}<128) {
/varset MerchantNameA "Lita Hegeway"
/varset CompA "acaana"
/varset CompB "dinfuin"
/varset CompC "cork"
/varset CompD "empty vial"
/varset CompE "flamewort"
/varset CompF "yellow rheum"
/varset CombItemName "CFIV"
/varset ItemTo "Concoction of Flame IV"
}
/if (${Me.Skill[Alchemy]}>=127 && ${Me.Skill[Alchemy]}<137) {
/varset MerchantNameA "Jorlan Hegeway"
/varset CompA "clover"
/varset CompB "clubmoss"
/varset CompC "jatamasi"
/varset CombItemName "KSF"
/varset ItemTo "Kilva's Skin Of Flame"
}
/if (${Me.Skill[Alchemy]}>=136 && ${Me.Skill[Alchemy]}<144) {
/varset MerchantNameA "Jorlan Hegeway"
/varset CompA "lucerne"
/varset CompB "sage leaf"
/varset CompC "valerian root"
/varset CombItemName "GPS"
/varset ItemTo "Greater Potion Of Stability"
}
/if (${Me.Skill[Alchemy]}>=143 && ${Me.Skill[Alchemy]}<151) {
/varset MerchantNameA "Jorlan Hegeway"
/varset CompA "lucerne"
/varset CompB "fenugreek"
/varset CompC "valerian root"
/varset CombItemName "GPP"
/varset ItemTo "Greater Potion Of Power"
}
/if (${Me.Skill[Alchemy]}>=150 && ${Me.Skill[Alchemy]}<164) {
/varset MerchantNameA "Jorlan Hegeway"
/varset CompA "benzoin"
/varset CompB "sage leaf"
/varset CompC "valerian root"
/varset CombItemName "GPH"
/varset ItemTo "Greater Potion Of Heat"
}
/if (${Me.Skill[Alchemy]}>=163 && ${Me.Skill[Alchemy]}<177) {
/varset MerchantNameA "Jorlan Hegeway"
/varset CompA "heliotrope"
/varset CompB "heliotrope"
/varset CompC "heliotrope"
/varset CombItemName "Gate"
/varset ItemTo "Gate Potion"
}
/if (${Me.Skill[Alchemy]}>=176) {
/gate
/delay 2m
/zone Shadowhaven
/delay 2m
/call MoveToSteaon
}
/if (${Me.Skill[Alchemy]}>=176 && ${Me.Skill[Alchemy]}<181) {
/varset MerchantNameA "Steaon Alarenier"
/varset CompA "maliak leaf"
/varset CompB "tri-fern leaf"
/varset CombItemName "Titan"
/varset ItemTo "Titan Potion"
}
/if (${Me.Skill[Alchemy]}>=180 && ${Me.Skill[Alchemy]}<192) {
/varset MerchantNameA "Steaon Alarenier"
/varset CompA "star reach clover"
/varset CompB "tri-fern leaf"
/varset CombItemName "HET"
/varset ItemTo "Hawks Eye Tonic"
}
/if (${Me.Skill[Alchemy]}>=191 && ${Me.Skill[Alchemy]}<203) {
/varset MerchantNameA "Steaon Alarenier"
/varset CompA "sickle leaf"
/varset CompB "sickle leaf"
/varset CombItemName "MI"
/varset ItemTo "Mystical Infusion"
}
| ************************************************
| Buy components
| ************************************************
/if (${Me.Skill[Alchemy]}<127) {
/varset EndingVar 1
/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}*1]}s
/call Buy ${CompA} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompB} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompC} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompD} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompE} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompF} 10
/delay ${Math.Calc[${DelayMult}*1]}s
}
/if (${Me.Skill[Alchemy]}>=127 && ${Me.Skill[Alchemy]}<178) {
/varset EndingVar 1
/call MoveToJorlan
/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}*1]}s
/call Buy ${CompA} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompB} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompC} 10
}
/if (${Me.Skill[Alchemy]}>=177 && ${Me.Skill[Alchemy]}<203) {
/varset EndingVar 1
/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}*1]}s
/call Buy ${CompA} 10
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompB} 10
}
/call ClosePacks
/keypress esc
/delay ${Math.Calc[${DelayMult}*2]}s
| ************************************************
| Make the Magic Happen
| ************************************************
/call Combinefunction
/call Selloff
/goto :start
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|The Selloff
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Selloff
/nomodkey /keypress esc
/echo sell off to merchant
/if (${Me.Skill[Alchemy]}<128) {
/varset EndingVar 1
/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}*1]}s
/call Sell ${ItemTo}
/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 Sell ${CompF}
/delay ${Math.Calc[${DelayMult}*1]}s
}
/if (${Me.Skill[Alchemy]}>=127 && ${Me.Skill[Alchemy]}<178) {
/target ${MerchantNameA}
/face
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click right target
/call OpenPacks
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${ItemTo}
/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}
}
/if (${Me.Skill[Alchemy]}>=177 && ${Me.Skill[Alchemy]}<203) {
/target ${MerchantNameA}
/face
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click right target
/call OpenPacks
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${ItemTo}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompA}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Sell ${CompB}
}
/call ClosePacks
/keypress esc
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|The CombineFunction
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Combinefunction
/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
/autoinv
/delay ${Math.Calc[${DelayMult}*1]}s
/autoinv
/delay ${Math.Calc[${DelayMult}*1]}s
/if (${EndingVar}==1) /goto :Begin
/doevents
/autoinv
/delay ${Math.Calc[${DelayMult}*1]}s
/autoinv
/delay ${Math.Calc[${DelayMult}*1]}s
/call ClosePacks
/doevents
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|READ INI sub
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub readIni(RecipeName)
/declare Container string
/echo Running ${RecipeName} recipe
/if (${Ini["Alchemy.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) {
/echo Recipe ${RecipeName} not found
/endmacro
}
/varset Container ${Ini[Alchemy.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[ALchemy.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]}
/next i
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Clear Cursor
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub ClearCursor
:Loop
/if (!${Cursor.ID}) /return
/autoinv
| /destroy
/delay 5s
/doevents
/goto :Loop
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub DoCombine
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub DoCombine
:Loop
/combine ${PackCode}
/delay ${Math.Calc[${DelayMult}*1]}s
/if (${PackCode.Equal[Enviro]}) /delay ${Math.Calc[${DelayMult}*1]}s
/doevents
/if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop
/delay 5
/if (${Me.Skill[Alchemy]}>${OldSkill}) {
/echo Your Alchemy Went Up!! It's now ${Me.Skill[Alchemy]}!
/varset OldSkill ${Me.Skill[Alchemy]}
}
/doevents
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub add Components
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
}
/doevents
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event Combine error
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_CombineError
/varset EndingVar 2
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event Container is being used
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_ContUsed
/echo Container in use. Waiting 30 seconds and trying again.
/delay 30s
/itemtarget "Forge"
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /click left item
/delay ${Math.Calc[${DelayMult}*2]}s
/doevents
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub Event Salvage
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_Salvage
/call cleanPack "${Container}"
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Sub MOVEMENT SUBS - Merchants
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Move To Jorlan
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub MoveToJorlan
/echo Going to ${MerchantNameA}.
:PullMoveLoopa
/if (${Me.State.Equal[SIT]}) /stand
/face nolook loc 124.58,-55.72
/if (${Math.Distance[124.58,-55.72]}>2) /nomodkey /keypress forward hold
/if (${Math.Distance[124.58,-55.72]}<=2) {
/nomodkey /keypress forward
/return
}
/goto :PullMoveLoopa
/return
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Move To Steaon Alarenier
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub MoveToSteaon
/echo Going to ${MerchantNameA}.
/echo warp Loc 278 1571 -55
/return