BuyLA.mac -- Purchase Leadership Abilities

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Tor Katall
a lesser mummy
a lesser mummy
Posts: 42
Joined: Wed Aug 20, 2008 11:07 pm

BuyLA.mac -- Purchase Leadership Abilities

Post by Tor Katall » 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

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
~ TK

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 6:30 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 6:31 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 6:32 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 6:33 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 6:35 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 6:36 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:13 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:14 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:15 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:16 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:17 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:18 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:20 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: BuyLA.mac -- Purchase Leadership Abilities

Post by xyilla » Sun Aug 31, 2025 7:21 pm