Thread Tools Display Modes
06-28-20, 07:02 PM   #1
pinmouse
A Murloc Raider
Join Date: Jul 2014
Posts: 9
Question /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!
  Reply With Quote
06-28-20, 09:22 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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.
  Reply With Quote
06-28-20, 10:27 PM   #3
pinmouse
A Murloc Raider
Join Date: Jul 2014
Posts: 9
Question 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!
  Reply With Quote
06-28-20, 11:19 PM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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

Last edited by Kanegasi : 06-28-20 at 11:23 PM.
  Reply With Quote
06-29-20, 05:14 PM   #5
pinmouse
A Murloc Raider
Join Date: Jul 2014
Posts: 9
Red face

Originally Posted by Kanegasi View Post
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!

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

Last edited by pinmouse : 06-29-20 at 05:19 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » /count different depending on right or left click.

Thread Tools
Display Modes

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