Thread Tools Display Modes
02-14-12, 07:18 AM   #1
Aalwein
A Flamescale Wyrmkin
 
Aalwein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 147
cancelling druid shapeshift

Is there a simple way to execute a command to cancel druid shapeshift? From what I've found in the wiki, CancelShapeshiftForm() is a protected command so I can't just throw it in anywhere.

I'm simply trying to have FollowFelankor call Pokedex whenever a whisper to mount is received. Right now I've simply told FollowFelankor to call "Pokedex:ToggleMount()" when it receives the whisper to mount and it works fine as long as I'm not shapeshifted. I don't know nearly enough Lua code to decipher how Pokedex cancels the shapeshift, but obviously the ToggleMount() function doesn't do it.

Basically, I was hoping to just add a "/cancelform" line right before the Pokedex:ToggleMount(), but I just can't figure out how to do it.

Is this something that can easily be done or am I out of my depth on this? If it is something easy, what line should I add there to cancel the shapeshift?
__________________
Aalwein | Jaberwocky
Die by the Arrow | YouTube | Facebook | Twitter
  Reply With Quote
02-14-12, 09:27 AM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Not possible without hardware input (key or mouse click).

Pokedex is probably using secure frames to do that on a click or keybind or in response to very specific macro conditionals that are allowed to run protected code.
Doing it "automatically" is not possible that's the whole point of protected status.
  Reply With Quote
02-14-12, 01:42 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Dridzt View Post
... Pokedex is probably using secure frames to do that on a click or keybind or in response to very specific macro conditionals that are allowed to run protected code.
Doing it "automatically" is not possible that's the whole point of protected status.
Actually, the CallCompanion() and DismissCompanion() aren't protected functions and could be used as such for mounts, but CancelShapeshift() is protected and can't be used outside of the SecureActionButton templates.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
02-14-12, 02:51 PM   #4
Waky
A Cobalt Mageweaver
 
Waky's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 200
I feel like you're allowed to do /run CancelShapeshiftForm() as long as you click/press the macro. I'm not entirely sure though
  Reply With Quote
02-14-12, 04:18 PM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
I didn't say anything about CallCompanion() the question was specifically about shapeshift.

@Waky:
That also doesn't work but there's /cancelform which is a legitimate macro command.
  Reply With Quote
02-14-12, 06:18 PM   #6
Aalwein
A Flamescale Wyrmkin
 
Aalwein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 147
I figured there wouldn't be an easy solution, if one at all. Thanks for the feedback guys. Guess I just need to remember to get out of cat form before I get up from the computer!

There's no way to emulate a /click via the addon, right? Because the in-game command to run Pokedex is /click PokedexToggleMountButton
__________________
Aalwein | Jaberwocky
Die by the Arrow | YouTube | Facebook | Twitter

Last edited by Aalwein : 02-14-12 at 06:39 PM.
  Reply With Quote
02-14-12, 10:48 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
There is no way for an addon to cancel your shapeshift in response to a whisper. Cancelling a shapeshift is in the same category as casting a spell. It requires a hardware action and a secure execution path (eg. an action button or macro).

You could easily write a macro that did both things:
Code:
/cancelform
/click PokedexToggleMountButton
... but as with any other macro, it cannot be run automatically. You must perform a hardware action (key press or mouse click) in order to run it.
  Reply With Quote
02-15-12, 03:43 AM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Dridzt View Post
I didn't say anything about CallCompanion() the question was specifically about shapeshift.
The part of your comment I quoted, you talked about Pokedex's mount code, which would be handled with calls to CallCompanion() and DismissCompanion(). That part of your statement assuming it was a protected function run by a SecureButtonTemplate was incorrect.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
02-15-12, 05:10 AM   #9
Aalwein
A Flamescale Wyrmkin
 
Aalwein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 147
Originally Posted by Phanx View Post
There is no way for an addon to cancel your shapeshift in response to a whisper. Cancelling a shapeshift is in the same category as casting a spell. It requires a hardware action and a secure execution path (eg. an action button or macro).

You could easily write a macro that did both things:
Code:
/cancelform
/click PokedexToggleMountButton
... but as with any other macro, it cannot be run automatically. You must perform a hardware action (key press or mouse click) in order to run it.
That's what I figured; I wonder why they made removing a shapeshift a protected command. Thanks for the help everyone.
__________________
Aalwein | Jaberwocky
Die by the Arrow | YouTube | Facebook | Twitter
  Reply With Quote
02-15-12, 05:40 AM   #10
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Originally Posted by Aalwein View Post
That's what I figured; I wonder why they made removing a shapeshift a protected command. Thanks for the help everyone.
Druids were abusing the ability to do so in arenas. An addon could automatically cancel your form for you in response to an enemy crowd control spell being cast while you were susceptible due to the form's classification (beast, elemental, etc.).
  Reply With Quote
02-15-12, 07:03 AM   #11
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Originally Posted by SDPhantom View Post
The part of your comment I quoted, you talked about Pokedex's mount code, which would be handled with calls to CallCompanion() and DismissCompanion(). That part of your statement assuming it was a protected function run by a SecureButtonTemplate was incorrect.
That's what happens when you come into a discussion and don't bother to follow it from the start.
Originally Posted by Aalwein View Post
I don't know nearly enough Lua code to decipher how Pokedex cancels the shapeshift
(I don't even run or have looked at Pokedex so I took the OP at his word that Pokedex does cancel forms and his problem was getting a 3rd addon - Follow Felankor - to use Pokedex to do the same) hence I went straight to the point with
Originally Posted by Dridzt View Post
Pokedex is probably using secure frames to do that on a click or keybind or in response to very specific macro conditionals that are allowed to run protected code.
Hope that clears up some confusion for you
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » cancelling druid shapeshift


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off