Mudlet Code Snippets - post any useful ones you might have here!

124»

Comments

  • AeldraAeldra , using cake powered flight
    Selenity said:
    First of all, you'll need this function I made because I don't remember what the Mudlet version of it is.

    function inArray(array_, key)
      result = table.index_of(array_, key)
      return result and true or false
    end



    for the record, you can use
     
    table.contains(array, value)
    for that. For a list of mudlet specific functions, I have this bookmarked: https://wiki.mudlet.org/w/Manual:Table_Functions#table.contains

    Avatar / Picture done by the lovely Gurashi.
  • QuixoteQuixote Manchester, UK
    Little snippet somebody asked me to write. Shove this in an alias.

    Pattern match: 
    ^bless$
    Containing the code:
    local room = gmcp.Room.Info.name
    if not room:find("The Cave of") then return end
    send("karma blessing "..room:match("%w+$"))
    Then simply type bless when in a karma cave and it'll send the correct type.
Sign In or Register to comment.