Baking Macro from 1 to 191 (Version 2.1) 8/3/04
Posted: Tue Aug 03, 2004 7:46 pm
Well, I have decided to start releasing some of my Tradeskills Macros. I have them for pretty much for all tradeskills, but I want to work out a few bugs on some before I release a few. Here is a Link that has all the updated macros:
http://www.soc-music.com/mq2/
Below is the Baking one I have made. This is to be used in the Abysmal Sea and you will need a Non-Stick Frying Pan and a spit on you to go from 1 to 202 if you are doing that. Plus BE SURE to place the .inc files into the common directory in your macros directory (if there isn't one.....create it).
baking.mac
baking.ini
buy.inc
packs.inc
sell.inc
http://www.soc-music.com/mq2/
Below is the Baking one I have made. This is to be used in the Abysmal Sea and you will need a Non-Stick Frying Pan and a spit on you to go from 1 to 202 if you are doing that. Plus BE SURE to place the .inc files into the common directory in your macros directory (if there isn't one.....create it).
baking.mac
Code: Select all
|
| baking.mac
| Takes you from 1 to 191 in Baking
| Version 2.1
| Date: August 3, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| Before are the settings you need to change for you.
| This Macro can take you up to 191 in baking.
| SkillMaxWanted can be change to what skill you want to stop at.
| MerchantNameA is which merchant has the cheese.
| MerchantNameB is which merchant has the loaf of bread and wolf meat.
|
| This Macro works best in the Abysmal Sea since all the components are there.
| You WILL need to be behind Tylida Eraldi to be able to use this macro.
|
| Requirements:
| You will need a spit (in the last slot) and a Non-Stick Frying Pan.
|
| 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#*#"
#include common/sell.inc
#include common/buy.inc
#include common/packs.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 CombItemName string outer
/declare ItemToA string outer
/declare ItemToB string outer
/declare ItemToC string outer
/declare EndingVar int outer
/declare Levelname int outer
/varset OldSkill ${Me.Skill[Baking]}
| ************************************************
| * Change these settings to what you want. *
| ************************************************
/varset MerchantNameA "Tylida Eraldi"
/varset MerchantNameB "Dray Cuves"
/varset SkillMaxWanted 191
| ************************************************
| ************************************************
:start
/echo Baking is at ${Me.Skill[Baking]}
/if (${Me.Skill[Baking]}>=${SkillMaxWanted}) {
/echo Baking is at ${SkillMaxWanted}. Quiting!
/endmacro
}
/if (${Me.Skill[Baking]}<${SkillMaxWanted}) {
/varset CompA "cheese"
/varset CompB "loaf of bread"
/varset CompC "bear meat"
/varset CombItemName "PM"
/varset ItemToA "Patty Melt"
}
/varset EndingVar 1
/delay 1s
/target ${MerchantNameA}
/face
/delay 1s
/click right target
/delay 1s
/call Buy ${CompB} 40
/delay 1s
/call Buy ${CompC} 40
/delay 1s
/notify MerchantWnd DoneButton leftmouseup
/delay 1s
/call GoToMerchantB
/delay 2s
/target ${MerchantNameB}
/face
/delay 1s
/click right target
/delay 1s
/call Buy ${CompA} 40
/delay 1s
/notify MerchantWnd DoneButton leftmouseup
/call OpenPacks
/delay 3s
/notify TradeskillWnd ExperimentButton leftmousehold
/notify TradeskillWnd ExperimentButton leftmouseup
/delay 2s
/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
/if (${EndingVar}==1) /goto :Begin
/delay 1s
/call ClosePacks
/keypress esc
/keypress esc
/delay 1s
/target ${MerchantNameB}
/face
/delay 1s
/click right target
/delay 1s
/call OpenPacks
/delay 2s
/call Sell ${ItemToA}
/delay 1s
/call ClosePacks
/keypress esc
/keypress esc
/delay 1s
/call GoToMerchantA
/goto :start
/return
Sub readIni(RecipeName)
/declare Container string
/echo Running ${RecipeName} recipe, which makes ${ItemToA}.
/if (${Ini["baking.ini","${RecipeName}",-1,"NOTFOUND"].Equal["NOTFOUND"]}) {
/echo Recipe ${RecipeName} not found
/endmacro
}
/varset Container ${Ini[baking.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}
}
/for i 1 to 10
/varset Component[${i}] ${Ini[baking.ini,${RecipeName},Comp${Math.Calc[${i}-1].Int},NOTFOUND]}
/next i
/return
sub ClearCursor
:Loop
/if (!${Cursor.ID}) /return
/autoinv
| /destroy
/delay 5
/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[Baking]}>${OldSkill}) {
/echo Your Baking Went Up!! It's now ${Me.Skill[Baking]}!
/varset OldSkill ${Me.Skill[Baking]}
}
/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
/ctrl /itemnotify ${FindItem[=${CompName}].InvSlot} leftmouseup
/if (!${Cursor.ID}) {
/delay 1
/goto :Loop
}
/if (${PackCode.Equal[Enviro]}) {
/itemnotify ${InvSlot[enviro${PackSlot}]} leftmouseup
} else {
/itemnotify in ${PackCode} ${PackSlot} leftmouseup
}
/return
Sub Event_CombineError
/varset EndingVar 2
/return
Sub GoToMerchantA
/echo Going to ${MerchantNameA}.
:PullMoveLoopa
/if (${Me.State.Equal[SIT]}) /stand
/face nolook loc -120.78,181.51
/if (${Math.Distance[-120.78,181.51]}>2) /keypress forward hold
/if (${Math.Distance[-120.78,181.51]}<=2) {
/keypress forward
/goto :PullMoveLoopb
}
/goto :PullMoveLoopa
:PullMoveLoopb
/if (${Me.State.Equal[SIT]}) /stand
/face nolook loc -104.60,192.32
/if (${Math.Distance[-104.60,192.32]}>2) /keypress forward hold
/if (${Math.Distance[-104.60,192.32]}<=2) {
/keypress forward
/goto :end
}
/goto :PullMoveLoopb
:end
/return
Sub GoToMerchantB
/echo Going to ${MerchantNameB}.
:PullMoveLoopg
/if (${Me.State.Equal[SIT]}) /stand
/face nolook loc -120.78,181.51
/if (${Math.Distance[-120.78,181.51]}>2) /keypress forward hold
/if (${Math.Distance[-120.78,181.51]}<=2) {
/keypress forward
/goto :PullMoveLooph
}
/goto :PullMoveLoopg
:PullMoveLooph
/if (${Me.State.Equal[SIT]}) /stand
/face nolook loc -148.99,180.15
/if (${Math.Distance[-148.99,180.15]}>2) /keypress forward hold
/if (${Math.Distance[-148.99,180.15]}<=2) {
/keypress forward
/goto :end
}
/goto :PullMoveLooph
:end
/return
Code: Select all
[PM]
Cont=Spit
Comp0=loaf of bread
Comp1=cheese
Comp2=bear meat
Comp3=non-stick frying pan
Code: Select all
|
| buy.inc
| Buy Include File needed for macros
| Version 1.3
| Date: August 1, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| These file MUST be in the common directory in your macros directory.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
|
#event Broke "#*#can't afford to buy them#*#"
Sub Buy(item ItemToBuy, int amount)
/echo Buying ${ItemToBuy}
/declare TotalMItems int Inner
/varset TotalMItems ${Merchant.Items}
/declare x int Inner
/declare ItemSlotNum int Inner
/varset ItemSlotNum 0
/for x 1 to ${TotalMItems}
/if (${ItemToBuy.Equal[${Merchant.Item[${x}]}]}) {
/varset ItemSlotNum ${x}
}
/next x
/if (${ItemSlotNum}==0) {
/echo Not on Merchant
/return
}
/itemnotify merchant${ItemSlotNum} leftmouseup
:Buy
/if (${FindItemCount[=${SelectedItem}]}>=${amount}) {
/echo Done!
/return
}
:StackLoop
/if (${Math.Calc[${amount}-${FindItemCount[=${SelectedItem}]}]}<=20) /goto :RegLoop
/buyitem ${If[${SelectedItem.Stackable},20,1]}
/delay 5
/doevents
/goto :StackLoop
:RegLoop
/if (${Math.Calc[${amount}-${FindItemCount[=${SelectedItem}]}]}<=0) {
/echo Done!
/return
}
/buyitem ${If[${SelectedItem.Stackable},${Math.Calc[${amount}-${FindItemCount[=${SelectedItem}]}]},1]}
/delay 5
/doevents
/goto :RegLoop
/return
Sub Event_Broke
/echo Error: You are out of money!
/beep
/endmacro
/return
Code: Select all
|
| packs.inc
| Open and Close Packs Include File needed for macros
| Version 1.1
| Date: August 1, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| These file MUST be in the common directory in your macros directory.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
|
Sub OpenPacks
/declare bag int local 0
/newif (!${Window[InventoryWindow].Open}) /keypress inventory
/delay 1
/for bag 1 to 8 step 1
/newif (!${Window[pack${bag}].Open}) /itemnotify pack${bag} rightmouseup
/next bag
/delay 1
/return
Sub ClosePacks
/declare bag int local 0
| /newif (!${Window[InventoryWindow].Open}} /keypress inventory
/delay 1
/for bag 1 to 8 step 1
/newif (${Window[pack${bag}].Open}) /itemnotify pack${bag} rightmouseup
/next bag
/delay 1
/return
Code: Select all
|
| sell.inc
| Selling Include File needed for macros
| Version 1.2
| Date: August 1, 2004
|
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2/index.htm
|
| These file MUST be in the common directory in your macros directory.
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
|
Sub Sell(string ItemToSell)
/declare OldMoney int Inner
/declare NewMoney int Inner
/autoinv
/if (${ItemToSell.Equal[NULL]}) {
/echo Usage: /macro sell "Item"
/return
}
:Finding
/if (${FindItemCount[=${ItemToSell}]}==0) /goto :Done
/itemnotify ${FindItem[=${ItemToSell}].InvSlot} leftmouseup
:WaitFind
/if (${Bool[${SelectedItem}]}==FALSE) /goto :WaitFind
:Selling
/delay 1s
/varset OldMoney ${Me.Cash}
/shift /notify MerchantWnd MW_Sell_Button leftmouseup
:WaitSell
/varset NewMoney $(Me.Cash}
/if (${NewMoney}==${OldMoney}) /goto :WaitSell
/goto :Finding
:Done
/echo No more ${ItemToSell} to sell!!!
/return