Utility Codes

TheophilusTheophilus Member, Beta Testers Posts: 728 ✭✭✭✭
Is there anything I could code/activate in Mudlet that would be for general utility? For example, I want to figure out how to put ringtells in a separate window, and I thought there may be other useful things I could do that I wasn't aware of.


  • SalikSalik Da BurghMember, Beta Testers Posts: 143 ✭✭✭
    Demonnic's chat window code is out there. That'll do wonders.
  • TheophilusTheophilus Member, Beta Testers Posts: 728 ✭✭✭✭

    Here is that code, by the way. It is AWESOME. I can help anyone set it up. It's simple.
  • TheophilusTheophilus Member, Beta Testers Posts: 728 ✭✭✭✭
    In a script, put:

    gm = gm or {}

    gm.room = gm.room or 0

    function gm.vitals()

    hp = math.floor(gmcp.Char.Vitals.hp/11)

    mhp = math.floor(gmcp.Char.Vitals.maxhp/11)

    mp = math.floor(gmcp.Char.Vitals.mp/11)

    mxmp = math.floor(gmcp.Char.Vitals.maxmp/11)

    eq = tonumber(gmcp.Char.Vitals.eq)

    bal = tonumber(gmcp.Char.Vitals.bal)

    bleed = math.floor(gmcp.Char.Vitals.bleed/11)


    Add under user defined event handler at the top: gmcp.Char.Vitals

    And then you can capture hp or whatever to do certain things. Just starting to work with GMCP, so this might not be as new to most of you. But for some it might help.

  • SenaliSenali Member Posts: 44 ✭✭
    edited March 2016
    Do note the script has to be called gm.vitals too, if you want to use event handlers like that.

    Also don't recommend having variables called that as a standalone thing, if you're planning on making a system for Imperian.

    gm.hp = math.floor(gmcp.Char.Vitals.hp/11)

    gm.mhp = math.floor(gmcp.Char.Vitals.maxhp/11)

    gm.mp = math.floor(gmcp.Char.Vitals.mp/11)

    gm.mxmp = math.floor(gmcp.Char.Vitals.maxmp/11)

    gm.eq = (gmcp.Char.Vitals.eq == "1") and true or false

    gm.bal = (gmcp.Char.Vitals.bal == "1") and true or false

    gm.bleed = math.floor(gmcp.Char.Vitals.bleed/11)

    Also about 90% sure it needs to be math.floor(tonumber(gmcp.Char.Vitals.mp)/11) and such, since in gmcp they're all string values by default. As for the .eq / .bal values, basically if it's "1" then gm.eq would equal true, if it's not, then it's false.

  • TheophilusTheophilus Member, Beta Testers Posts: 728 ✭✭✭✭
    Yeah, I posted this several hours before I finalized what I was using it for, and I realized I had screwed up -a lot-.

    GMCP is so useful, though.
  • OhmOhm Member Posts: 235 ✭✭✭
    What is GMCP - sorry noob question
  • EoghanEoghan Member, Immortal Posts: 730 mod
    GMCP is a protocol used to send data to your client that is invisible to you. A lot of different information is available in GMCP. Jeremy recently reworked and expanded the documentation on GMCP, and it can be found here: http://nexus.ironrealms.com/GMCP
    Like what we're doing? Why not take a second to vote? Vote for Imperian at http://www.imperian.com/vote
Sign In or Register to comment.