Advertisement
sorvani

SoulStone.mac

Apr 11th, 2012
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 KB | None | 0 0
  1. #include buy.inc
  2. #include Wait4Rez.inc
  3.  
  4. Sub Main
  5. | specify which soulstone you need and the cost in platinum.
  6. /declare WhichStone string outer Pristine Soulstone
  7. /declare StonePPCost string outer 165
  8. | convert PP to CP for macro
  9. /declare StoneCost int outer ${Math.Calc[${StonePPCost}*1000]}
  10. | boundaries for lobby sides
  11. /declare EastSide int local -180
  12. /declare WestSide int local 180
  13. /declare SouthSide int local 300
  14. /declare NorthSide int local 525
  15. /if (${Zone.ID}==344) {
  16. /if ( (${Me.X}<=${EastSide} || ${Me.X}>=${WestSide}) && ${Me.Y}>=${SouthSide} && ${Me.Y}<=${NorthSide} ) {
  17. | to play it safe, first move to the soul binder
  18. | this can be done with more logic for smarter movement,
  19. | but this method is simple and effective.
  20. /moveto ID ${NearestSpawn[npc High Priest of Luclin].ID}
  21. /delay 5s !${MoveTo.Moving}
  22. } else {
  23. /echo You need to be inside the East or West side of the lobby for ${Macro.Name} to function properly
  24. /return
  25. }
  26. | check for a soulstone on hand already
  27. /if (${FindItemCount[=${WhichStone}]}<1) {
  28. | then move to the banker to get money if needed.
  29. /if (${Me.Cash}<${StoneCost}) /call GetMoney
  30. | check that we have cash and go buy it.
  31. /if (${Me.Cash}>=${StoneCost}) {
  32. /call GetStone
  33. } else {
  34. /echo no cash available to purchase the ${WhichStone}.
  35. /return
  36. }
  37. }
  38. | sanity check in case GetStone failed.
  39. /if (${FindItemCount[=${WhichStone}]}<1) {
  40. /echo I do not have a ${WhichStone} to give to the priest.
  41. /return
  42. } else {
  43. /call GiveStone
  44. }
  45. /delay 5s ${Spawn[${Me}'s corps].ID}
  46. /if (!${Spawn[${Me}'s corps].ID}) {
  47. /echo No corpse was returned, looks like you just blew ${StonePPCost}pp.
  48. } else {
  49. /call Wait4Rez 1
  50. }
  51. }
  52. /return
  53.  
  54. Sub GetMoney
  55. /declare i int local
  56. /declare QtyLen int local
  57. /declare Banker int local ${NearestSpawn[npc A Shrewd Banker].ID}
  58.  
  59. /moveto ID ${Banker}
  60. /delay 5s !${MoveTo.Moving}
  61. /target ID ${Banker}
  62. /delay 5s ${Target.ID}==${Banker}
  63. /if (${Target.ID}!=${Banker}) {
  64. /echo Failed to target the banker.
  65. /endmacro
  66. }
  67. /click right target
  68. /delay 15s ${Window[Bigbankwnd].Open}
  69. /if (!${Window[Bigbankwnd].Open}) {
  70. /echo Failed to open the bank window.
  71. /endmacro
  72. }
  73. | Get Money from Bank or shared bank
  74. | if there is enough in the bank use that, other wise try the shared bank
  75. /if (${Math.Calc[${Window[Bigbankwnd].Child[BIGB_Money0].Text}*1000]}>=${StoneCost}) {
  76. /nomodkey /notify BigBankWnd BIGB_Money0 leftmouseup
  77. } else {
  78. /nomodkey /notify BigBankWnd BIGB_SharedMoney0 leftmouseup
  79. }
  80. /delay 3s ( ${Window[QuantityWnd].Open} )
  81. /if (!${Window[QuantityWnd].Open}) {
  82. /echo Failed to open the quantiy window. Are you out of money?
  83. /endmacro
  84. }
  85. | backspace out the text in the quantity window
  86. /for i 1 to 2
  87. /varset QtyLen ${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length}
  88. /if (${QtyLen} > 0) {
  89. /keypress backspace chat
  90. /delay 1s ${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length}<${QtyLen}
  91. /varset i 1
  92. } else {
  93. /varset i 2
  94. }
  95. /next i
  96.  
  97. | type the amount of PP needed to withdraw
  98. /for i 1 to ${StonePPCost.Length}
  99. /keypress ${StonePPCost.Mid[${i},1]} chat
  100. /delay 3s ( ${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length} == ${i} )
  101. /next i
  102. | accept the specified amount
  103. /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup
  104. /delay 3s ( !${Window[QuantityWnd].Open} )
  105. | drop it in inventory
  106. /autoinv
  107. /delay 3s ${Me.Cash}
  108. /keypress esc
  109. | move back to the soulbinder to avoid the damn torches
  110. /moveto ID ${NearestSpawn[npc High Priest of Luclin].ID}
  111. /delay 5s !${MoveTo.Moving}
  112. /return
  113.  
  114. Sub GetStone
  115.  
  116. /declare Mechant int local ${NearestSpawn[npc A Disciple of Luclin].ID}
  117.  
  118. /moveto ID ${Mechant}
  119. /delay 5s !${MoveTo.Moving}
  120. /target ID ${Mechant}
  121. /delay 5s ${Target.ID}==${Mechant}
  122. /if (${Target.ID}!=${Mechant}) {
  123. /echo Failed to target the Mechant.
  124. /endmacro
  125. }
  126. /click right target
  127. | buy the stone
  128. /call Buy "${WhichStone}" 1
  129. | /delay 3s
  130. /keypress esc
  131. /return
  132.  
  133. Sub GiveStone
  134. /declare Priest int local ${NearestSpawn[npc A Priest of Luclin].ID}
  135.  
  136. /moveto ID ${Priest}
  137. /delay 5s !${MoveTo.Moving}
  138. /target ID ${Priest}
  139. /delay 5s ${Target.ID}==${Priest}
  140. /if (${Target.ID}!=${Priest}) {
  141. /echo Failed to target the Priest.
  142. /endmacro
  143. }
  144. /nomodkey /ctrl /itemnotify ${FindItem[=${WhichStone}].InvSlot} leftmouseup
  145. /delay 2s ${Cursor.Name.Equal[${WhichStone}]}
  146. /face fast nolook
  147. /delay 1s
  148. /click left target
  149. /delay 5s ${Window[GiveWnd].Open}
  150. /if (!${Window[GiveWnd].Open}) {
  151. /echo Failed to open the trade window with the priest.
  152. /endmacro
  153. } else {
  154. /notify GiveWnd GVW_Give_Button leftmouseup
  155. }
  156. /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement