Thread Tools Display Modes
01-06-16, 11:32 PM   #1
EvilMaddness
An Aku'mai Servant
 
EvilMaddness's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 33
How can I get rid of 00000.0000 showing in timer?

Hello, I'm trying to get this import code on weakauras to not show the timer at all in this 000000.0000 timer format but I think it's doing it in the lua code it's self. I can use the built in timer ( 0.0 ) in weakauras display instead which is what I normally use anyways; so I have no need for the 000000.0000 timer to show.

I just want a nice clean bar so I can do what I need to do with the code and use the timer options on the weakauras display.

If you want to check out what I mean on weakauras here's the pastebin link to import the code.
http://pastebin.com/p3YKDC4J

Don't mind the rest of the lua code I can deal with that. If you can just change it so it's not showing the timer on the lua code anymore you would be helping me out a lot.

Thank you!
__________________
The Maddness Within lua
  Reply With Quote
01-06-16, 11:45 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I only see a jumbled string of letters and numbers. Can you post the actual Lua code?
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
01-07-16, 12:25 AM   #3
EvilMaddness
An Aku'mai Servant
 
EvilMaddness's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 33
Re:How can I get rid of 00000.0000 showing in timer?

LOL I don't know what I did right...but some how while I was setting everything up getting it all ready so when I show you the lua code on here to help me with I wouldn't have to change anything else and just fit it in where the bar needs to go. Well while I was doing all of that testing to make sure the color change would worked right ɛtˈsɛtərə all a sudden the timer is showing the right way and it's also working the way I need it to be. Now I'm just hoping I can get it to work for the rest of the spells I need but far as my friend said it should work fine. If I get any other problems though I'll let you know; Thanks for wanting to help me out though the community has been awesome on here and if it wasn't for them I wouldn't have my U.I working like it is right now
__________________
The Maddness Within lua
  Reply With Quote
01-07-16, 01:02 AM   #4
EvilMaddness
An Aku'mai Servant
 
EvilMaddness's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 33
Re: About getting rid of 00000.0000 timer in lua code

You know what though if you really want to help me out still I really don't need the timer to show in the lua at all cause I want to use the built in one on weakauras. here's the lua codes. I'm not sure which one is making it show the timer though.

This one is on the display custom function in weakauras

Lua Code:
  1. function()
  2.     local start, duration = GetSpellCooldown("Cascade")
  3.     local progress = start + duration - GetTime()
  4.     return string.format("%.1f", progress)
  5. end

This is on the Trigger tab going down in order

Custom Trigger
Lua Code:
  1. function()
  2.     if select(2, GetSpellCooldown("Cascade")) == 25 then
  3.         return true
  4.     end
  5. end

Custom Untrigger
Lua Code:
  1. function()
  2.     return true
  3. end

Duration Info
Lua Code:
  1. function()
  2.     local start, duration = GetSpellCooldown("Cascade")
  3.     local progress = start + duration - GetTime()
  4.     return progress, duration, true
  5. end

Icon Info ( which I'm not using any icons on the bar right now )
Lua Code:
  1. function()
  2.     return select(3, GetSpellInfo("Cascade"))
  3. end

And I use this code for the color change in the Animation tab, main then down where the color box is in the custom function box.

Lua Code:
  1. function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
  2.     local start, duration, enable = GetSpellCooldown ("Cascade")
  3.     local warning_time = 7
  4.     if start and start>0 then
  5.         local progress = start + duration - GetTime()
  6.         if progress < warning_time then
  7.             return r2,  g2, b2, a2  -- Red
  8.         end
  9.     end
  10.     return r1, g1, b1, a1 -- White
  11. end

So somewhere in those codes is making the timer show on the bar and I just wan't it to go away so I'm able to use the timer already in weakauras display options.
__________________
The Maddness Within lua
  Reply With Quote
01-07-16, 03:44 AM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by EvilMaddness View Post
This one is on the display custom function in weakauras

Lua Code:
  1. function()
  2.     local start, duration = GetSpellCooldown("Cascade")
  3.     local progress = start + duration - GetTime()
  4.     return string.format("%.1f", progress)
  5. end
I honestly never used WeakAuras myself, but everything looks in order. Nothing here should return the string "00000.0000" as the %.1f identifier specifically instructs the function to insert the number as a single precision decimal. In your PM, you mentioned this was "0.0" instead, which makes more sense. If you wanted this to hide itself when it reaches zero, you could try this shorthand conditional return.
Code:
return progress>0 and string.format("%.1f", progress) or ""
This uses a side effect of how Lua interprets the logic operators and and or. To make a long explanation short, Lua evaluates this line left-to-right and follows these rules:

x and y
  • Evaluate x and if false, return x and ignore y
  • If x is true, evaluate and return y

x or y
  • Evaluate x and if true, return x and ignore y
  • If x is false, evaluate and return y
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How can I get rid of 00000.0000 showing in timer?


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