Skip to content

Mudlet Scripting

1679111218

Comments

  • Delrayne said:

    Yeah, I know the feeling...especially when I'm doing something for a one shot data gather that i'll rarely ever use again. I just throw in a bunch unitialized stuff that will get dropped when I log off...Though there are suppose to be ways to save variables in there current state on log out...I always found it to be buggy though...Granted that was like two years ago too.

    I've just used table.save and table.load for it. Not sure that is the 'correct' way though.
  • Yeah, that was it. Never worked as intended for me, but like I said it was a long time ago.

  • IniarIniar Australia
    Yeah table save, table load works for me. You could probably use the io.output stuff but means writing a parser or at least thinking about data structure and making it extensible in the first instance. :effort: just don't interrupt when its saving the table - I broke my table once 10/10 won't do again.
    wit beyond measure is a Sidhe's greatest treasure
  • anyone feel like packaging up their def up script? I really don't feel like making one...

  • IniarIniar Australia
    Don't have one. Automation is for Septus. :O
    wit beyond measure is a Sidhe's greatest treasure
  • @Delrayne Coincidentally, Mudlet 3.0.0 alpha just dropped, and it allows you to browse your variables and mark them to be preserved between sessions. Haven't played with it yet, but I'm thinking it might be a little more intuitive than sticking everything in an init and exit script.

    Give me a little while to get Mudlet set back up from a recent OS reinstall and I'll see if I can package up my defup system. It might need a little work.

    http://www.mudlet.org/2014/09/mudlet-3-0-0-alpha/
    image
  • @Dicene Awesome, and if you get a chat capture script to work past 80 characters on 3.0 package that up as well. Everything I've written or installed cuts off after 80 characters, and yes wrap width is set to 0.

  • Yeah, I'm running into the same problem. Coming back to a MUD after a few months can be a long process. =/
    image
  • Here's a copy of the defence system I use. It's missing most classes, probably some general/mini skill defences, and it's generally kind of a WIP, but it works.

    To get it going with the defences I already have set up(most general skills along with most of Hunter, Mage, and Runeguard):
    - Install the package
    - Modify the alias "initkdefs"(it's currently set up to read "me.class" and set up a kdefs table based on that)
    - Use "initkdefs"
    - Use "def" to initialize defs table
    - "df" to draw a defence table
    - "defup" to up the first defence in the defup alias
    - "defsup" to put up all the defs in kdefs on balance
    - "defstop" to stop putting up defs(occurs automatically when all defs in kdefs are up again)

    To set up new defences:
    - Add triggers for the line that shows up when you use DEFENCES
    - Add defence to initkdefs alias
    - Add elseif and command to defup alias

    Probably a healthy chunk of work to get it working with whatever class you have, but it's still less work than writing an entire system from scratch. I may or may not redo the system at some point; if I do, I'll get you a copy.

    https://www.dropbox.com/s/fatyjxv3e1in8o0/Defence System.zip?dl=0
    image
  • @Dicene why not just use 'gmcp.Char.Status.prof' instead of 'me.class' would make it a lot more portable for others to use.

  • IniarIniar Australia
    Or at the top, do

    if not me or not me.class then
    me = me or {}
    me.class = me.class or gmcp.Char.Status.prof
    end

    wit beyond measure is a Sidhe's greatest treasure
  • Probably just didn't think about it at the time. I'm likely to dump it and recode it from scratch in a manner that isn't nearly so sloppy.

    Here's a quick improvement to the "generic def trig" trigger to prevent you from using "defup" when balanceless defences come up, potentially saving some time/herbs/mana. This line is already there, but is missing a lot of defences:

    if defName=="camouflage" or defName=="weathering" or defName=="resistance" or

    defName=="nightsight" or defName=="thirdeye" or defName=="myrrh" or

    defName=="elusiveness" or defName=="secured" or defName=="deathsight" or

    defName=="fenugreek" or defName=="speed" or defName=="frost" or

    defName=="insomnia" or defName=="quince" or defName=="caloric" or

    defName=="levitation" or defName=="venom" or defName=="curseward" then


    Also, if you were running Mudlet 3.0, the issue with the chat cutting off at 80 characters appears to be related to the function "copy()". Here's a temporary workaround. If you haven't modified the function demonnic.chat:append(chat) in the Code script(mine was in YATCO-23/Demonnic/Tabbed Chat/Code), you can just replace that function(not the whole script) with the one in the pastebin at the bottom of this post. If you have modified it, follow the instructions below:


    - Add local curLine = getCurrentLine() between the lines copy() and if demonnic.chat.config.timestamp then

    - Add demonnic.chat.windows[chat]:decho(string.format("<%s,%s,%s:%s,%s,%s>",ofr,ofg,ofb,obr,obg,obb) .. curLine .. "\n") after demonnic.chat.windows[chat]:echo(" ")

    - Add demonnic.chat.windows[demonnic.chat.config.Alltab]:decho(string.format("<%s,%s,%s:%s,%s,%s>",ofr,ofg,ofb,obr,obg,obb) .. curLine .. "\n") after the line demonnic.chat.windows[demonnic.chat.config.Alltab]:echo(" ")

    - Comment out the line demonnic.chat.windows[chat]:append()

    - Comment out the line appendBuffer(string.format("win%s", demonnic.chat.config.Alltab))


    Here is a copy of what the function should look like:


    http://pastebin.com/Jr3BCQZp

    If anyone needs help getting it going, lemme know.

    image
  • @Dicene I have a better solution, since you already have YATCO working, why not just throw it on here too! Thanks for everything thus far as well.

  • Done. Might need to mess with the triggers to get them working with your orgs, and some of the settings in the Config script might not work for you(font and sizes, etc)
    image
  • @Dicene so with the tabbed chat, it reverts back to its old width/height format anytime my command line is more than one line....any idea on why that is? Wouldn't be that big of an issue if half the capture wasn't trying to be printed off screen.

  • @Delrayne Not 100% sure what you mean, just from that description. Get me a screenshot?
    image
  • Well, after thinking about it for a bit, I think I still have his old one installed from his roomitems package bundle...So that may be causing the issue, I'll report back later this evening after I'm able to log back on.

  • edited September 2014
    Ok, so I didn't have two YATCO's installed. So back tot he problem. Picture this:

    Your command line, when you are typing it and it goes to a second line, it expands to display all the text rather than the text just scrolling up. When it expands, a resize event happens in mudlet, that resize event makes YATCO revert to a different size to where I have to use the 'fixchat' alias to make it return to its proper size. Does that make more sense?

    EDIT: as a quick fix I just expanded the size of my input line to be two lines. Not the prettiest fix but it works.

  • I just started having the same issue a short while ago. Didn't seem like that was happening at first, but maybe I just didn't use any two-line commands? I'll dig around a little and see if I can come up with a solution.

    I also had my YATCO size change randomly when I started Mudlet. Had to adjust the width in the config file manually then fixchat. On top of that, I have had my LUA test alias get erased twice now. Anything like those issues come up for you?
    image
  • I don't often have to restart mudlet, since I normally just leave it open. Only on crashes do I really restart it so can't help there...as far as the lua command line package getting erased, I have not yet experienced that one. Clearly still some bugs left in 3.0

  • Mudlet 3.0.0 Beta is out. The bug that was effecting YATCO has been patched. And it starts up hella fast.

    http://www.mudlet.org/2014/10/mudlet-3-0-0-beta-preview-2/
    image
  • IniarIniar Australia
    Have you managed to test out that new flashy Qt5 yet?
    wit beyond measure is a Sidhe's greatest treasure
  • I have not. Honestly, I've never delved too much into labels and stylesheets. There is a screenshot on the Mudlet.org forums of someone having reskinned the normal menu buttons("connect", "alias", "settings", etc) and it looks pretty good.

    Also, not sure if this is an issue that exists in all versions of Mudlet, or if it's exclusive to 3.0, but I'm having issues where scripts end up getting completely cleared. Selecting a trigger/alias/script, navigating with your arrow keys, then switching to a different tab(trigger/alias/script/etc) is consistently replicating that bug, so I'd avoid using arrow keys to navigate in those menus until this issue is definitely resolved.
    image
  • Good thing I don't navigate via the arrow keys. I know this bug was mentioned during the alpha stage, but not sure if anyone has mentioned it in the beta yet.

  • How do you add wormholes to the mudlet mapper? I feel like I'm missing something ultra simple. GMCP is enabled, I did unlock wormholes, and I have tried worm sources, seeking, and going through them with mapping on.
  • If I want to call a variable within a longer variable name, how would I do it?

    Example of what I want to do:

    function queueSet(action,type)

    --Sets the action as the "active" in the specified queue type. Type is bal, eqbal, or eq.

    sys.queue.type.command = action

    end


    I've tried some workarounds, but they've all failed. I'm too embarrassed to show them, as well. I also tried reading through http://www.lua.org/pil/14.1.html but couldn't apply it.

  • MathiausMathiaus Pennsylvania
    Only thing I can see that might be wrong is that you didn't previously define the tables sys, queue, or type in order to have that long list of connecting tables.
    image
  • Mathiaus said:
    Only thing I can see that might be wrong is that you didn't previously define the tables sys, queue, or type in order to have that long list of connecting tables.
    They're defined elsewhere. Running the script through the lua alias, I get this in the debug - 

    Alias: capture group #1 = <lua queueSet(test1,test2)>
    Alias: capture group #2 = <queueSet(test1,test2)>
    LUA: ERROR running script run lua code (Alias6) ERROR:[string "--Queue..."]:72: attempt to index 
    field 'type' (a nil value)

    So I'm assuming that it's identifying "type" literally when I try it that way.
  • IniarIniar Australia
    edited November 2014
    You're probably looking for: sys.queue[type].command... Which isn't the same as sys.queue.type = sys.queue["type"]
    wit beyond measure is a Sidhe's greatest treasure
Sign In or Register to comment.