Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Character Counter

SylvanceSylvance Member Posts: 1,477 ✭✭✭✭✭ - Grand Achaean
Hey folks!  Sorry if this is a random or stupid question:

I'm wanting to get Mudlet to store the number of characters in the command I send it as a variable.  Any idea as to the syntax necessary for that? Or is it crazily complex/impossible?

Huge thanks in advance!
Tvistor: If that was a troll, it was masterful.
I take my hat off to you.

Comments

  • EldEld Member Posts: 3,946 @@ - Legendary Achaean
    Well, the variable 'command' stores the last command sent, so you could retrieve the length in characters with string.len(command). Probably the easiest thing to do would just be to store that in a local variable at the beginning of whatever script or function you want to use it in:

       local chars = string.len(command)
       echo("The last command you sent had " .. chars .. " characters.")
    SylvanceJosoul
  • SylvanceSylvance Member Posts: 1,477 ✭✭✭✭✭ - Grand Achaean
    Awesome!  Huge thanks, @Eld!
    Tvistor: If that was a troll, it was masterful.
    I take my hat off to you.
Sign In to Comment.