Page 1 of 1

Instant Forfeit Macro

Posted: December 16th, 2012, 3:45 pm
by Iconyx
/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.

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 12:42 am
by Ryazan
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.

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 1:21 am
by Syrrie
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.

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 5:29 am
by Ryazan
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

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 6:43 am
by Quintessence
Adding this to my macro list, thanks!

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 7:11 am
by Puluz
adding this, thanks! =)

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 11:14 am
by Ryazan
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 :)

Re: Instant Forfeit Macro

Posted: December 17th, 2012, 2:47 pm
by Imthedci
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:

Re: Instant Forfeit Macro

Posted: December 18th, 2012, 12:40 am
by Ryazan
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. :)

Re: Instant Forfeit Macro

Posted: December 18th, 2012, 5:24 am
by Jeykama
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.

Re: Instant Forfeit Macro

Posted: December 18th, 2012, 5:53 am
by Ryazan
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

Re: Instant Forfeit Macro

Posted: May 29th, 2014, 7:36 am
by Mykro9
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!

Re: Instant Forfeit Macro

Posted: May 29th, 2014, 1:09 pm
by Peanutty
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.