Mudlet questions & answers!

1246714

Comments

  • Ah, yes. It is in (I think Dorn's? Got it from the Mudlet forum) the Blademaster Limbcounter Gui script pack. I just tried locking the Coding Pack folder to deactivate it, still getting the error. Do I have to delete it completely? Not sure how it's going to affect the limbcounter...
  • Yep, it was Dorn's that was giving me the trouble too. Go ahead and delete the display script. You can keep the math.round script with no problems. Delete the display one then restart Mudlet

    @Vadimuses is it possible to have unactivated scripts not run at startup?
    image
  • Ahah! Perfect! Thank you!





    Now to reload all the names I lost because I accidentally saved the empty list. >.<
  • Jacen said:
    Yep, it was Dorn's that was giving me the trouble too. Go ahead and delete the display script. You can keep the math.round script with no problems. Delete the display one then restart Mudlet

    @Vadimuses is it possible to have unactivated scripts not run at startup?
    Submit the idea on Mudlet forums!
  • So playing around with Geyser I have a couple of containers with labels in them but for the life of me I cannot work out how to change the font size.

    This is my latest effort, everything else works fine but not getting a larger size font

    targetlabel = Geyser.Label:new({

    name = "targetlabel",

    x = 0, y = "90%",

    width = "98%", height = "10%",

    fgColor = "red",

    }, ent_container_bot) -- this is where we tell it what container to go into

    targetlabel:setColor(255,255,255)

    targetlabel:setStyleSheet([[

    background-color: black;

    border-width: 5px;

    border-style: solid;

    border-color: red;

    border-radius: 10px;

    font-size: 40px;

    ]])


    Any help is appreciated 

  • When you echo into it, do:

    mylabel:echo([[<span style="font-size: 40px;">]]..mytarget..[[</span>]])

    and that should do it. Using the style you can also make it do things like be monospaced.
  • edited January 2013
    EDIT: Ugh, didn't see the last page at all and replied to something that had long been covered.

    To think I wasted my 1000th post on this!
  • Next question:

    How do I align a container from the right side instead of the left.

    setBorderRight(200)

    ship_container = Geyser.Container:new({

    name = "ship_container", 

    x= -0, y= -0, -- have it start at the top-right corner of mudlet??

    width = 200, height="100%", -- with a width of 200, and a height of the full screen, hence 100%

    })


    I thought the above might work with negative numbers but it doesn't tried a few variations and had a look around on google but cant seem to find anything that I understand.

  • Okay disregard that seems if I put - 200 it starts it off in the right place, for some reason I thought -0 would do it, but that starts it on the very right border and continues going right instead of coming back left into screen.
  • edited January 2013
    Yeah. The x and y coordinates of a Geyser element (or any Mudlet GUI element, really) always set the top-left corner, so you need to take the element's size into account when placing something on the right or on the bottom.
  • edited January 2013
    It doesn't wrap around, no. This way you can have elements drive out if you want. Since you align elements by their top-left corner to Mudlets top-left corner, you also want to account for their size at times.
  • Does anyone know if it would be possible to have an alias that allowed me to use ; as a command separator (such as n;slap silas;s;touch shield;tell silas sothantos made me do it) but still use ;) for says? The simplest answer I have been given was to adapt to using ;; as a command separator, but that would mess me up and require quite a bit of adjustment.

     i'm a rebel

  • If you're on svo, you can use $ as a command separator. Other than that, just ditch the separators and use sendAll()

    image
  • Tesha said:
    Does anyone know if it would be possible to have an alias that allowed me to use ; as a command separator (such as n;slap silas;s;touch shield;tell silas sothantos made me do it) but still use ;) for says? The simplest answer I have been given was to adapt to using ;; as a command separator, but that would mess me up and require quite a bit of adjustment.
    [-X

  • @Tesha
    You could make an alias like

    pattern: ^saywink (.+)$
    script: send("say "..matches[2].." ;)")

    I don't know of a way to set it up so that "say Hi ;)" goes through properly without changing the separator, though.
  • At the moment there isn't a way. ;; is the best way to go about it I think.
  • @Silas there is nothing wrong with winky smileys! >C

    @Eld you are a genius! That is totally fine and I can remember that for the few times Tesha winks when she talks.

     i'm a rebel

  • NizarisNizaris The Holy City of Mhaldor
    Having a bit of a problem that has been annoying me for some time, and I'm trying to figure out a way to fix it that is practical.

    I use the daemonic tabbed chat script. I also have it setup so that every time I get a party tell, says, emote, whatever, it plays a little noise. Oh so handy.

    The difficulty is when I get spammed, like I did during the raids tonight. Or, when I and/or an opponent sticks stupidity. Died twice to it. I don't mind the deaths too much, but I'd like to fix the problem.

    Problem is, I'm on Linux. So, I have a few matters to contend with. #1: a trigger to simply play a sound file via the GUI option has never worked for me; no sound whatsoever. #2: Using the new playSoundFile() function in the Mudlet 2.0 API seems to have a lag of its own. It does a great job of limiting the number of sounds that can be played at once, but it does this by waiting for a few seconds to play any of them, it seems.

    My present solution is thus:

    function playSound( fileName )

    --- Plays specified file name.

       os.execute( "aplay " .. fileName .. " &" )

    end


    This plays sound absolutely fantastically, never lagged from initiation to execution. But, the little ampersand (&) there has a strength and weakness. It effectively creates a separate thread for every single sound that can be played. This has the plus of allowing other lines to process (mid-combat) while the two-second sound file plays. It has the drawback of allowing as many sounds to be played as my RAM and CPU can physically support. Hence the problem with spamming.


    I've thought about writing a little shell script [to be executed by os.execute()] to do the following: (1) check for a lock file, (2) if no lock file is present, create a lock file and play the sound, (3) at the end of the sound's playing, delete the lock file. This would be ideal since it would prevent more than one sound file from being played at once, except it would destroy my hard drive after a while. Therefore, any solution needs to be done in RAM, and preferably with pure Lua until my playSound() function is called.


    --------------


    Some thoughts.


    I could do something like this:


    lockVariable = false


    function playSound( fileName )

       if lockVariable == false then

          lockVariable = true

          os.execute( "aplay " .. fileName .. " &" )

          lockVariable = false

       end

    end


    But, the ampersand is going to spin off a thread, meaning that the lockVariable will be set back to false while the sound is playing, thus allowing another sound to be played. In other words, I'm back to square one. I can't pull out the ampersand, because that will prevent new lines from being processed by SVO -- it effectively stops all processing until the sound is done playing.


    In short: I need a way to programmatically spin off threads in Lua, and handle thread locking. Then, I can remove the ampersand from my aplay shell command, while still allowing SVO to continue processing. 

    image
  • Here's my playSound:

    function playSound(sound)

      os.execute("gst-launch playbin uri=file:///home/vadi/<sound> &")

    end


    If you'd like to limit the # of them played, I'd use a tempTimer to some minimum time that will disable playing of sounds.

  • edited January 2013
    How does io.popen() compare to using that ampersand in os.execute? Identically?
  • Iocun said:
    How does io.popen() compare to using that ampersand in os.execute? Identically?
    In terms of the actual execution of the process, I think it's essentially the same, at least in Unix/Linux; not sure about Windows. The & just indicates that the command should be executed as a background process. A potentially important difference between the two (though probably immaterial in this context) is that io.popen returns a file handle from which you can read the output and return value of the process, which you can't, as far as I know, with os.execute.
  • Yeah, that's what I often use io.popen for, mainly to return the results of a grep.
  • NizarisNizaris The Holy City of Mhaldor
    @Vadimuses: Thanks! That did it.

    lockV_Sound = false


    function reset_lockVSound()

       lockV_Sound = false

    end


    function playSound( fileName )

    --- Plays specified file name.

       if lockV_sound == false then

          lockV_sound = true

          tempTimer(0.5, [[reset_lockVSound()]])

          os.execute( "aplay " .. fileName .. " &" )

       end

    end

    image
  • Ugh, been away for a bit and lost all the maps I made.  I can't remember how to turn the mapper on and all that and I can't remember where to find that info, any help?

  • JonathinJonathin Retired in a hole.
    Update to Mudlet 2.1 then click the map button, type RL and update the map and script.
    I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.
  • How do I zoom in on the mudlet mapper?
  • @Tahquil you can scroll the mouse wheel to zoom in and out of the map
  • If you haven't got a scrollwheel, you can also make an alias that does setMapZoom(number) to zoom around.
Sign In or Register to comment.