TreeK
New Member
- Joined
- Jul 10, 2012
- Messages
- 170
The following snippet is similar to what I have been using to complete the Pandaria battle pet dailies. It is based on the profiles in this thread, with a few changes requested by others.
The major change is the addition of macros to select the pets used for a battle:
To use this, each user will need to determine which pets of theirs they want to use for a fight, get the unique ID for each pet and convert it from the ID shown in pokehbuddy to hex. You will end up with a string similar to "0x0000000000FFFFFF" which is then copied in place of the "0x0000000000000000" in each macro. Also note that the hex string should be enclosed with encoded single quotes (') like this: '0x0000000000000000' . Not sure how that will display in the code section.
To convert a number to hex, open the calculator, change to Programmer in the view menu, check the "Dec" option and enter the ID as shown in pokehbuddy, then select the "Hex" option. There is your hex number. You will need to pad the number with leading zeros to make sure the string is 16 characters (which is a requirement of the SetPetLoadOutInfo() API) and then add an "0x" for good measure.
In pokehbuddy, the battle distance should be set to "0" unless you want to spend hours battling pets as you move from trainer to trainer. The profile starts the pet battle, and pokehbuddy will take over once the battle starts.
It is easy enough to add the other trainers in whatever order you want using this as a template.
There probably should be code added to handle the case where you lose a battle, but I don't think I have lost a fight since using the profile, so I never bothered.
The major change is the addition of macros to select the pets used for a battle:
Code:
<CustomBehavior File="RunMacro" Macro="/script C_PetJournal.SetPetLoadOutInfo(1, '0x0000000000000000')" />
To convert a number to hex, open the calculator, change to Programmer in the view menu, check the "Dec" option and enter the ID as shown in pokehbuddy, then select the "Hex" option. There is your hex number. You will need to pad the number with leading zeros to make sure the string is 16 characters (which is a requirement of the SetPetLoadOutInfo() API) and then add an "0x" for good measure.
In pokehbuddy, the battle distance should be set to "0" unless you want to spend hours battling pets as you move from trainer to trainer. The profile starts the pet battle, and pokehbuddy will take over once the battle starts.
Code:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<HBProfile>
<Name>Pandarian Pet Trainers</Name>
<MinDurability>0</MinDurability>
<MinFreeBagSlots>0</MinFreeBagSlots>
<MinLevel>0</MinLevel>
<MaxLevel>91</MaxLevel>
<SellGrey>False</SellGrey>
<SellWhite>False</SellWhite>
<SellGreen>False</SellGreen>
<SellBlue>False</SellBlue>
<SellPurple>False</SellPurple>
<MailGrey>False</MailGrey>
<MailWhite>False</MailWhite>
<MailGreen>False</MailGreen>
<MailBlue>False</MailBlue>
<MailPurple>False</MailPurple>
<AvoidMobs />
<Blackspots />
<Vendors />
<QuestOrder>
<!-- Courageous Yon-->
<If Condition="!HasQuest(31956) && !IsQuestCompleted(31956)">
<CustomBehavior File="RunMacro" Macro="/cast Revive Battle Pets" />
<CustomBehavior File="FlyTo" X="2525" Y="2595" Z="852" DestName="Courageous Yon" />
<CustomBehavior File="RunMacro" Macro="/dismount" />
<CustomBehavior File="RunMacro" Macro="/cancelaura" />
<CustomBehavior File="RunMacro" Macro="/script C_PetJournal.SetPetLoadOutInfo(1, '0x0000000000000000')" />
<CustomBehavior File="RunMacro" Macro="/script C_PetJournal.SetPetLoadOutInfo(2, '0x0000000000000000')" />
<CustomBehavior File="RunMacro" Macro="/script C_PetJournal.SetPetLoadOutInfo(3, '0x0000000000000000')" />
<PickUp QuestName="Grand Master Yon" QuestId="31956" GiverId="66738" GiverName="Courageous Yon" X="2546.454" Y="2596.291" Z="851.7788"/>
<CustomBehavior File="InteractWith" MobId="66738" QuestId="31956" X="2546.454" Y="2596.291" Z="851.7788" />
<CustomBehavior File="WaitTimer" WaitTime="1000" />
<CustomBehavior File="RunMacro" Macro="/click GossipTitleButton3" NumOfTimes="1" WaitTime="5000"/>
<CustomBehavior File="WaitTimer" WaitTime="1000" />
<CustomBehavior File="RunMacro" Macro="/click StaticPopup1Button1" NumOfTimes="1" WaitTime="5000"/>
<CustomBehavior File="WaitTimer" WaitTime="120000" />
<TurnIn Nav="Fly" QuestId="31956" TurnInId="66738" TurnInName="Courageous Yon" QuestName="Grand Master Yon" X="2546.454" Y="2596.291" Z="851.7788" />
</If>
<!-- ADD OTHER TRAINERS HERE -->
</QuestOrder>
</HBProfile>
It is easy enough to add the other trainers in whatever order you want using this as a template.
There probably should be code added to handle the case where you lose a battle, but I don't think I have lost a fight since using the profile, so I never bothered.