Sellorio / mega-macro

A World of Warcraft AddOn that replaces the built in macro functionality allowing more and bigger macros.
20 stars 13 forks source link

EditMacro() api seems to not be supported #230

Open LynnHeart opened 1 day ago

LynnHeart commented 1 day ago

EditMacro

EditMacro creating new macros

EditMacro script i am trying to run /run local n=UnitName("mouseover") or "player" if not InCombatLockdown() then EditMacro("PI",nil,nil,"#showtooltip\n/use [@mouseover,help,nodead][@"..n.."]Power Infusion\n/use Power Infusion") end

i have disabled the addon and it updates a macro named "PI" correctly

uninstall error

assuming the function runs correctly untampered, EditMacro seems to break the uninstall feature.

Message: ...ce/AddOns/MegaMacro/src/engine/mega-macro-engine.lua:65: attempt to index local 'macro' (a nil value)
Time: Mon Oct 21 11:23:12 2024
Count: 1
Stack: ...ce/AddOns/MegaMacro/src/engine/mega-macro-engine.lua:65: attempt to index local 'macro' (a nil value)
[string "@Interface/AddOns/MegaMacro/src/engine/mega-macro-engine.lua"]:65: in function <...ce/AddOns/MegaMacro/src/engine/mega-macro-engine.lua:63>
[string "@Interface/AddOns/MegaMacro/src/engine/mega-macro-engine.lua"]:543: in function `Uninstall'
[string "@Interface/AddOns/MegaMacro/src/windows/mega-macro.window.lua"]:855: in function `OnAccept'
[string "@Interface/AddOns/Blizzard_StaticPopup/Mainline/StaticPopup.lua"]:1016: in function `StaticPopup_OnClick'
[string "*StaticPopup.xml:23_OnClick"]:1: in function <[string "*StaticPopup.xml:23_OnClick"]:1>

Locals: macro = nil
macroIndex = 1
macroIndex = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index local 'macro' (a nil value)"
MacroIndexCache = <table> {
 1 = 27
 2 = 28
 3 = 29
 4 = 30
 5 = 31
 6 = 32
 7 = 8
 8 = 9
 9 = 33
 10 = 34
 11 = 35
 12 = 36
 13 = 37
 14 = 38
 15 = 39
 16 = 40
 17 = 41
 18 = 42
 19 = 43
 20 = 44
 21 = 22
 22 = 55
 23 = 24
 24 = 56
 25 = 57
 26 = 58
 27 = 25
 28 = 23
 29 = 21
 30 = 20
 31 = 59
 32 = 60
 33 = 61
 34 = 62
 35 = 17
 36 = 63
 37 = 64
 38 = 15
 39 = 14
 40 = 13
 41 = 12
 42 = 11
 43 = 10
 44 = 7
 45 = 6
 46 = 5
 47 = 4
 48 = 3
 49 = 2
 50 = 65
 51 = 26
 52 = 66
 53 = 67
 54 = 1
 55 = 16
 56 = 68
 57 = 69
 58 = 70
 59 = 18
 60 = 19
 61 = 46
 62 = 53
 63 = 45
 64 = 47
 65 = 51
 66 = 52
 67 = 48
 68 = 49
 69 = 54
 70 = 50
 121 = 121
 122 = 122
 123 = 123
 124 = 124
 125 = 125
 126 = 126
 127 = 127
 128 = 128
 131 = 142
 135 = 146
 139 = 147
 143 = 131
 147 = 136
 151 = 71
 159 = 135
 132 = 143
 136 = 148
 140 = 137
 144 = 134
 148 = 130
 152 = 72
 129 = 140
 133 = 144
 137 = 149
 141 = 133
 145 = 138
 149 = 129
 153 = 73
 130 = 141
 134 = 145
 138 = 150
 142 = 132
 146 = 139
}
Sellorio commented 1 day ago

Yeah MegaMacro owns all macro slots for its functionality sadly. I really couldn't find a better way to do this due to the fact that internal macro ids are not available in the apis meaning macros would end up removed from action bars when adding/removing macros. Sorry I'm not explaining it very well - it's quite a complex situation.

There should be an Edit Macro equivalent that is part of Mega Macro which should allow you to do what you're wanting to do.