• 0

    posted a message on looking for GMT time
    There is a lot of thing in time_t, do you need everything?

    Let's see:
    local time_t = {
       [1] = tonumber(date("!%Y")), -- Year
       [2] = tonumber(date("!%m")), -- Month
       [3] = tonumber(date("!%d")), -- Day
       [4] = tonumber(date("!%H")), -- Hour
       [5] = tonumber(date("!%M")), -- Minute
       [6] = tonumber(date("!%S")), -- Second
       [7] = tonumber(date("!%u")), -- Weekday number
       [8] = tonumber(date("!%j")), -- Day of the year (%j is somehow not valid in WoW so don't use this one)
    P.S. I should have verified what you said before posting this. date("!*t") works just fine.
       [9] = 0,                     -- Daylight saving flag

    Pick and choose what you need.

    P.S. I should have verified what you said before posting this. date("!*t) works just fine.
    /run time_t = date("!*t")
    /dump time_t
    { -- _G["time_t"]
         day = 22,
         hour = 12,
         isdst = false,
         min = 23,
         month = 7,
         sec = 35,
         wday = 1,
         yday = 204,
         year = 2012
    } -- _G["time_t"]
    Posted in: Lua Code Discussion
  • 0

    posted a message on looking for GMT time
    print("Local time: "..date("%H:%M:%S"))
    print("UTC time: "..date("!%H:%M:%S"))
    local sH, sM = GetGameTime()
    print(("Server time: %02d:%02d:%02d"):format(sH,sM,date("%S")))


    P.S. UTC should be the same as GMT.
    Posted in: Lua Code Discussion
  • 0

    posted a message on UNIT_POWER event triggered rarely
    Not sure if it's a clue to the solution or just noise but there is a new function frame:RegisterUnitEvent(event, unit, displayedUnit) that I can't figure out.

    It looks like a RegisterEvent with extra conditions/filters. Maybe you can test if events registered that way would see more updates.
    Posted in: AddOn HELP!
  • 0

    posted a message on Grid — compact party/raid unit frames
    Quote from yoshimo
    Wouldnt it by now make more sense to switch from this version to the new grid2 phanx or are there any reason to stick with grid1?

    Grid and Grid2 are two different addons maintained by different peoples. One is NOT the update of the other.

    Having used both, I hope that Grid never becomes like Grid2. Configuration in Grid2 just doesn't work for me.
    Posted in: Grid & Grid2
  • 0

    posted a message on [MoP API] warlock - Burning Embers and MoP addon dev in general
    Quote from another
    I'm googling something like "wow ui sources tekkub", first link to GitHub, there by link branches with MoP Beta. Downloadable as zip.

    You can also get it directly from the game files installed on your PC: Viewing Blizzard's interface code
    Posted in: Need Help?
  • 0

    posted a message on Addons are now enabled on MoP
    Quote from Ketho
    How is it possible Tekkub can commit all previous builds in such a short time frame? I always thought you'd have to ExportInterfaceFiles it between every build, so I'm gasping at this feat. Tekkub even commited builds 15211 and 15314 I thought that didn't even exist... just how?!

    Anyway then we don't have to fork Tekkub's repo anymore ..

    Me and Ketho both have been maintaining a fork with every new version of MoP. Maybe Tekkub got the stuff from us or maybe he got them from somewhere else, not sure. Since Tekkub has been not very fast in updating his repo, I'll keep committing to my fork for now if only for my own usage.
    Posted in: General Chat
  • 0

    posted a message on Addons are now enabled on MoP
    Quote from Adirelle
    I've forked Tekkub's wow-ui-source and updated it with build 15799 changes : https://github.com/Adirelle/wow-ui-source/tree/beta

    Apparently Tekkub came out of hibernation and updated his repo.
    Posted in: General Chat
  • 0

    posted a message on Addons are now enabled on MoP
    Quote from Dridzt
    That's not a new problem with MoP, 1/0 is not valid on the live client either.

    When I do /run print(1/0) on live server, I get 1.#INF instead of the Division by zero error I get on the beta server so I think that 1/0 is not an issue with live server.

    I've use math.huge instead of 1/0 and it appears to fix the issue for now.
    Posted in: General Chat
  • 0

    posted a message on Addons are now enabled on MoP
    I guess we can start a thread somewhere about the problems we find and how to fix them.

    Here the first I got: 1/0 is no longer valid. I get a Division by zero error.

    So, any ideas what to use as infinite value is things like LibAbacus?
    Posted in: General Chat
  • 0

    posted a message on Changes in 4.3.3 (build 15354)
    Nothing much in UI change for this release. The following files were modified :


    No new function, no function change, no function removed.

    New/changed global strings:

    JUST_OR = "Or";
    SCROLL_OF_RESURRECTION = "Scroll of Resurrection"; -- was "Scroll Of Resurrection";
    SOR_DEFAULT_MESSAGE = "Remember the good times in WoW? I do, so it's time to come back!";
    SOR_DISABLE_CHOOSE_A_TARGET = "Select someone to send the invite to.";
    SOR_DISABLE_NO_INVITES_LEFT = "You cannot send any more invites today.";
    SOR_INSTRUCTION_EMAIL = "Enter an E-mail address:";
    SOR_INSTRUCTION_SELECT = "Select a friend or guild member:";
    SOR_NUM_REMAINING = "Invites left today: %d";
    SOR_SUCCESSFULLY_SENT = "Your Scroll of Resurrection has been sent!";

    There are changes to a few guild and friend related frames but you'll have to check yourselves to judge.

    Hope that's helpful, best.

    P.S.: I've forked Tekkub's wow-ui-source on GitHub and synced the latest changes but for some reason, the latest commit doesn't appear yet. It should get there eventually so here's the link in case someone needs it: https://github.com/Laotseu/wow-ui-source
    Posted in: Lua Code Discussion
  • 0

    posted a message on LibQTip
    @Drudatz: you're welcome :-)
    Posted in: Libraries
  • 0

    posted a message on LibQTip
    The easiest way I found to make the fonts and everything in the tooltip bigger or smaller is to use tooltip:SetScale()

    I normally do it just before the tooltip:Clear() that precede code that add the lines to the tooltip. In your case I would try:

    function dataobj:OnEnter()
    	tooltip = libQTip:Acquire("AltGuildTooltip", 3, "LEFT", "LEFT","RIGHT")
    	tooltip:SetScale(1.1) -- put the value in a var for your options if you want

    And I would not bother with the fonts at all. If you really want to use fonts, you can check the code in Syllabus. If I remember correctly, you should to create your font ahead of time and then use it with SetFont(). There used to be a bug with CopyFontObject() so you should probably avoid it.

    Hope that helps
    Posted in: Libraries
  • 0

    posted a message on strfunc(str) vs. str:func()
    Thanks for the info guys. I'll repeat the test by not using _G.

    And Nev., the addons are already written and upvalued. I use findglobals on all my stuff. I was just wondering if I had to change my style from using str:func() to use strfunc(str) since there appear to be an improvement that is around 10%.

    I think the real value of using findglobal is to have code that polute the global namespace less and that it allow me to catch more of my hair-brained mistakes. :-).
    Posted in: Lua Code Discussion
  • 0

    posted a message on strfunc(str) vs. str:func()
    Hey everyone,

    I've been doing some benchmark in WoWLua in game with some of the Blizzard srt...() functions compare to calling them using str:func().

    Here's an example with find()

    local loop, a = 40000000
    local teststr = "   TfTfTfT    "
    print("------ New Test -----")
    a = time()
    for i=1,loop do
       _G.strfind(teststr, "F")
    print("Test strfind global", time() - a)
    a = time()
    for i=1,loop do
    print("Test str:find() upvalue", time() - a)
    local strfind = _G.strfind
    a = time()
    for i=1,loop do
       strfind(teststr, "F")
    print("Test strfind upvalue", time() - a)

    Here's the result:
    ------ New Test ------
    Test strfind global, 11
    Test str:find(), 9
    Test strfind upvalue, 8

    I was expecting the global to be slower then the upvalued versions but I'm surprised that upvalued strfind(str, "F") is faster then str:find("F"). I tried the same test with strtrim() and strupper() and got similar results.

    I was under the impression that the str:func() was supposed to be the same speed or faster then using local strfunc(). Is there something wrong with my test? Did you guys observe different results? Any explanation from the Lua gurus?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with strmatch/gsub return values
    /print select(3,strmatch("Something", "S(%a)m(%a)th(%a)ng"))
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.