Мировые марки (World Marker "/wm 1-8" cycle macro)

Потерял надежду, ищу помощи от доброжелателей. Пользовался макросом который ставил на землю мировые маркеры (world marker) одним биндом, циклом (от 1 до 8)
Пару примеров макроса:

/click ActionButton8 Button5
/run local b=ActionButton8 _MH=_MH or(b:SetAttribute(“*type5”,“macro”)or SecureHandlerWrapScript(b,“PreClick”,b,‘Z=IsShiftKeyDown()and 0 or(Z or 0)%5+1 self:SetAttribute(“macrotext5”,“/cwm [mod]all\10/wm [nomod]”…Z)’))or 1`

/cwm [mod] all
/click ActionButton8 Button5
/run local b=ActionButton8 _MH=_MH or(b:SetAttribute(“*type5”,“macro”)or SecureHandlerWrapScript(b,“PreClick”,b,‘Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’))or 1

Раньше, с небольшими ошибками, которые исправлялись после /reload - всё работало, с выходом 10.0.0 - перестало, как исправить не знаю.

  1. Проверил через LUA error, ошибок не найдено.
  2. Смена значений не помогает.
  3. Toolkit ошибок не нашел.
  4. Reddit молчит или отвечает постами двухлетней давности.
  5. Видео на youtube тоже старое и ошибки не исправляет.

Кто умеет в буквы, помогите дописать макрос, хотя бы с расширением символов больше 255.

Вот пример макроса на метки, по маусоверу и каждая следующая цель будет с новой меткой - не убирая старую. Для удобного и быстрого обозначения - (например в кого играть)

/script if (charm == nil) or (charm < 0) then charm=9; end; charm=charm-1; SetRaidTarget(“mouseover”, charm)

PS Прошу вас - милые люди, не советуйте мне “DejaMark”, “OPie” и аналоги. Вся суть макроса, что бы делать марку быстро - одним биндом, а не через /wm 1 (и ещё 7) - Заранее огромное спасибо <3

(Если кто-то сможет качественно перевести, что там происходит и суть изложить кратко - было бы восхитительно)

Линканутый топик не читал, но могу поделиться инфой.
Метод работы параметра ActionButtonUseKeyDown поменялся и это вызывает некоторые проблемы у всего подряд, что завязано на кликах: кнопки, макросы, лайки на ютюбе…

Конкретно для макросов это означает, что нужно передавать или не передавать параметр нажимаемой кнопки в зависимости от значения параметра.

/dump GetCVar("ActionButtonUseKeyDown")
Если ответ [1]="0", то кнопку посылать не надо и /click ActionButton8 должен работать, если там [1]="1" - /click ActionButton8 Button5 должен по законам логики быть верным вариантом

2 лайка

Во первых, большое спасибо за ответ - я потерял всякую надежду. Во вторых, /dump GetCVar("ActionButtonUseKeyDown") ответ [1]="0", макрос переделал так:

/click ActionButton8
/run local b=ActionButton8 _MH=_MH or(b:SetAttribute(“*type5”,“macro”)or SecureHandlerWrapScript(b,“PreClick”,b,‘Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’))or 1

/cwm [mod] all
/click ActionButton8
/run local b=ActionButton8 _MH=_MH or(b:SetAttribute(“*type5”,“macro”)or SecureHandlerWrapScript(b,“PreClick”,b,‘Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’))or 1

/cwm [mod] all
/run local b=ActionButton8 _MH=_MH or(b:SetAttribute(“*type5”,“macro”)or SecureHandlerWrapScript(b,“PreClick”,b,‘Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’))or 1
/click ActionButton8

Все начали активировать бинт принадлежащий ActionButton8, но путь дальше не идёт. Макрос не продолжает работу и не ставить World Marker. Возможно есть какие ошибке в самом скрипте? Возможен ли - лишний пробел или другой знак? (Lua не оповещает меня об ошибке, прочие расхождения я устранил)

Hi.

I described a possible solution in this thread on mmo-champion: 2629355-one-button-world-marker-macro-is-rip.
I cannot post links, but if you just google this thread-ID you will find the thread on mmo-champion. Otherwise the prefix is mmo-champion(DOT)com/threads/

You will have to use an addon like Details! in order to run an initial script that enables the one-button macro. It’s the same script that is run in the macro you posted, however with the new required changes in DF you need to call an additional function for the button click registering to work. And if calling that function you are above the 255 character limit.
However, I think most people use Details!, so that should be fine. If you don’t, then you could also put the code that is supposed to go into Details! into another macro and press this macro once every time you reload your UI. You could also use any other addon, all the addon has to do is execute given code when the UI is first loaded. Any addon can do that, people just use Details! because most people have it and it already offers this functionality.

Sorry for english, but I do not speak russian. I saw this thread because I was trying to solve the same problem. I managed to fix the problem, so I wanted to help out. I found the solution to the problem because similar issues were discussed here: https://us.forums.blizzard.com/en/wow/t/dragonflight-click-bindings-broken/1361972
It’s not related to the specific WM macro, but it explains why you need an additional line of code in order to register the button action.

3 лайка

World markers or how to put eight markers on the ground using one macro.

  1. Installing the Details!
  2. In the game, write the command /details options
  3. In the left toolbar, select Auto Run Code
  4. In the left corner corner Details! Run Code see Event: select On Initilization
  5. In the "Details! Run Code`, copy/paste the following script in the last line:

local btn = CreateFrame(“Button”, “myWmCycleButton”, UIParent, “SecureActionButtonTemplate”);
button:SetAttribute(“*type5”,“macro”)
button:Hide();
btn:RegisterForClicks(“AnyDown”); – this is new
SecureHandlerWrapScript(btn,“PreClick”,btn,‘Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’) ;

  1. In the upper right corner of the Details! Run the code, click on the Savebutton (In the game chat, the inscriptionDetails!: The code is saved!`
  2. We write a command in the chat /macro and create a new macro:

/cwm [mod] all
/press myWmCycleButton5 button down

  1. If the macro doesn’t work, /reload should fix the problem.

Мировые метки или как поставить восемь меток на землю с использованием одного макроса.

  1. Устанавливаем Details!
  2. В игре прописываем команду /details options
  3. В левой панели инструментов выбираем Auto Run Code
  4. В левом углу угла Details! Run Code видим Event: выбираем On Initilization
  5. В окне Details! Run Code, последней строчкой копируем\вставляем следующий скрипт:

local btn = CreateFrame(“Button”, “myWmCycleButton”, UIParent, “SecureActionButtonTemplate”);
button:SetAttribute(“*type5”,“macro”)
button:Hide();
btn:RegisterForClicks(“AnyDown”); – this is new
SecureHandlerWrapScript(btn,“PreClick”,btn,‘Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’) ;

  1. В правом верхнем углу окна Details! Run Code, нажимаем на кнопку Save (В чате игры должна появиться надпись Details!: The code is saved!
  2. Пишем команду в чате /macro и создаём новый макрос:

/cwm [mod] all
/press myWmCycleButton5 button down

  1. Если макрос не сработает, /reload должен помочь решить проблему.

8.1

/run SetCVar(“ActionButtonUseKeyDown”,“1”)
/run SetCVar(“ActionButtonUseKeyDown”,“0”)

Is it possible that your keybind for the macro uses a modifier? There still seems to be an issue when you keybind the macro on something with a modifier (like shift + 1, … ). Can you try keybinding it to a simple keybind instead (anything that doesnt include a modifier like shift, alt, control).

Edit: Also be careful when you paste the script from this forum. You can see that the quotation marks (") are changed in the code you posted. When you paste your code from this website into Details! it wont work and show you a syntax-error at the bottom, because this forum screws up the quotation marks (or maybe the way you copied them messed it up, don’t know). But if you copy + paste from the mmo-champion thread it should be fine, since their code-blocks don’t mess up the quotes. Just pay attention to the quotation marks, you can see that in the code you posted they look slightly different visually " vs ”.

Edit 2: You can fix the issue with the modifier-keybind if you remove the ‘[nomod]’ part in the second argument of the self:SetAttribute call. You should then probably change the first line of the macro from /cwm [mod] all to /cwm [mod:alt] all. Then you can use alt + your keybind to remove all existing markers and your regular keybind for placing them. So if your keybind is shift +1, you can place them with shift +1 and remove them all with alt + shift +1.

2 лайка

Благодарю всех участников в работе над ошибками! Алилуйя! Всё заработало! Дальше я опишу процедуру:

Мировые метки или как ставить восемь меток на землю с помощью одного макроса.

  1. Устанавливаем Details!
  2. В игре прописываем команду /details options
  3. В левой панели инструментов выбираем Auto Run Code
  4. В левом верхнем углу окна Details! Run Code видим Event: выбираем On Initilization
  5. В окне Details! Run Code, последней строчкой копируем\вставляем следующий скрипт:

local btn = CreateFrame( “Button”, “myWmCycleButton”, UIParent, “SecureActionButtonTemplate” );
btn:SetAttribute(“*type5”,“macro”)
btn:Hide( );
btn:RegisterForClicks(“AnyDown”); – this is new
SecureHandlerWrapScript(btn,“PreClick”,btn,‘Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’);

  1. В правом нижнем углу окна Details! Run Code нажимаем на кнопку Save (В чате игры должна появится надпись Details!: Code saved!
  2. Пишем команду в чате /macro и создаём новый макрос:

/cwm [mod] all
/click myWmCycleButton Button5 Down

  1. Если макрос не сработает, /reload должен помочь решить проблему.

I thank all participants for the work on the bugs! Alleluia! Everything worked! Next, I will describe the result:

World markers or how to put eight markers on the ground using one macro.

  1. Installing the details!
  2. In the game, write the command /details options
  3. In the left toolbar, select Auto Run Code
  4. In the left corner corner Details! Run Code see Event: select On Initilization
  5. In the "Details! Run Code`, copy/paste the following script in the last line:

local btn = CreateFrame(“Button”, “myWmCycleButton”, UIParent, “SecureActionButtonTemplate”);
button:SetAttribute(“*type5”,“macro”)
button:Hide();
btn:RegisterForClicks(“AnyDown”); – this is new
SecureHandlerWrapScript(btn,“PreClick”,btn,‘Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,“/wm [nomod]”…Z)’) ;

  1. In the upper right corner of the Details! Run the code, click on the Savebutton (In the game chat, the inscriptionDetails!: The code is saved!`
  2. We write a command in the chat /macro and create a new macro:

/cwm [mod] all
/press myWmCycleButton5 button down

  1. If the macro doesn’t work, /reload should fix the problem.

PS big thx! Anzeigemord, Mercious <3
PSS Can I change the script so that I use the Alt + command?

Спасибо доброму человеку!

Лайков: 1

Please tell me what can be changed in the script to use the macro through alt+1?

So, by default the macro that I have posted uses the alt modifier to delete all existing world markers. So you can use the keybind that you put the macro into to place new world makers and also to remove all existing world markers, if you additionally press alt.

For example: If you keybind the macro to button 1, then pressing 1 will place a new worldmarker. If you press alt + 1 then you will delete all existing world markers. This way you can remove them.

This works because of the first line in the macro:
/cwm [mod] all

cwm here just stands for “clear world marker”.
As you can see it just says ‘[mod]’, so instead of alt you could also use shift or ctrl. It’s probably better to specify a specific modifier instead, so that for example only alt works:
/cwm [mod:alt] all

Now, it seems that you want to use alt not as a modifier to clear all world markers, but as a part of the regular keybind. So your keybind for the macro is not 1, but your keybind is alt + 1. You should then change the first line of the macro to for example:
/cwm [mod:shift] all

Now instead of using the alt key to clear all world markers, you would use the shift key. So if your macro keybind is alt +1, you can use alt +1 to place world markers and shift + alt + 1 to clear all world markers.
However, you also need to adjust the code you put into Details!:

SecureHandlerWrapScript(btn,"PreClick",btn,'Z=IsAltKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm [nomod]"..Z)');

As you can see in the code above, there is a check for ‘IsAltKeyDown()’. It’s used to reset the counter back to 1, because if you clear all existing world markers you probably want to start at 1 again. So this function needs to be adjusted, because it expects you to use alt to clear the markers and not as part of your keybinds. You can also see in the code above, that the second parameter of self:SetAttribute("macrotext5","/wm [nomod]"..Z) specified ‘[nomod]’. This part makes it so you cant use a modifier as part of your keybinds, because if any modifier is used then nomod will prevent it from working. So, if you want to use alt as part of your keybind and shift in order to clear, we would adjust this line to:
SecureHandlerWrapScript(btn,"PreClick",btn,'Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm "..Z)');

Notice how I replaced ‘IsAltKeyDown()’ with ‘IsShiftKeyDown()’ in order to reflect that you are now using shift to clear. I have also removed the ‘[nomod]’ part, so that you can use a modifier as part of your regular keybind.
So with this setup, you can bind the macro to alt +1. Pressing alt +1 will place a new world marker. Pressing shift + alt + 1 will clear all existing world markers.

You can also remove the clear logic, so it becomes simpler. Then you could use a different macro and keybind to clear. I think after explaining how the logic behind the macro works, you could adjust it yourself. I hope my explanation was clear.

Edit: You could also add a ‘[@cursor]’ so that you don’t have to also left click your mouse in order to place the marker:
SecureHandlerWrapScript(btn,"PreClick",btn,'Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm [@cursor]"..Z)');

Лайков: 1

You are magnificent!

SecureHandlerWrapScript(btn,“PreClick”,btn,‘Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute(“macrotext5”,"/wm "…Z)’);

did what I wanted, thank you very much for your explanation!

ERROR don’t work again :frowning: 18.11.2022