Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | BuyFoodDrink.mac
- | Recommend adding an alias
- | /alias /bfd /macro BuyFoodDrink
- | include buy.inc from tradeskill macros (used in SoulStone.mac also)
- #include buy.inc
- | global define for responses
- #define RESP_CHAN "/bc"
- Sub Main
- | ======================================
- | Customize these settings if you want,
- | it was designed in Guild Hall.
- | ======================================
- | ZoneID is /echo ${Zone.ID}
- /declare ZoneID int local 345
- | ZoneName is /echo ${Zone}
- /declare ZoneName string local Guild Hall
- | StartX and StartY are the X and Y in /loc Y X Z
- /declare StartY int local 0
- /declare StartX int local 0
- | The name of the merchant you will be purchasing from.
- /declare MerchantName string local Yenny Werlikanin
- | What items and how much to get of each
- /declare DrinkName string local Water Flask
- /declare DrinkAmount int local 60
- /declare FoodName string local Iron Ration
- /declare FoodAmount int local 40
- | ======================================
- | Do not edit past here unless you know
- | what you are doing. I won't help you.
- | ======================================
- | check if we are in the Guild Hall
- /if (${Zone.ID}!=${Zone.ID}) {
- RESP_CHAN I am not in the ${ZoneName}, please try again there.
- /return
- }
- | check if i actually need the food/drink
- /if (${FindItemCount[${DrinkName}]}>=${DrinkAmount} && ${FindItemCount[${FoodName}]}>=${FoodAmount}) {
- RESP_CHAN I don't need any food or drink at this time.
- /return
- }
- | turn off things that make moving hard
- /netfollow off
- /stick off
- /makecamp off
- /dismount
- /stand
- | move to start point
- /moveto loc ${StartY} ${StartX}
- /delay 5s !${MoveTo.Moving}
- | move to the merchant
- /declare MerchantID int local ${NearestSpawn[npc ${MerchantName}].ID}
- /moveto ID ${MerchantID}
- /delay 5s !${MoveTo.Moving}
- /target ID ${MerchantID}
- /delay 5s ${Target.ID}==${MerchantID}
- /if (${Target.ID}!=${MerchantID}) {
- RESP_CHAN Failed to target ${MerchantName}.
- /endmacro
- }
- /click right target
- | buy the food and drink
- /if (${FindItemCount[${DrinkName}]}<=${DrinkAmount}) {
- /call Buy "${DrinkName}" ${DrinkAmount}
- }
- /delay 5
- /if (${FindItemCount[${FoodName}]}<=${FoodAmount}) {
- /call Buy "${FoodName}" ${FoodAmount}
- }
- /delay 5
- /keypress esc
- RESP_CHAN ${FoodName} and ${DrinkName} purchased. I have ${FindItemCount[${FoodName}]} ${FoodName} and ${FindItemCount[${DrinkName}]} ${DrinkName} on me.
- | move back to start loc
- /moveto loc ${StartY} ${StartX}
- /delay 5s !${MoveTo.Moving}
- /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement