[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  always add punctuation unless it already exists

always add punctuation unless it already exists

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Lilbopeep   USA  (42 posts)  [Biography] bio
Date Wed 07 Dec 2011 02:41 AM (UTC)
Message
i've been trying to figure out how to do this. Basically, unless I have already used punctuation, I would like add a period to the end.

,.~`'~.,Dance Magic Dance,.~`'~.,
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Wed 07 Dec 2011 03:21 AM (UTC)

Amended on Wed 07 Dec 2011 03:25 AM (UTC) by Fiendish

Message
In what language?

In Lua you could do something like...

punctuation_table = {"."=true,"?"=true,"!"=true}
if not punctuation_table[string.sub(your_string,-1)] then
   your_string = your_string.."."
end

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Lilbopeep   USA  (42 posts)  [Biography] bio
Date Reply #2 on Wed 07 Dec 2011 03:56 AM (UTC)
Message
for instance ...

match on clan *


your_string = '%1'
punctuation_table = {"."=true,"?"=true,"!"=true}
if not punctuation_table[string.sub(your_string,-1)] then
   your_string = your_string.."."
end
ColourNote ("Black", "Blue", " You clanned .. your_string ..")


,.~`'~.,Dance Magic Dance,.~`'~.,
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Wed 07 Dec 2011 04:59 AM (UTC)
Message
Lilbopeep said:

ColourNote ("Black", "Blue", " You clanned .. your_string ..")
is wrong.

You need
ColourNote ("Black", "Blue", " You clanned ".. your_string)

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Lilbopeep   USA  (42 posts)  [Biography] bio
Date Reply #4 on Wed 07 Dec 2011 06:33 AM (UTC)
Message
perfect. Thanks for the help!

,.~`'~.,Dance Magic Dance,.~`'~.,
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,362 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]