Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-21-22, 09:15 AM   #1
canceldev
A Defias Bandit
Join Date: Nov 2022
Posts: 2
Shorter Keybinds - Help with old code

Hey guys so this codes been around a while found on https://us.forums.blizzard.com/en/wo...cript/262608/7

I'm trying to get it to work on Dragonflight 100002. So far the following code works only when you mouseover the action buttons individually. I'm not sure how to write something to just make it fire on all action buttons like it used to. Please help

Lua Code:
  1. local function updatehotkey(self, actionButtonType)
  2.  
  3. local hotkey = _G[self:GetName() .. 'HotKey']
  4. local text = hotkey:GetText()
  5.  
  6.     text = string.gsub(text, '(s%-)', 'S')
  7.     text = string.gsub(text, '(a%-)', 'A')
  8.     text = string.gsub(text, '(c%-)', 'C')
  9.     text = string.gsub(text, '(Mouse Button )', 'M')
  10.     text = string.gsub(text, '(Middle Mouse)', 'M3')
  11.     text = string.gsub(text, '(Num Pad )', 'N')
  12.     text = string.gsub(text, '(Page Up)', 'PU')
  13.     text = string.gsub(text, '(Page Down)', 'PD')
  14.     text = string.gsub(text, '(Spacebar)', 'SpB')
  15.     text = string.gsub(text, '(Insert)', 'Ins')
  16.     text = string.gsub(text, '(Home)', 'Hm')
  17.     text = string.gsub(text, '(Y)', '1')
  18.     text = string.gsub(text, '(U)', '2')
  19.     text = string.gsub(text, '(I)', '3')
  20.     text = string.gsub(text, '(O)', '4')
  21.     text = string.gsub(text, '(P)', '5')
  22.     text = string.gsub(text, '(H)', '6')
  23.     text = string.gsub(text, '(J)', '7')
  24.     text = string.gsub(text, '(K)', '8')
  25.     text = string.gsub(text, '(L)', '9')
  26.     --text = string.gsub(text, '(B)', '10')
  27.     text = string.gsub(text, '(N)', '11')
  28.     text = string.gsub(text, '(M)', 'M')
  29.  
  30.     hotkey:SetText(text)
  31.  
  32. end
  33. hooksecurefunc("SetActionUIButton", updatehotkey)
  34. --ActionBarActionButtonMixin:OnEvent(updatehotkey, "UPDATE_BINDINGS")

Ok so this code correctly changes the hotkey but only when you mouse over the action buttons individually. I'm not sure how to have the SetText fire all at once on every button.

I should add I have commented out the OnEvent at the bottom because it doesn't work. I think that's the part I need to figure out to make this work again.

Last edited by canceldev : 11-21-22 at 09:29 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Shorter Keybinds - Help with old code


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