Mudlet Help Desk

14567810»

Comments

  • TirriaTirria Member Posts: 17
    Thanks!
  • MjollMjoll Member Posts: 54 ✭✭✭
    edited March 2018
    So the mudlet manual says that script scripts are initialized when the profile is loaded, this however has not been my experience. For example I have various variable declarations in a script such as

    if generalDefs == nil then generalDefs = {} end

    But after opening mudlet and logging in I have to go into script scripts and click on every script to get my variables initialized, if I don't, my functions/aliases/trigger scripts that use these variables all error out.

    Easy fixes? Preferences checkbox I missed? Halp plz.
  • EvalyneEvalyne A CoffinMember Posts: 129 ✭✭✭
    Sacrifice a goat to the mudlet gods, and hope that it actually loads all your modules properly. It's been the struggle of people trying to use my UI as well. Mudlet just drops thing sometimes.
    Mjoll
  • EvalyneEvalyne A CoffinMember Posts: 129 ✭✭✭
    More seriously, try doing it like this:

    generalDefs = generalDefs or {}

    That will initialize it as an empty table ONLY if it has a non-nil value, which I think is what you're trying to do?
  • MjollMjoll Member Posts: 54 ✭✭✭
    edited March 2018
    That is what I want, yes! The if statement is how the manual suggested it be done, I'll try your suggestion, thanks!


    Edit: That seems to have done the trick! Thank you very much :)
    Post edited by Mjoll on
  • MykellahMykellah EnorianMember Posts: 69 ✭✭✭
    Theres the right way and then theres the mudlet way, unfortunately
  • BelgarionBelgarion Member Posts: 33 ✭✭
    Well, long time player, first time poster here..mostly cause I've never used mudlet in the rest of my time playing. I've got a million questions, but right now, my main question is...how would I got about making a button that would sit there, and if I have balance and eq, it would be colored one color, and it would color differently when I didn't. I'd love it if it had 4 colors. 1 for has eq and bal, 1 for has one but not the other, 1 for the other, and 1 for when i have none

    pretend my balance variable is Balance and for equilibrium it is EQ


    image
  • XeniaXenia Member Posts: 1,006 ✭✭✭✭✭
    Belgarion said:

    Well, long time player, first time poster here..mostly cause I've never used mudlet in the rest of my time playing. I've got a million questions, but right now, my main question is...how would I got about making a button that would sit there, and if I have balance and eq, it would be colored one color, and it would color differently when I didn't. I'd love it if it had 4 colors. 1 for has eq and bal, 1 for has one but not the other, 1 for the other, and 1 for when i have none

    pretend my balance variable is Balance and for equilibrium it is EQ


    Hey, so there are a few ways to tackle this. I don't know how good you are at learning off of examples but after playing around with the following pubilc scripts in Mudlet forums I was able to replicate something similar to what you wanted. If you install the UI package from this and then comb through to study how the healthbars use coloring, you can repurpose it based on a trigger. Additionally, look around on this UI layout and decide where you'd want your own info to be laid aout and play around as you construct your own UI.

    https://forums.mudlet.org/viewtopic.php?f=6&t=4098

    Good luck!

    Belgarion
  • TozToz Member Posts: 2,458 ✭✭✭✭✭
    Put this in a script, just by itself- it'll create the label for you on profile creation.
    baleq = Geyser.Label:new({ name = "baleq", x = "90%", y = "90%", width = "10%", height = "10%", fgColor = "black", color = "SeaGreen", message = [[<center>BALEQ</center>]] })

    Feel free to modify as needed- basically it puts it on the bottom right-hand corner of Mudlet.

    Then, you just change the background color:
    baleq:setColor("red")

    So you'd track on prompt (ugh I hate prompt triggers) for the easy mode, and use gmcp:
    if gmcp.Char.Vitals.balance == "1" and gmcp.Char.Vitals.equilibrium == "1" then baleq:setColor("red") elseif gmcp.Char.Vitals.balance == "0" and gmcp.Char.Vitals.equilibrium == "1" then baleq:setColor("green") elseif gmcp.Char.Vitals.balance == "1" and gmcp.Char.Vitals.equilibrium == "0" then baleq:setColor("pink") else baleq:setColor("blue") end

    Arbre-Today at 7:27 PM

    You're a vindictive lil unicorn
    ---------------------------

    Lartus-Today at 7:16 PM

    oh wait, toz is famous
    ---------------------------

    Karhast-Today at 7:01 PM

    You're a singularity of unicorns awfulness Toz
    Xenia
14567810»
Sign In or Register to comment.