Gammon Forum
Entire forum
MUSHclient
General
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 page
Posted by
| Lilbopeep
USA (42 posts) 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,.~`'~., | top |
|
Posted by
| Fiendish
USA (2,514 posts) 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 | top |
|
Posted by
| Lilbopeep
USA (42 posts) 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,.~`'~., | top |
|
Posted by
| Fiendish
USA (2,514 posts) 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 | top |
|
Posted by
| Lilbopeep
USA (42 posts) bio
|
Date
| Reply #4 on Wed 07 Dec 2011 06:33 AM (UTC) |
Message
| perfect. Thanks for the help! |
,.~`'~.,Dance Magic Dance,.~`'~., | 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,301 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.