Moderator: MacroQuest Developers
Here you go:DryGnome wrote:I hate to do this but some good programmers seem to read this thread. Is it possible to make a macro that hands in 4x Red Wine to Lokar To'Biath assuming you're right next to him and you have it in your inventory. I'm hoping after seeing enough simple macros, I'll learn the code.
Code: Select all
|
| Poison.mac
| Takes you from 1 to 250 in Poison Making
| Version 1.2
| Date: September 18, 2004
|
| v1.2 Changes: Now only sells components that change between Recipes
|
| 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 250 in Poison Making.
| 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 since all the components are there.
| You WILL need to be next to the merchant in order for this to work.
| Also, be sure you have a lot of money on you to go from 1 to 250.
|
| Requirements:
| You will need a Mortar and Pestle (in the last slot).
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
| Thanks to GD for putting the posion making macro up.
|
#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#*#"
#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[6] string outer
/declare i int outer
/declare MerchantName string Outer
/declare VialName item outer
/declare SuspName item outer
/declare CompName 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[Make Poison]}
/declare ItemTriv int outer
/declare SellFlag int outer 0
/declare OldVial string outer NULL
/declare OldSusp string outer NULL
| ************************************************
| * Change these settings to what you want. *
| ************************************************
/varset SkillMaxWanted 250
/varset MerchantName "Viliani I`Xvoyt"
/varset DelayMult 1
| ************************************************
| ************************************************
:start
/echo Poison Making is at ${Me.Skill[Make Poison]}
/if (${Me.Skill[Make Poison]}>=${SkillMaxWanted}) {
/echo Poison Making is at ${SkillMaxWanted}. Quiting!
/endmacro
}
/if (${Me.Skill[Make Poison]}>=172 && ${Me.Skill[Make Poison]}<=250) {
/varset VialName "Sealed Poison Vial"
/varset SuspName "Ethereal Suspension"
/varset CompName "Creeper Ivy"
/varset CombItemName "SoS"
/varset ItemTo "Spirit of Sloth"
/varset ItemTriv 250
/varset OldVial NULL
/varset OldSusp "Constrict Suspension"
}
/if (${Me.Skill[Make Poison]}>=130 && ${Me.Skill[Make Poison]}<172) {
/varset VialName "Sealed Poison Vial"
/varset SuspName "Constrict Suspension"
/varset CompName "King's Thorn"
/varset CombItemName "CR"
/varset ItemTo "Calcium Rot"
/varset ItemTriv 171
/varset OldVial NULL
/varset OldSusp NULL
}
/if (${Me.Skill[Make Poison]}>=98 && ${Me.Skill[Make Poison]}<130) {
/varset VialName "Sealed Poison Vial"
/varset SuspName "Constrict Suspension"
/varset CompName "Gelsemium Root"
/varset CombItemName "BF"
/varset ItemTo "Brain Freeze"
/varset ItemTriv 129
/varset OldVial "Lined Poison Vial"
/varset OldSusp NULL
}
/if (${Me.Skill[Make Poison]}<98) {
/varset VialName "Lined Poison Vial"
/varset SuspName "Constrict Suspension"
/varset CompName "Alocasia Root"
/varset CombItemName "AS"
/varset ItemTo "Atrophic Sap"
/varset ItemTriv 97
/varset OldVial NULL
/varset OldSusp NULL
}
/varset EndingVar 1
/target ${MerchantName}
/face
/nomodkey /click right target
/call OpenPacks
/if (${SellFlag}) {
/delay ${Math.Calc[${DelayMult}*2]}s
/if (${OldVial.NotEqual[NULL]}) {
/call Sell ${OldVial}
/delay ${Math.Calc[${DelayMult}*1]}s
}
/if (${OldSusp.NotEqual[NULL]}) {
/call Sell ${OldSusp}
/delay ${Math.Calc[${DelayMult}*1]}s
}
/call Sell ${CompName}
/varset SellFlag 0
}
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${VialName} 20
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${SuspName} 20
/delay ${Math.Calc[${DelayMult}*1]}s
/call Buy ${CompName} 40
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /notify MerchantWnd DoneButton leftmouseup
/call ClosePacks
/call OpenPacks
/delay ${Math.Calc[${DelayMult}*2]}s
/call readIni "${CombItemName}"
:Begin
/if (${EndingVar}==1) /call ClearCursor
/for i 1 to 6
/if (${EndingVar}==1) /call AddComp "${Component[${i}]}" ${i}
/next i
/if (${EndingVar}==1) /call DoCombine
/if (${EndingVar}==1) /goto :Begin
/delay ${Math.Calc[${DelayMult}*1]}s
/call ClosePacks
/delay ${Math.Calc[${DelayMult}*1]}s
/target ${MerchantName}
/face
/nomodkey /click right target
/delay ${Math.Calc[${DelayMult}*1]}s
/call OpenPacks
/delay ${Math.Calc[${DelayMult}*2]}s
/call Sell ${ItemTo}
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /notify MerchantWnd DoneButton leftmouseup
/call ClosePacks
/goto :start
/return
Sub readIni(RecipeName)
/declare Container string
/echo Running ${RecipeName} recipe, which makes ${ItemTo}.
/if (${Ini["Poison.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) {
/echo Recipe ${RecipeName} not found
/endmacro
}
/varset Container "${Ini[Poison.ini,${RecipeName},Cont,Enviro]}"
/delay 1
/if (${Container.Equal[Enviro]}) {
/varset PackCode Enviro
} else {
/varset Container "${FindItem[${Container}]}"
/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 6
/varset Component[${i}] ${Ini[Poison.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]}
/next i
/return
sub ClearCursor
:Loop
/if (!${Cursor.ID}) /return
/autoinv
/delay ${Math.Calc[${DelayMult}*5]s
/doevents
/goto :Loop
/return
sub DoCombine
:Loop
/combine ${PackCode}
/delay ${Math.Calc[${DelayMult}*1]}s
/if (${PackCode.Equal[Enviro]}) /delay 1s
/doevents
/if (${InvSlot[${PackCode}].Item.Items}) /goto :Loop
/delay ${Math.Calc[${DelayMult}*5]s
/if (${Me.Skill[Make Poison]}>${OldSkill}) {
/echo Your Poison Making Went Up!! It's now ${Me.Skill[Make Poison]}!
/varset OldSkill ${Me.Skill[Make Poison]}
/if (${OldSkill}>=${ItemTriv}) {
/echo Recipe is now Trivial, selling leftover components and moving to next Recipe
/varset SellFlag 1
}
}
/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
Then it's not fully automated, and you'd get left over parts from various recipes left over at times, slowly filling up your inventory.krea823 wrote:it isn't hard to take out the sell back part of the macros. If it's that much of a problem then make some edits.
The reason I did that on the smithing one is because once you get to the higher smithing recipe in teh macro it uses all 30 sheets.DryGnome wrote:Ya I agree with GD, esspecially with the smithing macro that bougth 30 sheet metal and 10 molds then resold 20 sheet metal. Kinda sad.
Drygnome if you remove or comment out the sell back parts of the macro (except for the itemto sell back) it won't sell the sheets back. Or the water and molds if for some reason you had any left over, but it will keep buying enough to have 30 sheets, 10 molds, and 20 flasks. So by the time you get to the end of the macro it will be using all 30 sheets, 10 molds, and flasks. All you'll have left to sell back each cycle at that point will be the items you made since on failure you get nothing back. This keeps it fully automated and no waste.DryGnome wrote:Ya I agree with GD, esspecially with the smithing macro that bougth 30 sheet metal and 10 molds then resold 20 sheet metal. Kinda sad.
Code: Select all
/call Buy ${CompC} 20Code: Select all
/call Buy ${CompC} 10If everyone did that I could write it so it didn't buy extra stuff, but I try to macro for every possible situation. Some people keep all there food and water in the last slot of the last bag, and some people use water flask as their drinks, if you do that even if you put it in the first slot its going to only have what you need. So the easiest solution was to have it buy a few extra.krea823 wrote:I thought of that, but I just keep my normal food/drink in the first 2 slots of my bags so I don't have to worry about drinking the flasks, and I keep all 8 general inventory slots filled. Either with bags or somethign mundane like a stack of bonechips or something.