WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   /count different depending on right or left click. (https://www.wowinterface.com/forums/showthread.php?t=58068)

pinmouse 06-28-20 07:02 PM

/count different depending on right or left click.
 
Like the title says, I was wondering if it's possible to have a macro for a count-down timer to be different depending on if I right or left-click. I'd like a 10s timer if I left-click, and a 3s timer if I right-click.

Thanks!

Kanegasi 06-28-20 09:22 PM

I'm assuming you're talking about the new countdown feature on the alpha. Unfortunately, the /countdown command does not parse any secure macro options and only accepts numbers. However, you can skip the command and go straight to the function.

Lua Code:
  1. /run if SecureCmdOptionParse("[btn:2]") then C_PartyInfo.DoCountdown(3) else C_PartyInfo.DoCountdown(10) end

Here's the command implementation if anyone's curious:

Lua Code:
  1. SlashCmdList["COUNTDOWN"] = function(msg)
  2.     local num1 = gsub(msg, "(%s*)(%d+)", "%2");
  3.     if(num1 ~= "" and tonumber(num1) <= MAX_COUNTDOWN_SECONDS) then
  4.         C_PartyInfo.DoCountdown(num1);
  5.     end
  6. end

MAX_COUNTDOWN_SECONDS is currently 3600 seconds, or one hour.

pinmouse 06-28-20 10:27 PM

Dbm
 
Actually I meant for using DBM. But this is good to know for the future!

Do you know how to make it work for DBM too?

Thanks! :)

Kanegasi 06-28-20 11:19 PM

Ah, DBM. I was confused by the /count since DBM uses /pull. Same format, different function. Unfortunately, DBM doesn't expose its pull function, but we can use the registered SlashCmdList function instead.

Lua Code:
  1. /run if SecureCmdOptionParse("[btn:2]") then SlashCmdList["DEADLYBOSSMODS"]("pull 3") else SlashCmdList["DEADLYBOSSMODS"]("pull 10") end

pinmouse 06-29-20 05:14 PM

Quote:

Originally Posted by Kanegasi (Post 336246)
Ah, DBM. I was confused by the /count since DBM uses /pull. Same format, different function. Unfortunately, DBM doesn't expose its pull function, but we can use the registered SlashCmdList function instead.

Lua Code:
  1. /run if SecureCmdOptionParse("[btn:2]") then SlashCmdList["DEADLYBOSSMODS"]("pull 3") else SlashCmdList["DEADLYBOSSMODS"]("pull 10") end

Oh man! It is /pull... brain fart on my part! Sorry about that! :rolleyes:

P.S.
Your macro worked great! Thanks!!!


All times are GMT -6. The time now is 10:55 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI