Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-09-13, 04:53 PM   #1
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
DBM countdown via lua

I currently use this script I found to run a coundown timer, but I'm wondering if there's a way I can call DBM's countdown function with this script as well

Lua Code:
  1. local defaultcdtime = 6
  2. local channel = "RAID_WARNING"
  3.  
  4. local frame = CreateFrame("frame", nil)
  5. SlashCmdList['COUNTDOWN'] = function(newtime)
  6.     if newtime ~= "" then
  7.         cdtime = newtime+1
  8.     else
  9.         cdtime = defaultcdtime+1
  10.     end  
  11.     local ending = false
  12.     local start = floor(GetTime())
  13.     local throttle = cdtime
  14.     frame:SetScript("OnUpdate", function()
  15.         if ending == true then return end
  16.         local countdown = (start - floor(GetTime()) + cdtime)
  17.         if (countdown + 1) == throttle and countdown >= 0 then
  18.             if countdown == 0 then
  19.                 SendChatMessage('Pulling', channel)
  20.                 throttle = countdown
  21.                 ending = true
  22.             else
  23.                 SendChatMessage(countdown, channel)
  24.                 throttle = countdown
  25.             end
  26.         end
  27.     end)
  28. end
  29. SLASH_COUNTDOWN1 = "/inc"
__________________
Tweets YouTube Website
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » DBM countdown via lua


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