• 0

    posted a message on coroutine and SendMessage
    i dropped the code down to complete basics, no coroutines at all

    function ArkDKP.OnEnable( )
        
        ArkDKP.Output( "register" )
        ArkDKP:RegisterMessage( "ARKDKP_EVENT_REGENERATE" )
        
        ArkDKP.Output( "call" )
        ArkDKP:SendMessage( "ARKDKP_EVENT_REGENERATE", "test" )
        
        ArkDKP.Output( "rest of code" )
    
    end
    
    function ArkDKP:ARKDKP_EVENT_REGENERATE( event, list )
        ArkDKP.Output( "ARKDKP_EVENT_REGENERATE( ", list, " )" )
    end
    the output from the regenerate function, shows up between "call" and "rest of code", not after.

    i cant figure out why we'd need RegisterMessage/SendMessage if they just get executed instantly, ie why would we use this instead of just calling the function directly?
    Posted in: Lua Code Discussion
  • 0

    posted a message on coroutine and SendMessage
    i have a sk based dkp mod that is fairly intensive when updating a list, about 4+ seconds of total ui lockout on a well used list (for everyone with the mod, in the raid and in guild) so not exactly the best.

    i wanted to break it up so that the ui is still usable and i thought i could use coroutines to wrap the calculations in.

    to test the process works, i commented out the yield, the list updates properly but there was something odd.

    my print statements were showing that the "reminder" trigger i was using, a SendMessage (just before i would have yielded), was running inline, ie i was getting "resume thread" (from the sendmessage function), "yielded", "resumed" when i was expecting a whole bunch of "yielded", "resumed" then a whole bunch of "resume thread"

    SendMessage seems to be executing its entire path there and then - there is no queue, its instant / inline. is this normal and ive just not understood ace3 messages? or are they supposed to act like blizzard events?

    i did try it with the yield in there and had the sendmessage function call the actual resume function but i ended up with an error that the thread was still active and could not be resumed - which would only happen if the entire SendMessage and its linked function were executed before the yield.

    presuming ive misunderstood is there a way to emulate blizzard like events to get that queueing to happen so i can resume after my (and others) code has run?
    Posted in: Lua Code Discussion
  • 0

    posted a message on clear options table input element
    Quote from Xtynct
    I just don't know how to clear the box after.


    its get function needs to return an empty string - so you just set whatever variable that is to an empty string, after youve moved its value into the other variable.
    Posted in: Ace3
  • 0

    posted a message on FindGlobals mystery
    [FONT=Courier New]_G.LibStub[/FONT] is a local (ok its probably not but [FONT=Courier New]_G[/FONT] is a local and thats all that really matters), [FONT=Courier New]LibStub[/FONT] is a global. (when theyre called that way).

    no global finder code is going to continue searching down a local ([FONT=Courier New]_G[/FONT] in this case) looking for global references within/under it (because its bound to find them) - the parent is a local, thats all that matters for that code chunk.

    unless im missing something? (which is entirely possible)

    btw, why not use [FONT=Courier New]local _G = _G[/FONT] makes it more obvious that you just replaced it - or are you worried that someone else may have tampered with [FONT=Courier New]_G[/FONT] before you make it a local?
    Posted in: Lua Code Discussion
  • 0

    posted a message on ok 4th attempt at queue...
    get yourself a trial account, copy your wow directory to another one, run both at the same time on the same computer - test away.
    Posted in: Need Help?
  • 0

    posted a message on AceConfig-3.0 inpit type question.
    Quote from Soren

           get = function(info) return Serenity.db.profile["offsets"][ info[#info-1] ][1] end,


    if that line works fine after entering a value, and after restarts, but isnt working when first run (ie wiped sv's) then there is no default value set in your acedb table for that entry.

    perhaps check the sv data for that profile and see where its actually saving it to, then ensure your default profile db matches that.

    if all else fails then start printing stuff out inside that get function to make sure you are actually pointing to where you think you are and not somewhere else.
    Posted in: Ace3
  • 0

    posted a message on savedVariables ?
    ## SavedVariables: buffs

    that greated a global variable

    local buffs ={} --table with buff that must be tracked

    that created a local variable - which is different to the global and as it had the same name, essentially ignored the global and thus data never got saved to the sv file

    if you had of not used that local you could have done this

    ## SavedVariables: buffs, Saundo2DB

    so you woudl have had two sv's and then moved all the data from one into the other, but since it was a local theres no point in converting anything as there isnt anything there to convert.

    basically just rename every instance of buffs to Saundo2DB and remove all the conversion code and you should have been good.

    if you really wanted to keep it as buffs then you could have used something like this

    Saundo2DB = Saundo2DB or { }
    Saundo2DB.buffs = Saundo2DB.buffs or { }
    
    local buffs = Saundo2DB.buffs
    Posted in: AddOn HELP!
  • 0

    posted a message on Correctly embeded (Ace3) Libs?
    what if its related to that last acelocale update that forces the silent flag

    if RSD has the latest ace3 libs then for that user its essentially forcing all their mods to have an updated acelocale lib and if one of the users other mods hasnt been updated its going to barf - and probably blame RSD.

    all our mods have probably been updated (or didnt need to be) so we wont even notice the problem. but if that user has just one mod that needs to be updated then theyre going to have issues.

    simple test is to get them to disable every single mod except RSD. if they do that then they most like wont encounter any ace errors at all which should show its not RSD related.
    Posted in: General Chat
  • 0

    posted a message on Localized strings issue
    Quote from kunda
    all possible return values (blue/red/yellow/green/orange/purple/prismatic/meta/hydraulic/cogwheel).


    auction house gem categories?

    edit: ah, nvm, tekkub already mentioned it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Resetting AceDB/SavedVars from Level Data
    Quote from Ketho
    I'm not sure which way (wipe or ResetDB) is better, or there is an even better way


    wipe will destroy the metatables, resetdb will reset the whole table (something you probably dont want).

    best bet, do it *before* you register it with acedb so that its just a boring old table, hack and slash, then register it. it can be much more fiddly but you can be as precise as you want.

    if you want to be really safe, add another sv and "backup" the current one into that, that way you can always pull old data out of that and into live if you need it.

    Actually I'm not even sure if resetting (all) data is a good thing to do if users might be angry they lost their level data


    convert it. some users will get annoyed if you just wipe it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Unexpected symbol near...
    Quote from myrroddin
    You notice the missing [" and "] around Reincarnate?


    it should be valid lua, you dont have to have string keys in quotes if there are no spaces or lua bits in the key name. its just visually more obvious whats going on if you use the square brackets and quotes.

    also, the localisation just inserts a table, you dont appear to be assigning it to anything though? i presume you mean something like L = @localisation@

    could be wrong as i dont use curse localisations.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GetWintergraspWaitTime( ) removed?
    Quote from egingell
    Incidentally, my 4.0.3a version of the FrameXML files uses GetBattlefieldEstimatedWaitTime(), so it wasn't renamed.


    youre right, i only took a quick look at the code that i found on the web but now that ive unpacked the current code - its still there, and using that function, so either its not getting called any more or its a blizzard only function? (or maybe i just cant read them)

    anyway, found a better way that covers all world pvp zones (if they ever allow flying in one of them) using GetWorldPVPAreaInfo( index )

    the nice part about that function is that one of the returns is the localised zone name so checking if the player is in that zone is very simple and i never have to rely on a translation.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GetWintergraspWaitTime( ) removed?
    Quote from funkydude
    Possibly renamed? If the pvp frame is calling it you could check the FrameXML.


    found the new source on the web and yeah, looks like they renamed it to GetBattlefieldEstimatedWaitTime(i)

    just have to figure out which value for i is wintergrasp and go from there
    Posted in: Lua Code Discussion
  • 0

    posted a message on GetWintergraspWaitTime( ) removed?
    nothing in the patch notes about it being removed.

    cant login until i get home from work so cant confirm if it actually has been removed or its some other issue but ive received multiple tickets about this and they all appear to point to it being removed.

    is there an alternative to this function or some other method to know if a battle is in progress?
    Posted in: Lua Code Discussion
  • 0

    posted a message on frame level issues
    Quote from kunda
    I found a simple solution to avoid such 'Lags':


    i never thought that particular problem could be worked around, thanks for that, it was very annoying problem.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.