Thread Tools Display Modes
12/16/14, 04:08 AM   #1
Sir Tigär
Join Date: Jul 2014
Posts: 9
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
  Reply With Quote
12/16/14, 07:06 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
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.
  Reply With Quote
12/17/14, 06:11 AM   #3
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
Originally Posted by Sir Tigär View Post
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
  Reply With Quote
12/17/14, 06:32 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
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.
  Reply With Quote
12/17/14, 07:18 AM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Sir Tigär View Post
Do i get the Information in LUA, if i Drawn/sheathe weapon in Game?
No, there is no such thing.

Originally Posted by Shinni View Post
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.
  Reply With Quote
01/14/15, 02:50 PM   #6
Kelnoreem
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 11
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?
  Reply With Quote
02/19/15, 01:32 PM   #7
Weolo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 79
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)
  Reply With Quote
12/11/15, 09:41 AM   #8
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 53
Is there a reason that there is no EVENT_WIELD_CHANGED or similar? Could it be exploited?
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Drawn/sheathe weapon in Lua:


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