Mudlet Help Desk



  • TirriaTirria Member Posts: 17
  • MjollMjoll Member Posts: 19
    edited March 19
    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: 128 ✭✭✭
    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.
  • EvalyneEvalyne A CoffinMember Posts: 128 ✭✭✭
    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: 19
    edited March 20
    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
Sign In or Register to comment.