Character Counter

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

  • 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.")
  • Awesome!  Huge thanks, @Eld!
    Tvistor: If that was a troll, it was masterful.
    I take my hat off to you.
Sign In or Register to comment.