Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include buy.inc
- #include Wait4Rez.inc
- Sub Main
- | specify which soulstone you need and the cost in platinum.
- /declare WhichStone string outer Pristine Soulstone
- /declare StonePPCost string outer 165
- | convert PP to CP for macro
- /declare StoneCost int outer ${Math.Calc[${StonePPCost}*1000]}
- | boundaries for lobby sides
- /declare EastSide int local -180
- /declare WestSide int local 180
- /declare SouthSide int local 300
- /declare NorthSide int local 525
- /if (${Zone.ID}==344) {
- /if ( (${Me.X}<=${EastSide} || ${Me.X}>=${WestSide}) && ${Me.Y}>=${SouthSide} && ${Me.Y}<=${NorthSide} ) {
- | to play it safe, first move to the soul binder
- | this can be done with more logic for smarter movement,
- | but this method is simple and effective.
- /moveto ID ${NearestSpawn[npc High Priest of Luclin].ID}
- /delay 5s !${MoveTo.Moving}
- } else {
- /echo You need to be inside the East or West side of the lobby for ${Macro.Name} to function properly
- /return
- }
- | check for a soulstone on hand already
- /if (${FindItemCount[=${WhichStone}]}<1) {
- | then move to the banker to get money if needed.
- /if (${Me.Cash}<${StoneCost}) /call GetMoney
- | check that we have cash and go buy it.
- /if (${Me.Cash}>=${StoneCost}) {
- /call GetStone
- } else {
- /echo no cash available to purchase the ${WhichStone}.
- /return
- }
- }
- | sanity check in case GetStone failed.
- /if (${FindItemCount[=${WhichStone}]}<1) {
- /echo I do not have a ${WhichStone} to give to the priest.
- /return
- } else {
- /call GiveStone
- }
- /delay 5s ${Spawn[${Me}'s corps].ID}
- /if (!${Spawn[${Me}'s corps].ID}) {
- /echo No corpse was returned, looks like you just blew ${StonePPCost}pp.
- } else {
- /call Wait4Rez 1
- }
- }
- /return
- Sub GetMoney
- /declare i int local
- /declare QtyLen int local
- /declare Banker int local ${NearestSpawn[npc A Shrewd Banker].ID}
- /moveto ID ${Banker}
- /delay 5s !${MoveTo.Moving}
- /target ID ${Banker}
- /delay 5s ${Target.ID}==${Banker}
- /if (${Target.ID}!=${Banker}) {
- /echo Failed to target the banker.
- /endmacro
- }
- /click right target
- /delay 15s ${Window[Bigbankwnd].Open}
- /if (!${Window[Bigbankwnd].Open}) {
- /echo Failed to open the bank window.
- /endmacro
- }
- | Get Money from Bank or shared bank
- | if there is enough in the bank use that, other wise try the shared bank
- /if (${Math.Calc[${Window[Bigbankwnd].Child[BIGB_Money0].Text}*1000]}>=${StoneCost}) {
- /nomodkey /notify BigBankWnd BIGB_Money0 leftmouseup
- } else {
- /nomodkey /notify BigBankWnd BIGB_SharedMoney0 leftmouseup
- }
- /delay 3s ( ${Window[QuantityWnd].Open} )
- /if (!${Window[QuantityWnd].Open}) {
- /echo Failed to open the quantiy window. Are you out of money?
- /endmacro
- }
- | backspace out the text in the quantity window
- /for i 1 to 2
- /varset QtyLen ${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length}
- /if (${QtyLen} > 0) {
- /keypress backspace chat
- /delay 1s ${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length}<${QtyLen}
- /varset i 1
- } else {
- /varset i 2
- }
- /next i
- | type the amount of PP needed to withdraw
- /for i 1 to ${StonePPCost.Length}
- /keypress ${StonePPCost.Mid[${i},1]} chat
- /delay 3s ( ${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length} == ${i} )
- /next i
- | accept the specified amount
- /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup
- /delay 3s ( !${Window[QuantityWnd].Open} )
- | drop it in inventory
- /autoinv
- /delay 3s ${Me.Cash}
- /keypress esc
- | move back to the soulbinder to avoid the damn torches
- /moveto ID ${NearestSpawn[npc High Priest of Luclin].ID}
- /delay 5s !${MoveTo.Moving}
- /return
- Sub GetStone
- /declare Mechant int local ${NearestSpawn[npc A Disciple of Luclin].ID}
- /moveto ID ${Mechant}
- /delay 5s !${MoveTo.Moving}
- /target ID ${Mechant}
- /delay 5s ${Target.ID}==${Mechant}
- /if (${Target.ID}!=${Mechant}) {
- /echo Failed to target the Mechant.
- /endmacro
- }
- /click right target
- | buy the stone
- /call Buy "${WhichStone}" 1
- | /delay 3s
- /keypress esc
- /return
- Sub GiveStone
- /declare Priest int local ${NearestSpawn[npc A Priest of Luclin].ID}
- /moveto ID ${Priest}
- /delay 5s !${MoveTo.Moving}
- /target ID ${Priest}
- /delay 5s ${Target.ID}==${Priest}
- /if (${Target.ID}!=${Priest}) {
- /echo Failed to target the Priest.
- /endmacro
- }
- /nomodkey /ctrl /itemnotify ${FindItem[=${WhichStone}].InvSlot} leftmouseup
- /delay 2s ${Cursor.Name.Equal[${WhichStone}]}
- /face fast nolook
- /delay 1s
- /click left target
- /delay 5s ${Window[GiveWnd].Open}
- /if (!${Window[GiveWnd].Open}) {
- /echo Failed to open the trade window with the priest.
- /endmacro
- } else {
- /notify GiveWnd GVW_Give_Button leftmouseup
- }
- /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement