Armageddon General Discussion Board

General => Code Discussion => Topic started by: najdorf on February 02, 2009, 12:04:46 AM

Title: Proper Sentences
Post by: najdorf on February 02, 2009, 12:04:46 AM
I want to write a script in my client that fixes every improper sentence?

1. Check the sentence's last char.
2. If not . o , or ? or !  -----> Add . to the end.
3. Check if 1st character is Capital or not.
4. If not, capitalize it.
5. paste the sentence again.

Do you know a function that can detect capital character? If so, in which client (because i couldnt find it in the clients i use)?

Also, if we can have this in game also, wouldn't it be great?
Title: Re: Proper Sentences
Post by: Synthesis on February 02, 2009, 12:10:08 AM
First thing you'd want to do is make sure this sort of thing only worked when you were talking/shouting/saying/telling/emoting so that commands don't get fouled up by it.
Title: Re: Proper Sentences
Post by: Good Gortok on February 02, 2009, 12:25:10 AM
I'd like this to be hardcoded. Always felt it should be.
Title: Re: Proper Sentences
Post by: Dar on February 02, 2009, 12:49:18 AM
Another way to do it is to learn to do it manually. As in ... type properly :). Sorry a non constructive post, but. ... couldnt help it.
Title: Re: Proper Sentences
Post by: RogueGunslinger on February 02, 2009, 01:01:08 AM
I typo worse than Ghost types, so that's out of the question.
Title: Re: Proper Sentences
Post by: FantasyWriter on February 02, 2009, 01:43:23 AM
I always fear that everyone know who I play because of my dyslexic typing tendency of making me switch letters around.
Title: Re: Proper Sentences
Post by: najdorf on February 02, 2009, 02:04:03 AM
Quote from: Synthesis on February 02, 2009, 12:10:08 AM
First thing you'd want to do is make sure this sort of thing only worked when you were talking/shouting/saying/telling/emoting so that commands don't get fouled up by it.

All is ready but the problem of detecting a capital letter.
Title: Re: Proper Sentences
Post by: Sephiroto on February 02, 2009, 02:23:05 AM
What client(s) do you use? 

Try looking for the arguments "match case" or "same case".  I have no idea how the script would work but if you did something like have it run a find on all say/tell/shout/ask commands in the manner of "say a"  "say b"  "say c" ...all the way to Z...with matching of cases for lowercase only then you could possibly have it search for all possible verbal commands that begin with lowercase letters (all 26 of them).  Then you could have the script change the first character to a capital.  Do you understand what I'm saying?  Also, then you run into the problems if you use the world "say" in a sentence because then the script might confuse the next word with the beginning of a sentence.

I don't know shit about scripting, but that is the only idea I could think of.  It probably isn't much help, but hopefully this sparks some ideas or guides you in the right direction.
Title: Re: Proper Sentences
Post by: Zoan on February 02, 2009, 03:39:48 AM
I can probably do something in zMUD for you, in Perl. Because it would be Perl, it would also be regular expressions, which can then be used in most MUD clients.

But it's heatwave central in Australia and I'm usually too grouchy to do my OWN work, let alone others, so don't consider me beholden to it.
Title: Re: Proper Sentences
Post by: najdorf on February 02, 2009, 05:51:03 AM
i did it also. actually, most of the clients client can do it. there is a string function "toupper". I just get the first word, and it's first letter as an input to the function.

thanks