Skip to content

Mudlet Scripting

11214161718

Comments

  • Kabaal good stuff, this got me to a solution.  Thanks bro!
  • I've been trying to use multiple sessions in mudlet. Works great. Except I cannot adjust the widths of the actual profiles themselves as they appear in mudlet. I can change the wrapwidth to make it all appear properly in the given space, but I'd like for Imperian to dominate 2/3rds of the mudlet space, with othermud smaller?
     You say, "This is much harder than just being a normal person."
  • Ok hoping someone can help me out with just a spacing issue.
    So set up doppleganger to seek, look and return with a clantell saying location of the target and their room num.
    However between <player><vnum> there is no spacing in the clan tell. 

    Script
    send("clt1 Target Location: " ..tar ..vnum)

    I'm sure the spacing is messed up somewhere and wasted so much time last night trying to fix it.
    Other issue is when it reports it is giving the wrong vnum the first time but if you repeat the command it correct's itself.
    Is this possibly because there is a vnum loop issue in some other trigger, alias, etc?
    This latter problem isn't my own. Just trying to help my sister out but without being able to sit down and go all the way through her system just going on best guess that is the problem.

    Lastly very new to trying to learn to code so I'd appreciate any input. 
    Thanks!
  • Oystir said:
    I've been trying to use multiple sessions in mudlet. Works great. Except I cannot adjust the widths of the actual profiles themselves as they appear in mudlet. I can change the wrapwidth to make it all appear properly in the given space, but I'd like for Imperian to dominate 2/3rds of the mudlet space, with othermud smaller?
    If you haven't found it yet, you could use 'Multiview' but that only splits the windows in half on the screen, rather than a 2/3 ratio.

  • IniarIniar Australia
    Galador said:
    Ok hoping someone can help me out with just a spacing issue.
    So set up doppleganger to seek, look and return with a clantell saying location of the target and their room num.
    However between <player><vnum> there is no spacing in the clan tell. 

    Script
    send("clt1 Target Location: " ..tar ..vnum)

    I'm sure the spacing is messed up somewhere and wasted so much time last night trying to fix it.
    Other issue is when it reports it is giving the wrong vnum the first time but if you repeat the command it correct's itself.
    Is this possibly because there is a vnum loop issue in some other trigger, alias, etc?
    This latter problem isn't my own. Just trying to help my sister out but without being able to sit down and go all the way through her system just going on best guess that is the problem.

    Lastly very new to trying to learn to code so I'd appreciate any input. 
    Thanks!
    Without looking at the rest of code:

    send("clt1 Target Location: " ..tar ..vnum)

    you can try this:

    vnum = " "..vnum -- this will force vnum to have a space in front of it
    send("clt1 Target Location: " ..tar ..vnum)

    About the vnum being wrong the first time, maybe just try a different variable name altogether; this_room or my_room or roomNumber
    wit beyond measure is a Sidhe's greatest treasure
  • <3 Iniar thanks.
  • KolfinnKolfinn Vegas baby, Vegas
    Alternatively,

    send("clt1 Target Location: " .. tar .. " " .. vnum)
  • IniarIniar Australia
    edited January 2016
    Kolfinn said:
    Alternatively,

    send("clt1 Target Location: " .. tar .. " " .. vnum)



    Easier to stuff up for people not used to concatenating in Mudlet... that's why I did it on a separate line. Harder to eff up. Why doesn't it work? I put in exactly 400 apostrophes!
    wit beyond measure is a Sidhe's greatest treasure

  •           Ario -                  Kinsarmar Crossroads -
             Aurin -              Merchant's Circle next t -
           Baasche -                      The Redwood Path - the Underworld Khandava
            Blanvo -                 The Celidon Threshold -
         Caelbrook -                        Monarch Square - the Khandava Council


    ? If this requires updating the map, I need somebody to lay out step by step, idiot instructions for me please cause this stuff always stumps me.
     You say, "This is much harder than just being a normal person."
  • http://snag.gy/yAf5T.jpg

    What am I doing wrong? The cecho is working, so it must be something wrong with my if statement.

    I feel like I need a table of targets that are either true or false, or I need to use a function like strcmp?
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • Quotes around locust
  • Kabaal said:
    Quotes around locust
    I did that too and it didn't work. I've put quotes and parenthesis in every combination I can think of.
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • edited February 2016
    Imo, change it to:

    if target:lower():match("locust") then send(stuff) end


    In my experience, Mudlet sometimes doesn't like string comps, so I try to use string.match(<string 1>, <string 2>) or <string 1>:match(<string 2>) whenever possible.

    Edit: Just to clarify, this modification attempts to compare(with the match function that is built into all strings) a lowercase version of the target variable(with the built in lower function). If you were using this to compare two variables, it'd look like:

    if target:lower():match(target2:lower()) then stuff() end
    image
  • Yeah, that's almost certainly it. String equality should almost always be handled with string fuctions.

    "On the battlefield I am a god. I love war. The steel, the smell, the corpses. I wish there were more. On the first day I drove the Northmen back alone at the ford. Alone! On the second I carried the bridge! Me! Yesterday I climbed the Heroes! I love war! I… I wish it wasn’t over."

  • The problem was I use target = matches[2]:title() in my targeting alias, which made me need to do target == "Locust."

    Thanks for the help!

    As a side note, if any of you have any good websites/resources for learning basic Lua, feel free to share.. I want to get past this coding plateau.
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • Holy geez, group your triggers up so they're not one endless list :|
  • Alright. I need a bit of help, here. I just cold-downloaded Mudlet, picked up Demonnic's tabbed chat, and I'm trying (and failing) to get a half-decent bashing setup.


    I looked through the thread, and I...got lost when I saw the first set up scripts. I am not a programmer, I don't know programming language. I have -literally- no aptitude for any of it. I have to read what these things are supposed to do to get an idea -of- what they do, and I'm still left scratching my head trying to figure it out. So, I thought I'd post what I'm looking to do here.

    1) Numkey movement. I get to a bashing area, activate all of my bonuses, and want to go 'Alright, here's what we've got.'

    2) Eyeball whether or not there are mobs and if starting a fight would be a survivable prospect.

    3) Press a button to bash them down. Lather, rinse, repeat, if possible, on the first button-press.

    4) Go back to step 1.

  • Agrias said:

    Alright. I need a bit of help, here. I just cold-downloaded Mudlet, picked up Demonnic's tabbed chat, and I'm trying (and failing) to get a half-decent bashing setup.


    I looked through the thread, and I...got lost when I saw the first set up scripts. I am not a programmer, I don't know programming language. I have -literally- no aptitude for any of it. I have to read what these things are supposed to do to get an idea -of- what they do, and I'm still left scratching my head trying to figure it out. So, I thought I'd post what I'm looking to do here.

    1) Numkey movement. I get to a bashing area, activate all of my bonuses, and want to go 'Alright, here's what we've got.'

    2) Eyeball whether or not there are mobs and if starting a fight would be a survivable prospect.

    3) Press a button to bash them down. Lather, rinse, repeat, if possible, on the first button-press.

    4) Go back to step 1.

    If no one posts a response to this soon, I can help you IG. Just contact me. What you're wanting to do seems pretty simple. Someone might post the exact aliases and triggers you need here, though.
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • IniarIniar Australia
    My hue-by-time export:


    Should be self-contained.
    wit beyond measure is a Sidhe's greatest treasure
  • Mudlet mapper questions.

    Firstly: My mudlet mapper is invisible.  Like, I can still GOTO vnums (but curiously I can't GOTO [area name]), but the visual componant of the mudlet mapper is invisible no matter what I do.  It's not hyper zoomed out or in, and the small mapper menu is still visible (see image: http://imgur.com/hkum0AV).

    Secondly is aforementioned goto area name issue.  I was told updating my mapper should help with it, but, no dice.

    Help is appreciated.


    Today we shall die.
  • http://snag.gy/ZTJy3.jpg

    I have no idea why this isn't working.
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • http://snag.gy/ZTJy3.jpg

    I have no idea why this isn't working.
    Health_reserves and mana_reserves aren't divided by 11 in GMCP, they're returned as Imperian values and not Achaea values..
  • Juran said:
    http://snag.gy/ZTJy3.jpg

    I have no idea why this isn't working.
    Health_reserves and mana_reserves aren't divided by 11 in GMCP, they're returned as Imperian values and not Achaea values..
    You're so smart. Thanks


    This is my new one. It -seems- to be working.
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • SalikSalik Da Burgh
    Anybody know why this might not work:

    function saveTable(name)

    table.save(getMudletHomeDir().."/"..name..".lua", name)

    cecho("\n<dark_slate_gray:dim_grey>"..name.." saved!")

    end


    function loadTable(name)

    table.load(getMudletHomeDir().."/"..name..".lua", name)

    cecho("\n<dark_slate_gray:dim_grey>"..name.." loaded!")

    end


    ?

  • SalikSalik Da Burgh
    Trouble of the moment part two:

    Anybody have a clue what I'm doing wrong here to make this bit work?
    image
  • What is the easiest way to alternate cast directions while fishing?

    Can I use a RNG to randomly choose a direction?
    (Ring): Lartus says, "I heard Theophilus once threw a grenade and killed ten people."
    (Ring): Lartus says, "Then it exploded."

    (Ring): Zsetsu says, "Everyone's playing checkers, but Theophilus is playing chess."
  • SalikSalik Da Burgh
    You could.

    If the direction is based on the rooms around you...

    math.random(table.size(gmcp.Info.Room.exits)) to generate a random number, which you can then compare to the table of exits. As one option. Otherwise, draw it into a table and run it down one at a time.
  • IniarIniar Australia
    Salik said:
    Trouble of the moment part two:

    Anybody have a clue what I'm doing wrong here to make this bit work?
    image
    Hey Salik, I remember having to figure that out, it was quite painful:

    image

    image

    hope it works for you!
    wit beyond measure is a Sidhe's greatest treasure
  • I feel like I'm missing something with the gmcp Comm events. Anyone who uses them mind sharing an example?
  • IniarIniar Australia
    gmcp Comm is so horrible I stopped used them. :P
    wit beyond measure is a Sidhe's greatest treasure
Sign In or Register to comment.