Few Mudlet Questions

SylvesterSylvester Member Posts: 16 Inept
Hey guys, I've got a few questions in regards to Mudlet and triggers and the like.

I'm wanting to take a default line and replace it with a multiline of text mainly. I've been looking around and couldn't find anything on it. I've found some things showing how to highlight or color text, but I'm wanting to replace the line with something else that's a bit bigger/multiline and wondering how to do this and what would be the more efficient way to do it.

Ok, I thought I had more questions, but I guess this was the only one. If I come across another one, I'll post here. Thank you in advance.

Comments

  • MaekoMaeko Member Posts: 38 Capable
    To gag the existing line, use
    deleteLine()

    Then to replace it, use either echo or cecho.
  • SylvesterSylvester Member Posts: 16 Inept
    edited January 19
    Alright thanks, btw, what's the difference between echo and cecho?

    As well, would this be done in the trigger itself? Like...

    Pattern: Trigger Line

    Code:
    deleteLine()
    cecho("line 1")
    cecho("line 2")
    cecho("line 3")


  • MaekoMaeko Member Posts: 38 Capable
    edited January 19
    echo just echoes the text. cecho allows embedding colors in the message, e.g.
    cecho("<green>This text is green!")

    See the docs here

    Yes, you'd put that in the code for the trigger. You can have each line as a separate echo, or use the newline character (\n) to insert newlines.
  • SylvesterSylvester Member Posts: 16 Inept
    Ah alright, thank you!
  • SylvesterSylvester Member Posts: 16 Inept
    edited January 19
    ok, new question, some reason in Mudlet, when I go to search for a trigger, it'll show in the search results, but when I click on it to go to it, it doesn't go to the trigger.

    Specifically, I'm using m&m, and when I search for the trigger "dissolves the shimmering", it show a trigger for it, with the name 3787, but when I click on it to go to the trigger, nothing happens. So, I don't know where I can edit this at all.

    EDIT: @Mrak shot me the answer to this in game. So, thanks goes to them. It's because the trigger was being loaded by Mudlet, but wasn't actually in Mudlet. It's being loaded from the base MMF LUA file, which can be edited with Notepad++.
    Post edited by Sylvester on
  • DeichtineDeichtine Member Posts: 1,633 Transcendent
    As a quick note about gagging. The deleteLine() I found didnt work as well as I wanted. It had a issue with not getting rid of all the prompt.

    You can make a script that does

    function deleteFull()
      deleteLine()
      tempLineTrigger(1,1,[[if isPrompt() then deleteLine() end]])
    end


    and then use deleteFull() instead and it sort of tidies up the prompt issue

  • NyxariNyxari Member Posts: 28 Capable
    deletefull has been a native function of Mudlet since 2.1, just so you know.


    No need to make a script that does it.
Sign In or Register to comment.