BuyLA.mac -- Purchase Leadership Abilities
Posted: Thu Sep 18, 2008 8:35 pm
I wanted to be able to purchase my leadership abilities from a telent session. So I wrote this. It was educationsal. My guess is that could easily be integrated into someones automated hunting macro.
Limitations:
This macro has very minimal error checking and does not verify you have enough points available before attempting to buy.
WARNING: Watch out for word wrap
BuyLA.mac
Limitations:
This macro has very minimal error checking and does not verify you have enough points available before attempting to buy.
WARNING: Watch out for word wrap
BuyLA.mac
Code: Select all
|-----------------------------------------------------------------------------
| BuyLA.mac
| Writen by TK in Sept of 2008
|
| This macro is intented to allow you to purchase leadership abilities
| remotely.
|-----------------------------------------------------------------------------
sub Main(int intItemNumber)
|** check if the user want to purchase, if not display the options **|
/if (!${intItemNumber}) {
/echo No List Item Selected to Purchase
/echo /mac BuyLA <ItemNumber>
/echo Outputting current leadership abilities information
/call ReportLeadershipAbilityData
} else {
/call PurchaseLap ${intItemNumber}
}
|** close out the group leadership window **|
/if (${Window[LeaderShipWindow].Open} && !${Window[ConfirmationDialagoBox].Open}) {
/notify LeadershipWindow LEW_DoneButton leftmouseup
/delay 3
}
/return
sub PurchaseLap(intListItem)
:LAPPurchaseMainLoop
/if (!${Window[LeadershipWindow].Open}) {
| Open the group leadership window if it isn't
/keypress L
/delay 2s ${Window[LeadershipWindo].Open}
/goto :LAPPurchaseMainLoop
} else {
| Purchased the desired leadership ability point
/notify LeadershipWindow LEW_GroupList listSelect ${intListItem}
/delay 3
/notify LeadershipWindow LEW_GroupList leftmouse ${intListItem}
/delay 3
/notify LeadershipWindow LEW_PurchaseButton leftmouseup
}
/if (!${Window[ConfirmationDialogBox].Open}) {
| Confirm the dialog box if it pops up
/echo Did not receive a confirmation dialog box
} else {
/notify ConfirmationDialogBox CD_Yes_Button leftmouseup
/delay 2
}
/if (${Window[ConfirmationDialogBox].Open}) {
| Sanity check that the dialog box closed properly if not, report that it didn't
/echo The confirmation dialog box failed to close properly
}
/return
sub ReportLeadershipAbilityData
/declare intLoop int local 0
/declare intListCount int local 0
:LAPDisplayMainLoop
/if (!${Window[LeadershipWindow].Open}) {
| Open the group leadership window if it isn't already
/keypress L
/delay 2s ${Window[LeadershipWindow].Open}
/goto :LAPDisplayMainLoop
} else {
| Run through the group leadership window and put the data into the macroquest window
/varset intListCount ${Window[LeadershipWindow].Child[LEW_GroupList].Items}
/echo ItemNumber - Title - Cur/Max - Cost
/for intLoop 1 to ${intListCount}
/echo ${intLoop} - ${Window[LeadershipWindow].Child[LEW_GroupList].List[${intLoop},1]} - ${Window[LeadershipWindow].Child[LEW_GroupList].List[${intLoop},2]} - ${Window[LeadershipWindow].Child[LEW_GroupList].List[${intLoop},3]}
/next intLoop
}
/echo Points Available = ${Me.GroupLeaderPoints} Exp = ${Me.GroupLeaderExp}/330 (${Me.PctGroupLeaderExp}%)
/return