Go to Page... |
Updated: | 04-28-09 02:11 PM |
Created: | 12-19-08 06:06 PM |
Downloads: | 21,313 |
Favorites: | 119 |
MD5: |
This AddOn is not updated for 4.x.
It will remain
for posterity.
If you are still unabated, please show your support if you want this AddOn updated for 4.x. You can either donate, or show your support on the comments page.
As of May 20, 2009: This addon is unsupported for the time being. AddOn authoring was only a hobby of mine. Mike-N-Go is not currently playing WoW, thus not creating or maintaining mods for WoW. If someone wishes to submit a patch for one of my mods to WoWInterface, you may within the bounds of the license bundled with the mod.
Now with slashcommand-options!
/wgt or /wintergrasptimer [option]
screen - shows announcements on screen
chat - shows announcements in chat
sound - plays warningsound with announcements (Sound file is from Nintendo's (c) Smash Brothers, provided by HelpTheWretched (http://noproblo.dayjo.org/ZeldaSounds/).)
stopwatch - shows stopwatch when less than 5 minutes left
time - prints time left in chat
Note: Ownership of this file has changed to Mike-N-Go from Mikma. He has several new features that should be out soon(tm). The pictures do not necessarily reflect the latest version of the AddOn.
Comment Options |
Stylpe |
View Public Profile |
Send a private message to Stylpe |
Find More Posts by Stylpe |
Add Stylpe to Your Buddy List |
mikma |
View Public Profile |
Send a private message to mikma |
Find More Posts by mikma |
Add mikma to Your Buddy List |
01-20-09, 05:12 AM | |
|
Here's an example for retrieving time from within the zone:
Code:
if event == "UPDATE_WORLD_STATES" and GetMapInfo() == "LakeWintergrasp" then local _, isactive, waitingtext = GetWorldStateUIInfo(8) if isactive == 1 and waitingtext then local h, m, s = strmatch(waitingtext, "(%d+):(%d+):(%d+)") ... end end |
|
totalpackage |
View Public Profile |
Send a private message to totalpackage |
Find More Posts by totalpackage |
Add totalpackage to Your Buddy List |
01-20-09, 05:14 AM | ||
|
|
|
|
mikma |
View Public Profile |
Send a private message to mikma |
Find More Posts by mikma |
Add mikma to Your Buddy List |
01-20-09, 07:03 AM | |
|
Great, looking forward to the next update
__________________
Keep violence virtual! |
|
Stylpe |
View Public Profile |
Send a private message to Stylpe |
Find More Posts by Stylpe |
Add Stylpe to Your Buddy List |
01-23-09, 12:55 PM | |
|
Please add in a command to give us the option of enabling or disabling the onscreen time till wintergrasp starts warnings that seem to have been added recently.
|
|
Internet |
View Public Profile |
Send a private message to Internet |
Find More Posts by Internet |
Add Internet to Your Buddy List |
01-24-09, 06:30 AM | ||
|
|
|
|
mikma |
View Public Profile |
Send a private message to mikma |
Find More Posts by mikma |
Add mikma to Your Buddy List |
01-25-09, 12:07 PM | |
|
Hello Mikma,
Great mod! A few suggestions: 1) PlaySound() of something in addition to the 15 and 5 minute warnings 2) Support for scrolling text addons, like MikScrollingBattleText, to display scrolling text in the middle of the screen 3) A 'countdown' that would display from 60 seconds/5 minutes to 0 in big text, like the mod Arena Countdown 4) The hour and minute of when the next battle will start, not just a counter down to the event Scrolling text implementation: Code:
frame:SetScript("OnUpdate", function(self, elap) timer = WGTime-time() elapsed = elapsed + elap if elapsed <= updateperiod then return end timer = timer - elapsed if timer > 0 then local hours,minutes,seconds = ConvertSeconds(timer) if hours > 0 then output = hours.."h "..minutes.."m" elseif minutes > 0 then output = minutes.."m "..seconds.."s" else output = seconds.."s" end else output = "N/A" WGTime = 0 end if output == "15m 0s" or output == "5m 0s" then print(text4..output) if ( MikSBT and ( not ( MikSBT.IsModDisabled() ) ) ) then MikSBT.DisplayMessage(text4..output) else UIErrorsFrame:AddMessage(text4..output) end PlaySound'ReadyCheck' elseif output == "0s" then print(text5) if ( MikSBT and ( not ( MikSBT.IsModDisabled() ) ) ) then MikSBT.DisplayMessage(text5) else UIErrorsFrame:AddMessage(text5) end PlaySound'ReadyCheck' end WGTbroker.text = output elapsed = 0 end) I recommend these changes because I would sometime miss the quiet announce of the mod.
__________________
Currently contemplating coming back to Authorship.. been away for years. Please let me know you care, by commenting on what addon(s) of mine you want to see updated. Author of Daily Bean Counter, MyNameTogglesWhenIAFKorDND, Extended Shutdown Warning, Auto Mail Director, Duel Nullify, Spec Transmiter, Say Again, Window Teller, Who Crafts, Ad Repeater, Privy Cork, Mac Backup, and more.
Last edited by Mike-N-Go : 01-25-09 at 12:54 PM.
|
|
Mike-N-Go |
View Public Profile |
Send a private message to Mike-N-Go |
Find More Posts by Mike-N-Go |
Add Mike-N-Go to Your Buddy List |
01-26-09, 04:37 AM | ||
|
Last edited by Internet : 01-26-09 at 04:39 AM.
|
|
|
Internet |
View Public Profile |
Send a private message to Internet |
Find More Posts by Internet |
Add Internet to Your Buddy List |
01-26-09, 11:32 AM | ||
|
2) Added 3) Added 4) Not sure is this one needed :I Waiting for some texts to be translated before I release next version |
|
|
mikma |
View Public Profile |
Send a private message to mikma |
Find More Posts by mikma |
Add mikma to Your Buddy List |
01-27-09, 04:16 AM | |
|
mods
I've made quick dirty mod to make this addon more suitable for me and my guildies.
Code:
local last_msg = "" local antispam = 0 local announced = false local detection_control = 0 local antispam_delay = 30 local side = ""; local function myChatFilter(msg) if (antispam - time() <= 0) then last_msg = ""; antispam = time() + antispam_delay; announced = false; end if (msg == last_msg) or ((antispam - time() >= 0)and(announced == true)) then return false else last_msg = msg; end if (detection_control - time() <= 0) then -- Run detection once in 5 mins ... to save resources detection_control = time() + 300; -- Contol detection -- local buffs, i = { }, 1; local buff = UnitBuff("player", i); side = "Enemy"; while buff do buffs[#buffs + 1] = buff; if (buffs[i] == "Essence of Wintergrasp") then side = UnitFactionGroup("player"); break; end i = i + 1; buff = UnitBuff("player", i); end; side = " ("..side .. " controlled)"; ---------------------- end if msg == "?wg" then announced = true; SendChatMessage("Battle for wintergrasp starting in : "..output..side , "CHANNEL", nil, arg8); return false end return false end ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", myChatFilter) p.s. I made this mod to beta6, because beta8 for some reason dropped timer after reloadUI()
Last edited by Kartun : 01-27-09 at 04:17 AM.
|
|
Kartun |
View Public Profile |
Send a private message to Kartun |
Find More Posts by Kartun |
Add Kartun to Your Buddy List |
01-27-09, 03:17 PM | ||
A Chromatic Dragonspawn
Forum posts: 153
File comments: 47
Uploads: 0
|
This addon doesn't communicate with guild/party/raid periodically, right? Just on login and on command? |
|
|
Psychophan7 |
View Public Profile |
Send a private message to Psychophan7 |
Find More Posts by Psychophan7 |
Add Psychophan7 to Your Buddy List |
01-27-09, 10:37 PM | |
|
Error in Beta9
Received the following error 22 times in quick succession in the latest beta.
[2009/01/27 22:22:43-526-x22]: WintergraspTimer-beta\WintergraspTimer.lua:152: attempt to call global 'Stopwatch_StartCountdown' (a nil value) --- |
|
SaberHawke |
View Public Profile |
Send a private message to SaberHawke |
Find More Posts by SaberHawke |
Add SaberHawke to Your Buddy List |
01-28-09, 05:02 AM | ||
|
About your question, of when the addon 'communicates', if you really want to find out yourself, you can get an addon that allows you to view SendAddonMessage()s, like LilAddonMessage, and watch it. Or, by looking at the code, one might think that some of the communication is done when time is requested by someone in guild/party/raid, the user is in Wintergrasp or talks to/hears from the NPC with the time in Darlan, or someone sends the data under these conditions.
__________________
Currently contemplating coming back to Authorship.. been away for years. Please let me know you care, by commenting on what addon(s) of mine you want to see updated. Author of Daily Bean Counter, MyNameTogglesWhenIAFKorDND, Extended Shutdown Warning, Auto Mail Director, Duel Nullify, Spec Transmiter, Say Again, Window Teller, Who Crafts, Ad Repeater, Privy Cork, Mac Backup, and more. |
|
|
Mike-N-Go |
View Public Profile |
Send a private message to Mike-N-Go |
Find More Posts by Mike-N-Go |
Add Mike-N-Go to Your Buddy List |
01-28-09, 06:35 AM | |
|
Here is the time to event code I put in for my request 'The hour and minute of when the next battle will start, not just a counter down to the event announce of the mod.'. Note it is more of a prof of concept, and may need some tuning.
Code:
--[[ Notes of the changes by MikeNGo: I think my changes were done to beta8, but I do not know for sure as the version in the .toc just says 'beta', I do know it is not beta9 I altered; note it would be nice to update the version in the .toc The objective of my changes were to add in hour:minute format the hour and minute that the next WG battle would land on. The altered code (noted by '--Added by MikeNGo') is what I changed Note that there is a problem with a rounding error, so the minute time might bounce between a moment and the moment before or after it Also, the sound and MSBT addition are in this reversion Due to a few stupid wrong assumptions I made, so it took me a long time to make this change, lol, so here is what I got so far Note what I have done is more or less a proff of concept; the idea needs a bit of ironing out BTW, Mikma, I took you saying, "4) Not sure is this one needed :I," to my sudjustion that you repplied to as, "Not sure if I want to bother implementing that," so I just did it for you =] Enjoy, and you may use my changes in improving your addon ]] if not WGTime then WGTime = 0 end local NPC1,NPC2,text1,text2,text3,text4,text5,text6,text7,text8,tooltip1,tooltip2,tooltip3,tooltip4,tooltip5,tooltip6,tooltip7 if GetLocale() == "deDE" then -- Thank you dingsbums @ wowinterface.com NPC1 = "Arkanist Braedin" NPC2 = "Magister Surdiel" text1 = "Tausendwinter beginnt in 15 Minuten" text2 = "Tausendwinter beginnt in 5 Minuten" text3 = "Die Schlacht um Tausendwinter startet in: " text4 = "Tausendwinter Timer: Die Schlacht startet in " text5 = "Tausendwinter Timer: Die Schlacht hat begonnen!" text6 = "Tausendwinter Timer: Am Zur¸cksetzen und Abfragen der Zeit." text7 = "N‰chste Schlacht:" text8 = "Tausendwinter Timer:" tooltip1 = "Echtzeit:" tooltip2 = "Blizzardzeit:" tooltip3 = "Shift+Linke Maustaste" tooltip4 = "Die Zeit im Chat bekanntgeben." tooltip5 = "Shift+Rechte Maustaste" tooltip6 = "Zur¸cksetzen und bekannte Zeit abfragen." tooltip7 = "Time when battle will start at: "--Added by MikeNGo else NPC1 = "Arcanist Braedin" NPC2 = "Magister Surdiel" text1 = "Wintergrasp will begin in 15 minutes" text2 = "Wintergrasp will begin in 5 minutes" text3 = "Battle of Wintergrasp starts in: " text4 = "Wintergrasp Timer: Battle will begin in " text5 = "Wintergrasp Timer: Battle has begun!" text6 = "Wintergrasp Timer: Resetting and requesting time" text7 = "Next Battle:" text8 = "Wintergrasp Timer:" tooltip1 = "Fixed Time:" tooltip2 = "Blizzard Time:" tooltip3 = "Shift+LeftButton" tooltip4 = "Announce the time in chat input." tooltip5 = "Shift+RightButton" tooltip6 = "Reset and request known time." tooltip7 = "Time when battle will start at: "--Added by MikeNGo end local TIMEFIX,updateperiod,elapsed,output,h,m,s,timer = 1.025,1,0 local brokertext = text8 WGTbroker = LibStub("LibDataBroker-1.1"):NewDataObject(brokertext, { type = "data source", text = "N/A", icon = "Interface\\Icons\\INV_Jewelry_Ring_66", OnClick = function(self, button) if IsShiftKeyDown() then if button == "LeftButton" and WGTime > 0 then ChatFrameEditBox:Show() ChatFrameEditBox:SetText(text3..output) elseif button == "RightButton" then print(text6) WGTime = 0 if IsInGuild() then SendAddonMessage("WGTime", "timerequest", "GUILD") end if UnitExists("party1") then SendAddonMessage("WGTime", "timerequest", "PARTY") end if UnitExists("raid1") then SendAddonMessage("WGTime", "timerequest", "RAID") end end end end, OnEnter = function(self) local originaltime = timer/TIMEFIX local h1,m1,s1 = ConvertSeconds(timer) local h2,m2,s2 = ConvertSeconds(originaltime) local h3,m3,s3 = ConvertSecondsToHourMinute(timer)--Added by MikeNGo GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine(text8,0,1,0) if WGTime-time() > 0 then GameTooltip:AddLine("------------------------------------",1,1,0) GameTooltip:AddDoubleLine(tooltip1,h1.."h "..m1.."m "..s1.."s",1,1,0) GameTooltip:AddDoubleLine(tooltip2,h2.."h "..m2.."m "..s2.."s",1,1,0) GameTooltip:AddDoubleLine(tooltip7,h3..":"..m3,1,1,0)--Added by MikeNGo GameTooltip:AddLine("------------------------------------",1,1,0) end GameTooltip:AddDoubleLine(tooltip3,tooltip4) GameTooltip:AddDoubleLine(tooltip5,tooltip6) GameTooltip:Show() end, OnLeave = function() GameTooltip:Hide() end, }) function ConvertSeconds(value) local hours = floor(value / 3600) local minutes = value - (hours * 3600) minutes = floor(minutes / 60) local seconds = floor(value - ((hours * 3600) + (minutes * 60))) if hours > 0 then return hours,minutes,seconds elseif minutes > 0 then return 0,minutes,seconds else return 0,0,seconds end end --Added by MikeNGo function ConvertSecondsToHourMinute(value) value = tonumber(value) local _, currentHour, currentMinute = GameTime_GetTime() local currentSecond = 0 if GetCVar("timeMgrUseLocalTime") == 1 then currentHour = date"%H" currentMinute = date"%M" currentSecond = date"%S" else currentHour, currentMinute = GetGameTime() currentSecond = date"%S" end value = value + (currentSecond+(currentHour*3600)+(currentMinute*60)) local hours = floor(value / 3600) local minutes = (hours * 3600) - value minutes = floor(minutes / 60) local seconds = floor( ((hours * 3600) + (minutes * 60)) - value ) minutes = math.abs(minutes)--Because it sometimes is negative, and the abs value is what we want if GetCVarBool("timeMgrUseMilitaryTime") then for i=1, hours/24 do if hours > 24 then hours = hours - 24 end end else for i=1, hours/12 do if hours > 12 then hours = hours - 12 end end end if hours > 0 then return hours,minutes,seconds elseif minutes > 0 then return 0,minutes,seconds else return 0,0,seconds end end local function broadcast(arg1) if IsInGuild() then SendAddonMessage("WGTime", arg1, "GUILD") end if UnitExists("party1") then SendAddonMessage("WGTime", arg1, "PARTY") end if UnitExists("raid1") then SendAddonMessage("WGTime", arg1, "RAID") end end local frame = CreateFrame("Frame") frame:SetScript("OnUpdate", function(self, elap) timer = WGTime-time() elapsed = elapsed + elap if elapsed <= updateperiod then return end timer = timer - elapsed if timer > 0 then local hours,minutes,seconds = ConvertSeconds(timer) if hours > 0 then output = hours.."h "..minutes.."m" elseif minutes > 0 then output = minutes.."m "..seconds.."s" else output = seconds.."s" end else output = "N/A" WGTime = 0 end --Added by MikeNGo if output == "15m 0s" or output == "5m 0s" then print(text4..output) if ( MikSBT and ( not ( MikSBT.IsModDisabled() ) ) ) then MikSBT.DisplayMessage(text4..output) else UIErrorsFrame:AddMessage(text4..output) end PlaySound'ReadyCheck' elseif output == "0s" then print(text5) if ( MikSBT and ( not ( MikSBT.IsModDisabled() ) ) ) then MikSBT.DisplayMessage(text5) else UIErrorsFrame:AddMessage(text5) end PlaySound'ReadyCheck' end --Added by MikeNGo if output ~= "N/A" then local hours,minutes,seconds = ConvertSecondsToHourMinute(timer)--SecondsToTime(WGTime-time())) output = hours..":"..minutes.." - "..output end WGTbroker.text = output elapsed = 0 end) frame:RegisterEvent("GOSSIP_SHOW") frame:RegisterEvent("CHAT_MSG_MONSTER_YELL") frame:RegisterEvent("CHAT_MSG_ADDON") frame:RegisterEvent("PLAYER_ENTERING_WORLD") frame:RegisterEvent("UPDATE_WORLD_STATES") frame:SetScript("OnEvent", function(self,event,...) if event == "GOSSIP_SHOW" then if (UnitName("target") == NPC1 or UnitName("target") == NPC2) and GetGossipText():match("%d:%d%d:%d%d") then h,m,s = string.split(":",GetGossipText():match("%d:%d%d:%d%d")) timer = h*3600+m*60+s local fixedtime = floor(timer*TIMEFIX) WGTime = time() + fixedtime broadcast(fixedtime) elseif (UnitName("target") == NPC1 or UnitName("target") == NPC2) and not GetGossipText():match("%d:%d%d:%d%d") then WGTime = 0 end elseif event == "CHAT_MSG_MONSTER_YELL" then local message,name = ... if name == NPC1 or name == NPC2 then if string.match(message,text1) then local fixedtime = floor(900*TIMEFIX) WGTime = time() + fixedtime broadcast(fixedtime) elseif string.match(message,text2) then local fixedtime = floor(300*TIMEFIX) WGTime = time() + fixedtime broadcast(fixedtime) end end elseif event == "CHAT_MSG_ADDON" then local prefix,message = ... if prefix == "WGTime" then if message == "timerequest" then if WGTime > 0 then broadcast(WGTime-time()) end else if WGTime == 0 then WGTime = (time() + message) end end end elseif event == "UPDATE_WORLD_STATES" then if AlwaysUpFrame2 and AlwaysUpFrame2:IsShown() and AlwaysUpFrame2Text:GetText():match(text7) and WGTime == 0 then local timeString = AlwaysUpFrame2Text:GetText():match("%d:%d%d:%d%d") if timeString then local h,m,s = string.split(":",timeString) local fixedtime = floor((h*3600+m*60+s)*TIMEFIX) WGTime = time() + fixedtime broadcast(fixedtime) end end else if WGTime == 0 then if IsInGuild() then SendAddonMessage("WGTime", "timerequest", "GUILD") end if UnitExists("party1") then SendAddonMessage("WGTime", "timerequest", "PARTY") end if UnitExists("raid1") then SendAddonMessage("WGTime", "timerequest", "RAID") end end end end)
__________________
Currently contemplating coming back to Authorship.. been away for years. Please let me know you care, by commenting on what addon(s) of mine you want to see updated. Author of Daily Bean Counter, MyNameTogglesWhenIAFKorDND, Extended Shutdown Warning, Auto Mail Director, Duel Nullify, Spec Transmiter, Say Again, Window Teller, Who Crafts, Ad Repeater, Privy Cork, Mac Backup, and more. |
|
Mike-N-Go |
View Public Profile |
Send a private message to Mike-N-Go |
Find More Posts by Mike-N-Go |
Add Mike-N-Go to Your Buddy List |
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.