All binds completed
This commit is contained in:
parent
a98568827e
commit
1476754b82
2 changed files with 110 additions and 12 deletions
118
binds.lua
118
binds.lua
|
@ -15,30 +15,128 @@ local function setBindingRM(key, action)
|
|||
else
|
||||
print("Failed to set binding " .. key .. " to " .. action);
|
||||
end
|
||||
SaveBindings(1);
|
||||
end
|
||||
|
||||
-- https://wowpedia.fandom.com/wiki/BindingID
|
||||
local myBinds = {
|
||||
-- Movement
|
||||
["A"] = "STRAFELEFT",
|
||||
["D"] = "STRAFERIGHT",
|
||||
|
||||
-- Character and bag toggles, since c and b are used for strafing
|
||||
["F1"] = "TOGGLEBACKPACK",
|
||||
["F2"] = "TOGGLECHARACTER0",
|
||||
|
||||
["-"] = "CAMERAZOOMOUT",
|
||||
["+"] = "CAMERAZOOMIN",
|
||||
|
||||
-- Action Bar 1
|
||||
["1"] = "ACTIONBUTTON1",
|
||||
["2"] = "ACTIONBUTTON2",
|
||||
["3"] = "ACTIONBUTTON3",
|
||||
["4"] = "ACTIONBUTTON4",
|
||||
["5"] = "ACTIONBUTTON5",
|
||||
["6"] = "ACTIONBUTTON6",
|
||||
["SHIFT-1"] = "ACTIONBUTTON7",
|
||||
["SHIFT-2"] = "ACTIONBUTTON8",
|
||||
["SHIFT-3"] = "ACTIONBUTTON9",
|
||||
["SHIFT-4"] = "ACTIONBUTTON10",
|
||||
["SHIFT-5"] = "ACTIONBUTTON11",
|
||||
["SHIFT-6"] = "ACTIONBUTTON12",
|
||||
|
||||
-- Action Bar 2
|
||||
["BUTTON5"] = "MULTIACTIONBAR1BUTTON1",
|
||||
["BUTTON4"] = "MULTIACTIONBAR1BUTTON2",
|
||||
["SHIFT-BUTTON5"] = "MULTIACTIONBAR1BUTTON3",
|
||||
["SHIFT-BUTTON4"] = "MULTIACTIONBAR1BUTTON4",
|
||||
["CTRL-BUTTON5"] = "MULTIACTIONBAR1BUTTON5",
|
||||
["CTRL-BUTTON4"] = "MULTIACTIONBAR1BUTTON6",
|
||||
["BUTTON3"] = "MULTIACTIONBAR1BUTTON7",
|
||||
["SHIFT-BUTTON3"] = "MULTIACTIONBAR1BUTTON8",
|
||||
["CTRL-BUTTON3"] = "MULTIACTIONBAR1BUTTON9",
|
||||
["§"] = "MULTIACTIONBAR1BUTTON10",
|
||||
["SHIFT-§"] = "MULTIACTIONBAR1BUTTON11",
|
||||
["CTRL-§"] = "MULTIACTIONBAR1BUTTON12",
|
||||
|
||||
-- Action Bar 3
|
||||
["Q"] = "MULTIACTIONBAR2BUTTON1",
|
||||
["E"] = "MULTIACTIONBAR2BUTTON2",
|
||||
["R"] = "MULTIACTIONBAR2BUTTON3",
|
||||
["T"] = "MULTIACTIONBAR2BUTTON4",
|
||||
["F"] = "MULTIACTIONBAR2BUTTON5",
|
||||
["G"] = "MULTIACTIONBAR2BUTTON6",
|
||||
["SHIFT-Q"] = "MULTIACTIONBAR2BUTTON7",
|
||||
["SHIFT-E"] = "MULTIACTIONBAR2BUTTON8",
|
||||
["SHIFT-R"] = "MULTIACTIONBAR2BUTTON9",
|
||||
["SHIFT-T"] = "MULTIACTIONBAR2BUTTON10",
|
||||
["SHIFT-F"] = "MULTIACTIONBAR2BUTTON11",
|
||||
["SHIFT-G"] = "MULTIACTIONBAR2BUTTON12",
|
||||
|
||||
-- Action Bar 4
|
||||
["S"] = "MULTIACTIONBAR3BUTTON1",
|
||||
["Z"] = "MULTIACTIONBAR3BUTTON2",
|
||||
["X"] = "MULTIACTIONBAR3BUTTON3",
|
||||
["C"] = "MULTIACTIONBAR3BUTTON4",
|
||||
["V"] = "MULTIACTIONBAR3BUTTON5",
|
||||
["B"] = "MULTIACTIONBAR3BUTTON6",
|
||||
["SHIFT-S"] = "MULTIACTIONBAR3BUTTON7",
|
||||
["SHIFT-Z"] = "MULTIACTIONBAR3BUTTON8",
|
||||
["SHIFT-X"] = "MULTIACTIONBAR3BUTTON9",
|
||||
["SHIFT-C"] = "MULTIACTIONBAR3BUTTON10",
|
||||
["SHIFT-V"] = "MULTIACTIONBAR3BUTTON11",
|
||||
["SHIFT-B"] = "MULTIACTIONBAR3BUTTON12",
|
||||
|
||||
-- Action Bar 5
|
||||
["CTRL-Q"] = "MULTIACTIONBAR4BUTTON1",
|
||||
["CTRL-E"] = "MULTIACTIONBAR4BUTTON2",
|
||||
["CTRL-R"] = "MULTIACTIONBAR4BUTTON3",
|
||||
["CTRL-T"] = "MULTIACTIONBAR4BUTTON4",
|
||||
["CTRL-F"] = "MULTIACTIONBAR4BUTTON5",
|
||||
["CTRL-G"] = "MULTIACTIONBAR4BUTTON6",
|
||||
["CTRL-1"] = "MULTIACTIONBAR4BUTTON7",
|
||||
["CTRL-2"] = "MULTIACTIONBAR4BUTTON8",
|
||||
["CTRL-3"] = "MULTIACTIONBAR4BUTTON9",
|
||||
["CTRL-4"] = "MULTIACTIONBAR4BUTTON10",
|
||||
["CTRL-5"] = "MULTIACTIONBAR4BUTTON11",
|
||||
["CTRL-6"] = "MULTIACTIONBAR4BUTTON12",
|
||||
}
|
||||
|
||||
local function setAllBinds()
|
||||
setBindingRM("CTRL-2", "ACTIONBUTTON1");
|
||||
setBindingRM("1", "ACTIONBUTTON2");
|
||||
print("Bindings set")
|
||||
for key, action in pairs(myBinds) do
|
||||
setBindingRM(key, action)
|
||||
end
|
||||
print("Bindings set. Run /binds permanent to save them permanently.")
|
||||
end
|
||||
|
||||
-- Define a function to handle the /hello command
|
||||
local function HelloCommandHandler(msg, editbox)
|
||||
local function BindsHandler(msg, editbox)
|
||||
if msg == "permanent" then
|
||||
SaveBindings(1)
|
||||
print("Bindings saved permanently. Enjoy!")
|
||||
return
|
||||
end
|
||||
if msg == "reset" then
|
||||
for key, action in pairs(myBinds) do
|
||||
unsetBinding(action)
|
||||
end
|
||||
print("Bindings reset. Run /binds to set them again.")
|
||||
return
|
||||
end
|
||||
if msg == "" then
|
||||
setAllBinds()
|
||||
return
|
||||
end
|
||||
if msg == "help" then
|
||||
print("Usage: /binds [ permanent | bars | reset | help ]")
|
||||
return
|
||||
end
|
||||
if msg == "bars" then
|
||||
print("\124cFFFF0000THIS DOESENT WORK YET\124r")
|
||||
SetActionBarToggles(1, 1, 1, 1);
|
||||
MultiActionBar_Update();
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- message('loaded')
|
||||
print("test")
|
||||
|
||||
-- Register the /hello command
|
||||
SLASH_BINDS1 = "/binds"
|
||||
SlashCmdList["BINDS"] = HelloCommandHandler
|
||||
SlashCmdList["BINDS"] = BindsHandler
|
|
@ -1,5 +1,5 @@
|
|||
## Interface: 30403
|
||||
## Title: Binds Addon
|
||||
## Title: ImbusBindings
|
||||
## Author: Imbus
|
||||
## Version: 0.1
|
||||
|
||||
|
|
Loading…
Reference in a new issue