Instant Forfeit Macro

Discuss pet battles, strategy and theorycrafting.
Post Reply
User avatar
Iconyx
Posts:56
Joined:December 15th, 2012
Pet Score:2660
Realm:Magtheridon-us
Contact:
Instant Forfeit Macro

Post by Iconyx » December 16th, 2012, 3:45 pm

/run C_PetBattles.ForfeitGame()

Copy the above text to your clipboard. If you enter a pet battle that you don't want to finish, hit RETURN then CTRL-V then RETURN. No need to click the "Forfeit" button, and no confirmation box appears. Thanks goes to Ro from BNET forums.

User avatar
Ryazan
MVP
Posts:251
Joined:February 24th, 2011
Pet Score:13560
Realm:Ragnaros-eu
Contact:

Re: Instant Forfeit Macro

Post by Ryazan » December 17th, 2012, 12:42 am

Thanks for this, I've been looking something similar to reduce the excess clicking. Would be nice to get this in macro but first I need to look is there even a way to use macros due to the pet battle UI.
- Taking your candles since 2005

User avatar
Syrrie
MVP
Posts:152
Joined:August 10th, 2008
Pet Score:6201
BattleTag®:Syrrie#1506
Realm:Silver Hand-us
Contact:

Re: Instant Forfeit Macro

Post by Syrrie » December 17th, 2012, 1:21 am

Ryazan wrote:Thanks for this, I've been looking something similar to reduce the excess clicking. Would be nice to get this in macro but first I need to look is there even a way to use macros due to the pet battle UI.
Just tested this in game and it works to paste it into a macro and keybind the macro.
Image Image

User avatar
Ryazan
MVP
Posts:251
Joined:February 24th, 2011
Pet Score:13560
Realm:Ragnaros-eu
Contact:

Re: Instant Forfeit Macro

Post by Ryazan » December 17th, 2012, 5:29 am

Theaah wrote:
Ryazan wrote:Thanks for this, I've been looking something similar to reduce the excess clicking. Would be nice to get this in macro but first I need to look is there even a way to use macros due to the pet battle UI.
Just tested this in game and it works to paste it into a macro and keybind the macro.
Awesome, things are working out smoothly today despite it's Monday. :o
- Taking your candles since 2005

User avatar
Quintessence
Site Admin
Posts:2783
Joined:June 4th, 2008
Pet Score:14797
Realm:Proudmoore-us
Contact:

Re: Instant Forfeit Macro

Post by Quintessence » December 17th, 2012, 6:43 am

Adding this to my macro list, thanks!
Image
Feel free to browse through my pet collecting blog: http://wowpetaddiction.blogspot.com

User avatar
Puluz
Posts:39
Joined:December 30th, 2009
Pet Score:10206
Realm:Darksorrow-eu
Contact:

Re: Instant Forfeit Macro

Post by Puluz » December 17th, 2012, 7:11 am

adding this, thanks! =)

User avatar
Ryazan
MVP
Posts:251
Joined:February 24th, 2011
Pet Score:13560
Realm:Ragnaros-eu
Contact:

Re: Instant Forfeit Macro

Post by Ryazan » December 17th, 2012, 11:14 am

After seeing this, I thought that if there's a command to forfeit then there must be a command for skipping your turn too. I digged the API a bit and well well, here is a macro which can be binded for skipping a turn in battle:

/run C_PetBattles.SkipTurn()

And to kick this up a notch, there is also a API command to directly swap certain pet to the battle (currently behind key 4 but then you need to select the pet manually with mouse). So if you create proper macros for these and bind them, you don't ever need to use mouse while battling. :)

/run C_PetBattles.ChangePet(i)

where i is 1, 2 or 3 meaning the respective pet slot in your pet journal.

-----

Ok, sorry, but I'm not done yet. So with all the three macros above you would need to make several new macros (total of 5) and if you are like me, you are getting low on free macro slots. Thus I'll give you two macros which combine the functionality from all the macros above. So the first one:

/run if ( IsShiftKeyDown() ) then C_PetBattles.ForfeitGame() else C_PetBattles.SkipTurn() end

And what does that macro do? Well, if you press the key binded for it, it will pass your turn but if you press it while shift pressed down, it will forfeit the whole game. Onto the second:

/run if ( IsShiftKeyDown() ) then C_PetBattles.ChangePet(2) elseif ( IsAltKeyDown() ) then C_PetBattles.ChangePet(3) else C_PetBattles.ChangePet(1) end

This is pretty straight-forward too: if you press your macro, it will swap in pet 1 but if you press shift while at it, it will swap pet 2 aaaaaand finally if pressed with alt down it will swap in pet 3.

If you want to use control instead, you can use IsControlKeyDown() in the macros above instead.

Enjoy these, I'm off to play around a bit with them :)
- Taking your candles since 2005

User avatar
Imthedci
Posts:189
Joined:April 7th, 2012
Pet Score:2862
Realm:Gilneas-us
Contact:

Re: Instant Forfeit Macro

Post by Imthedci » December 17th, 2012, 2:47 pm

I also remember seeing an addon somewhere that would do this for you. Not sure what it's called or if it works, but I'm sure it exists... :lol:

User avatar
Ryazan
MVP
Posts:251
Joined:February 24th, 2011
Pet Score:13560
Realm:Ragnaros-eu
Contact:

Re: Instant Forfeit Macro

Post by Ryazan » December 18th, 2012, 12:40 am

Imthedci wrote:I also remember seeing an addon somewhere that would do this for you. Not sure what it's called or if it works, but I'm sure it exists... :lol:
If I got to choose between a macro and an addon which would do this, I'd go hands down for the macro. :)
- Taking your candles since 2005

User avatar
Jeykama
Posts:37
Joined:October 9th, 2012
Realm:Frostwolf-us
Contact:

Re: Instant Forfeit Macro

Post by Jeykama » December 18th, 2012, 5:24 am

http://wow.curseforge.com/addons/battle-pet-binds/
(or look up Battle Pet Binds on Curse, though the one on Curseforge is probably the updated version)

Brought to you by Simca, the guy(?) that brought us the math on pet breeds in the first place. This addon keybinds stuff you can't normally keybind in the pet battle UI, like picking pets for swaps, passing, and instantly forfeiting. Also includes easy instructions on how to change the keybinds to your liking.

Lets me pet battle without a mouse, and for that I'm super grateful he wrote it.

User avatar
Ryazan
MVP
Posts:251
Joined:February 24th, 2011
Pet Score:13560
Realm:Ragnaros-eu
Contact:

Re: Instant Forfeit Macro

Post by Ryazan » December 18th, 2012, 5:53 am

That looks good indeed, gonna give it a test run.

There's always someone one step ahead of you, so I'll take my previous comment back. :p
- Taking your candles since 2005

User avatar
Mykro9
MVP
Posts:201
Joined:November 3rd, 2012
Pet Score:4355
BattleTag®:mykro9#1585
Realm:Darrowmere-us
Contact:

Re: Instant Forfeit Macro

Post by Mykro9 » May 29th, 2014, 7:36 am

I hate to sound stupid, but how do I use the key I bind this to when the pet battle UI is up?

Example: I keybind this to say <shift+9> and hit the shift key plus the number 9 and I get nothing.

edit:
Nevermind, I just installed the 'Battle Pet Binds' add-on,
Go to Menu>Interface>AddOns>Battle Pet Binds
Click on any of the red bars, then hit what ever key you want to use.
I chose to make 6 my forfeit button, and there is a check box at the bottom, so if you want to get the confirmation dialogue before you forfeit so you don't accidentally forfeit, you have to hit 6 (for me) again to complete the forfeit. If you just want to forfeit, don't check the box at the bottom.

Genius!
mykro9#1585

User avatar
Peanutty
Posts:1342
Joined:May 3rd, 2011
Pet Score:9635
Realm:Kil'jaeden-us
Contact:

Re: Instant Forfeit Macro

Post by Peanutty » May 29th, 2014, 1:09 pm

I've been using Battle Pet Binds as well, so for anyone who wants to go with the addon route that really is a super easy way to bind all the pet battle UI functions to keyboard. I don't know why the default pet battle UI isn't set up this way... it seems counter intuitive to have some things bound to keys and have a bunch of others (i.e. forfeit) require clicking.

Post Reply