Mudlet Questions

2456710

Comments

  • edited February 2014


  • Lerad said:
    A simple thing you can do is to just stick
    if patted == nil then
        patted = 0
    end
    Before the arithmetic line.

    This might mean that the number is not saved across sessions, though. If you want to keep track of how many times you've used the patted emote across sessions. You'll need to use the loadVars() and saveVars() functions.
    I recommend doing

    patted = patted or 0

    As that's quicker in Lua, takes up less space as well.
  • How does Lua do if or then? This is a part of my Astrology script:

    function Sphere_Antlers()

    if nAntlersSun == "+4" or "+3" or "+2" or "+1" then

    cecho("AstroRight","\n<medium_spring_green> [ ANTLERS : " .. nAntlersSun .. " ] ")

    elseif nAntlersSun == "-1" or "-2" or "-3" then

    cecho("AstroRight","\n<deep_pink> [ ANTLERS : " .. nAntlersSun .. " ] ")

    else

    cecho("\n<gray> [ ANTLERS : 00 ] ")

    cecho("AstroRight","\n<gray> [ ANTLERS : 00 ] ")

    end

    end


    But the "or" doesn't seem to be clicking.



  • Ahah. Don't mind the above. It should be:

    if nAntlersSun == "+4" or nAntlersSun == "+3" or nAntlersSun == "+2" ...

  • NeosNeos The Subtle Griefer
    edited October 2013
    you can put the ors in parentheses, that should work
    ( "+4" or "+3" or "+2" or "+1" )
    Love gaming? Love gaming stuff? Sign up for Lootcrate and get awesome gaming items. Accompanying video.

     Signature!


    Celina said:
    You can't really same the same, can you?
    Zvoltz said:
    "The Panthron"
  • edited February 2014


  • rofl. Just saw this.
  • My Mudlet mapper doesn't seem to want to download new maps any more - I'll get the notification to update the map, but it just twiddles a bit on the 'Downloading new map' window which then closes without having downloaded anything... is this just me?
    image
  • Ankastra said:
    My Mudlet mapper doesn't seem to want to download new maps any more - I'll get the notification to update the map, but it just twiddles a bit on the 'Downloading new map' window which then closes without having downloaded anything... is this just me?
    When I had this problem, it was because I made a new profile other than the standard one mudlet starts with. For me, I had to connect to "lusternia.com," precisely like that. When I did www.lusternia.com it would not work.

    A simple thing, but it worked for me. Hopefully it helps. :)

    Mayor Steingrim, the Grand Schema says to you, "Well, as I recall you kinda leave a mark whereever you go."
  • Riluna said:
    Ankastra said:
    My Mudlet mapper doesn't seem to want to download new maps any more - I'll get the notification to update the map, but it just twiddles a bit on the 'Downloading new map' window which then closes without having downloaded anything... is this just me?
    When I had this problem, it was because I made a new profile other than the standard one mudlet starts with. For me, I had to connect to "lusternia.com," precisely like that. When I did www.lusternia.com it would not work.

    A simple thing, but it worked for me. Hopefully it helps. :)

    Sadly I already use lusternia.com to connect... it seems to have happened just after the new area was released (I was downloading the map happily before this).
    image
  • TurnusTurnus The Big Bad Wolf
    So I'm trying to set up a highlight in mudlet. For an example of somebody writhing free.

    In this case I have:
    ^(\w+) has writhed free of (his|her) entanglement.$
    as perl regex

    I am using the highlight option to highlight it.

    But, the whole line isn't getting highlighted as I want, instead it's just the wildcards (name and the his/her), what am I doing wrong?

    ~--------------**--------------~

    The original picture of Turnus is still viewable here, again by Feyrll.
  • NeosNeos The Subtle Griefer
    edited January 2014
    You have to use functions to highlight regex triggers unfortunately, but if I can get onto a comp before leaving for work I'll post the function I use.

    @Turnus
    function colorLine(section, fgcolor, bgcolor)

    fgcolor = fgcolor or "white"

    bgcolor = bgcolor or "black"

    resetFormat()

    selectString(section,1)

    fg(fgcolor)

    bg(bgcolor)

    resetFormat()

    end


    You can leave out the bgcolor part if you want it to default to the regular screen background. It's not really set to ignore fgcolor, though I might update it someday.
    Love gaming? Love gaming stuff? Sign up for Lootcrate and get awesome gaming items. Accompanying video.

     Signature!


    Celina said:
    You can't really same the same, can you?
    Zvoltz said:
    "The Panthron"
  • Mudlet will highlight the whole line, or if there are any brackets, the brackets. So one way is to just do this:

    ^((\w+) has writhed free of (his|her) entanglement\.)$

    Or this:

    ^\w+ has writhed free of (?:his|her) entanglement\.$
  • I have a question regarding chat capturing and logging.

    My chat capturer triggers look like this:
    selectCurrentLine()
    bg("black")
    onyx.chat:Echo("Org", "(" .. getTime().hour .. ":" .. getTime().min .. ":" .. getTime().sec .. ") ")
    onyx.chat:Append("Org")
    deleteLine()
    tempLineTrigger(1,1, [[if isPrompt() then deleteLine() end]])

    Now, what that does is select the line, tack on a black background, put a timestamp in the org tab, put the line in the org tab, delete the line and delete the next prompt too. Effectively it makes sure the line never shows up in the main window but does appear in the chat tab.

    My issue is this: When I log the game, by using the screendump command (alias that captures everything in the buffer and sticks it in a log file) I don't log what goes into the chat tabs because that is cut out of the main game feed. I haven't tried if the Mudlet logging button does work around this, but that would mean I'd have to have logging on all the time and that could eat some disk space.

    I am wondering what the possible solutions are to get logs with -everything- in it, while still having tabbed chat. I find it a bit ugly if text would go into both the main window and the tabs, but if that is the only way then I will just deal with that. However any more elegant solution would be vastly preferred.

    Hope that makes sense and that someone can help :)
    image
    You have received a new honour! Congratulations! On this day, you have shown your willingness to ensure a bug-free Lusternia for everyone to enjoy. The face of Iosai the Anomaly unfolds before you, and within you grows the knowledge that you have earned the elusive and rare honour of membership in Her Order.
    Curio Exchange - A website to help with the trading of curio pieces in Lusternia.
  • UshaaraUshaara Schrödinger's Traitor
    edited March 2014
    Unrelated to the logging part of your question, but you could use getTime(true, "hh:mm:ss") instead of your getTime().hour etc. to condense that line a bit.

    As for logging, as a way of learning how to manipulate Mudlet's database functions, I made something that captures everything and adds it to a database before I replace/echo/delete lines. Does mean that it's an all plain text log though, and that it's on all the time, so if there's a better way, I'd be interested in hearing myself.
  • ZouviqilZouviqil Queen of Uberjerkiness
    I keep getting the Mudlet crash loop on my Mac. I have tried removing the map and mapper wholly from my game, and it still occurs, along with the constant asking for an update. Any clues on a fix for this, anyone?
  • TarkentonTarkenton Traitor Bear
    Uninstall reinstall?  Bootcamp into Windows/your choice of flavor of Linux?
    image
  • Mudlet on mac works fine for me. I'd uninstall/reinstall were I you
    image
  • TurnusTurnus The Big Bad Wolf
    Mudlet mapper works in my Mac too.

    ~--------------**--------------~

    The original picture of Turnus is still viewable here, again by Feyrll.
  • I love Mudlet Mapper and use the walk goto all the time to quickly move from place to place. A very basic alias example would look like the following:

    Alias name: Walk Guild
    Pattern: ^walkguild$
    Substitution: goto 14656

    However, I would now love to integrate psymet glide into my Mudlet mapper goto. I originally started to make separate aliases for walk ~AND~ glide, but this caused double work and bloated my alias list.

    Alias name: Glide Guild
    Pattern: ^glideguild$
    Substitution: goto 14656 glide

    I want to combine both walk/glide under a single alias that would be the simplest to code and most efficient to enact in-game. However, I have very limited knowledge of how to script. Whatever little coding I once knew is now long, long forgotten. 

    Can someone give a suggestion how to achieve this effect? 
    image
  • KaimanahiKaimanahi The One True Queen
    To avoid unnecessary scripting and in what I think would be a better solution, I would recommend using the mapper's room mark functionality. You can, for example, do ROOM MARK 21401 THRONE, and then "goto throne" or "goto throne glide" would work as normal. ROOM MARKS shows your room marks, and you can use ROOM UNMARK THRONE to remove them.
    image
  • ...I had no idea that existed. Holy crap!!
  • I know how you can do it with a function, Janalon - mmp.gotoRoom( room#, dashtype )

    So for the above example (going to room 14656 with gliding) it would be:
    mmp.gotoRoom(14656, "glide")

    but put that line in the big box and leave the "substitution" box blank.
    image
  • Kelly said:
    To avoid unnecessary scripting and in what I think would be a better solution, I would recommend using the mapper's room mark functionality. You can, for example, do ROOM MARK 21401 THRONE, and then "goto throne" or "goto throne glide" would work as normal. ROOM MARKS shows your room marks, and you can use ROOM UNMARK THRONE to remove them.
    THANK YOU! 

    This is exactly what I was looking for. Sure, I'll have to rewrite all of my goto aliases, but this method is far preferable to what I had previously. Outta curiosity, where are the "room" values saved?
    image
  • KaimanahiKaimanahi The One True Queen
    You can probably delete all of your "goto aliases", since you can just "goto guild" or whatever if you just set your room marks up.

    The values get saved in one of the mapper files that's in the folder for your active Mudlet profile. The map code is a little too complex for me to easily dig around where exactly it is, so, hopefully that suffices for curiosity sake!
    image
  • Alias Name: Goto Alias

    Pattern: ^got (.+)$

    Codebox:
    if mm.defc.gliding then

    expandAlias("goto " .. matches[2] .. " glide")

    elseif mm.defc.adroitness then

    expandAlias("goto " .. matches[2] .. " sprint")

    else

    expandAlias("goto " .. matches[2] .. "")

    end


  • Hmm. @Lerad's def got the best idea, but out of curiosity - why concatenate an empty string in the last expandAlias?
    image
  • Shoddy coding practices. Self-taught bad habits are hard to break. Like others have also said, using expandAlias is itself not recommended. But for me, whatever works.

  • edited June 2014
    Belibi said:
    Hmm. @Lerad's def got the best idea, but out of curiosity - why concatenate an empty string in the last expandAlias?
    Why is @Lerad's idea better than @Kelly. Coding efficiency or some other in-game result (like faster walking). I do love Kelly's idea so far... even if the syntax use is a bit lengthy for my tastes.
    image
  • The two suggestions are independent of one another. Lerad's showing you how to automatically change up your speedwalking based on your active abilities/defenses.

Sign In or Register to comment.