ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Drawn/sheathe weapon in Lua: (https://www.esoui.com/forums/showthread.php?t=4141)

Sir Tigär 12/16/14 04:08 AM

Drawn/sheathe weapon in Lua:
 
Hello guys:
Do i get the Information in LUA, if i Drawn/sheathe weapon in Game?
I couldnt find anything matching in the Globals,Functions etc.. on wiki page.

thanks in advance

greetings :)

merlight 12/16/14 07:06 PM

I think there isn't any event. The add-on StowIt uses EVENT_PLAYER_COMBAT_STATE, but obviously that doesn't trigger if you just press the keybind.

Shinni 12/17/14 06:11 AM

Quote:

Originally Posted by Sir Tigär (Post 17861)
Do i get the Information in LUA, if i Drawn/sheathe weapon in Game?

TogglePlayerWield changes the weapon state. You could do something like this:
Lua Code:
  1. local old_toggle = TogglePlayerWield
  2. TogglePlayerWield = function(...)
  3.     d("weapon state is changed")
  4.     old_toggle(...)
  5. end

sirinsidiator 12/17/14 06:32 AM

I tried to sheathe weapons with my screenshot helper addon automatically when I hide the UI some time after launch without luck.

You could maybe hook some functions, but there are also situations where weapons are drawn because of abilities cast by other players. Until we get an event or an api function for this, there is no reliable way to detect the current state.

Garkin 12/17/14 07:18 AM

Quote:

Originally Posted by Sir Tigär (Post 17861)
Do i get the Information in LUA, if i Drawn/sheathe weapon in Game?

No, there is no such thing.

Quote:

Originally Posted by Shinni (Post 17884)
TogglePlayerWield changes the weapon state. You could do something like this:
Lua Code:
  1. local old_toggle = TogglePlayerWield
  2. TogglePlayerWield = function(...)
  3.     d("weapon state is changed")
  4.     old_toggle(...)
  5. end

You can do that, but it is not accurate. There are events when your character draw or seathe weapon without triggering this function. For example when you start combat, character automatically draws a weapon. When you start interaction, your character automatically sheathe a weapon.
You will have to do more then just this hook.

Kelnoreem 01/14/15 02:50 PM

This thread is covering an area I have started to research. I have been looking for a way to determine when a skill outside of combat is used, such as Rapid Maneuvers, which causes a weapon draw, so an addon can auto sheath it. I understand how to use an in combat call back, but I have not figured out how to do this properly yet. Any ideas?

Weolo 02/19/15 01:32 PM

Are these events any use?

EVENT_ACTIVE_WEAPON_PAIR_CHANGED (integer eventCode, integer activeWeaponPair, bool locked)
EVENT_WEAPON_SWAP_LOCKED (integer eventCode, integer swapLevel)
EVENT_ACTION_SLOTS_FULL_UPDATE (integer eventCode, bool isHotbarSwap)

CaptainBlagbird 12/11/15 09:41 AM

Is there a reason that there is no EVENT_WIELD_CHANGED or similar? Could it be exploited?


All times are GMT -6. The time now is 10:23 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI