Advertisement
sorvani

BuyFoodDrink.mac

May 9th, 2012
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. | BuyFoodDrink.mac
  2.  
  3. | Recommend adding an alias
  4. | /alias /bfd /macro BuyFoodDrink
  5.  
  6. | include buy.inc from tradeskill macros (used in SoulStone.mac also)
  7. #include buy.inc
  8.  
  9. | global define for responses
  10. #define RESP_CHAN "/bc"
  11.  
  12. Sub Main
  13. | ======================================
  14. | Customize these settings if you want,
  15. | it was designed in Guild Hall.
  16. | ======================================
  17. | ZoneID is /echo ${Zone.ID}
  18. /declare ZoneID int local 345
  19. | ZoneName is /echo ${Zone}
  20. /declare ZoneName string local Guild Hall
  21. | StartX and StartY are the X and Y in /loc Y X Z
  22. /declare StartY int local 0
  23. /declare StartX int local 0
  24. | The name of the merchant you will be purchasing from.
  25. /declare MerchantName string local Yenny Werlikanin
  26. | What items and how much to get of each
  27. /declare DrinkName string local Water Flask
  28. /declare DrinkAmount int local 60
  29. /declare FoodName string local Iron Ration
  30. /declare FoodAmount int local 40
  31. | ======================================
  32. | Do not edit past here unless you know
  33. | what you are doing. I won't help you.
  34. | ======================================
  35.  
  36. | check if we are in the Guild Hall
  37. /if (${Zone.ID}!=${Zone.ID}) {
  38. RESP_CHAN I am not in the ${ZoneName}, please try again there.
  39. /return
  40. }
  41.  
  42. | check if i actually need the food/drink
  43. /if (${FindItemCount[${DrinkName}]}>=${DrinkAmount} && ${FindItemCount[${FoodName}]}>=${FoodAmount}) {
  44. RESP_CHAN I don't need any food or drink at this time.
  45. /return
  46. }
  47.  
  48. | turn off things that make moving hard
  49. /netfollow off
  50. /stick off
  51. /makecamp off
  52. /dismount
  53. /stand
  54.  
  55. | move to start point
  56. /moveto loc ${StartY} ${StartX}
  57. /delay 5s !${MoveTo.Moving}
  58.  
  59. | move to the merchant
  60. /declare MerchantID int local ${NearestSpawn[npc ${MerchantName}].ID}
  61. /moveto ID ${MerchantID}
  62. /delay 5s !${MoveTo.Moving}
  63. /target ID ${MerchantID}
  64. /delay 5s ${Target.ID}==${MerchantID}
  65. /if (${Target.ID}!=${MerchantID}) {
  66. RESP_CHAN Failed to target ${MerchantName}.
  67. /endmacro
  68. }
  69. /click right target
  70. | buy the food and drink
  71. /if (${FindItemCount[${DrinkName}]}<=${DrinkAmount}) {
  72. /call Buy "${DrinkName}" ${DrinkAmount}
  73. }
  74. /delay 5
  75. /if (${FindItemCount[${FoodName}]}<=${FoodAmount}) {
  76. /call Buy "${FoodName}" ${FoodAmount}
  77. }
  78. /delay 5
  79. /keypress esc
  80. RESP_CHAN ${FoodName} and ${DrinkName} purchased. I have ${FindItemCount[${FoodName}]} ${FoodName} and ${FindItemCount[${DrinkName}]} ${DrinkName} on me.
  81.  
  82. | move back to start loc
  83. /moveto loc ${StartY} ${StartX}
  84. /delay 5s !${MoveTo.Moving}
  85. /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement