Updating Wundersys

Hey all! What's the best way to go about updating wundersys?

I'm still and probably forever will be a noob coder. But right now I am working on...

lua gmcp.Char.Vitals

{

  wp = "28175",

  eq = "1",

  ep = "23630",

  charstats = {

    "Bleed: 0",

    "Rage: 0",

    "Kai: 0%",

    "Stance: None"

  },


I'm trying to get that Kai value to call from that GMCP, to my prompt (@kai is the prompt tag).

I found this...

wsys.prompttags["kai"] = function() if wsys.def.kaitrance then return wsys.stats.kai else return "" end end

and.... 

wsys.prompttagcolors["kaicolour"] = function()

if wsys.stats.kai < 10 then

--can't even choke

return "red"

elseif wsys.stats.kai < 21 then

--can't heal

return "firebrick"

elseif wsys.stats.kai < 41 then

--can't cripple

return "dark_orange"

elseif wsys.stats.kai < 61 then

--can't enfeeble

return "yellow"

elseif wsys.stats.kai >= 61 then

--can do anything

return "dark_green"

end

end

So if I gathered it correctly, I am trying to update where wsys.stats.kai retrieves its value from. 


Any ideas on where to go from here? Thanks!

Comments

  • What's the issue with using wsys.stats.kai? Is it not getting the right value? Do you know how Wunderss is supposed to get the value - is it using GMCP itself or is it trying to pull the value from your prompt?

    You could pull the value from GMCP yourself and simply populate the wsys.stats.kai value, though the process that Wundersys goes through may result in that getting overwritten. Give this a go:

    function zukoVitals()
        for _, stat in ipairs(gmcp.Char.Vitals.charstats) do
            if string.find(stat, "Kai") then wsys.stats.kai = tonumber(string.match(stat, "(%d+)")) end
        end
    end
    
    registerAnonymousEventHandler("gmcp.Char.Vitals", "zukoVitals")
    

    Put it in a script object that's separate from Wundersys so when you update Wundersys you don't have to make the same change again.

  • Posting for future reference: issue with kai was that his prompt was not set to "all"(full?) in Achaea,  so wsys was probably capturing the wrong value or nothing at all.  Fix'd. 
  • Kind of seems like the issue is that wundersys uses the prompt rather than GMCP to get that information.
Sign In or Register to comment.