$caps Identifier

By gooshie on Dec 06, 2009

This is a simple identifier to use to
capitalize the first letter of a string
if for example you were to create a popup
or remote response that begins with a
nickname and want it to look proper.

Image

; usage: $caps(string of text or $nick or $1 etc)

alias caps return $regsubex($1-,/^(.)/S,$upper(\t))

Comments

Sign in to comment.
gooshie   -  Sep 11, 2010

The nice thing about registering mIRC is getting rid of the nag screen so you can launch and connect automagically at boot.

 Respond  
Jethro   -  Sep 10, 2010

$20 US dollars for a lifetime mIRC license doesn't sound like a bad deal at all. You can even negotiate with Khaled, the mIRC creator, for a cheaper price if you can't afford to pay the cost.

 Respond  
KyleJack-Daniels   -  Sep 10, 2010

its says that i have been useing it for 156 or something days lol
and well i cant right click to set my colours so i have got "gummo's" colour script now.
i looked in the script file and they were gone but it doesn't really matter as i can get new ones.
in all the rooms i got in im a @ or higher but when this happened i was a + in them. i tried '/ns update' and it did only some of them. but its ok now.

 Respond  
gooshie   -  Sep 10, 2010

KyleJack-Daniels

mIRC used to (maybe still does) if it is unregistered reset the mirc.ini file some time after the 30 day trial period had ended. It did not delete scripts but it would appear as if it did since they would be unloaded after the reset. Also, after the reset all color settings would return to default settings. Maybe this is what you have experienced.

gooshie

 Respond  
KyleJack-Daniels   -  Sep 10, 2010

well i just found out that my mIRC has deleted all my other scrips including my colour one and it doesn't reconise me anymore.
why does everything go wrong

 Respond  
gooshie   -  Sep 10, 2010

KyleJack-Daniels

You may not really need this script. It is best used with custom pop-ups and response type events when you need to make sure the first word is capitalized for instance if you begin a sentence with a nickname (some people don't capitalize their nick).
There may be other occasional uses.

usage: $caps(string of text or $nick or $1 etc)
Example: Friend Pop-up:say $caps($1) is my friend!
(This would insure that any nick you selected would appear capitalized
regardless if that persons nick began with a capital letter.)

To easily add the alias to your alias section you can simply
enter in mIRC editbox => /alias caps return $regsubex($1-,/^(.)/S,$upper(\t))

To test you could
enter in editbox => //echo $caps(test first letter of first word is capitalized.)

In actual practice it would not be necessary to send the whole line to $caps just whatever word needed to be capitalized. Also, there would be no reason to use it for 'static' words as you could simply type those in with the caps already in place.

gooshie

 Respond  
KyleJack-Daniels   -  Sep 08, 2010

lol yeah im kinda new to the scrips, i have a colour script and the brb,lol,ect scripts and they work but its just this script that doesn't really work.

 Respond  
Veritas   -  Sep 02, 2010

Simple, but handy, I love it :)

 Respond  
Jethro   -  Sep 01, 2010

gooshie, I have a feeling Kyle is not going to digest much of what you've written here. lol

Perhaps in simple words with a couple of examples to demonstrate how this alias is supposed to work. Remember lots of people are new to and learning about MSL.

 Respond  
gooshie   -  Sep 01, 2010

KyleLack-Daniels

On these small, stand alone aliases it's best to NOT use the alias word
and add it into the alias section of your mirc client. Typically we tend
to post it with the alias word simply to make it obvious to the most
casual observer that it is in fact an alias. On more elaborate scripts
with on events that require a few aliases just for its use, by preceeding
the alias with the word alias it can be kept with its parents/dependents
in one script file and loaded into the remote section of the script editor
for easier reading, modifications, and troubleshooting.

Please consult your mirc help files under alias section and after that if
you still have questions feel free to return here for more help.

gooshie

 Respond  
KyleJack-Daniels   -  Aug 31, 2010

i need help it wont let me do it, am i doing something wrong? can you help me please

 Respond  
RJosh   -  Dec 08, 2009

ah very well jethro_ i didn't think of that. and yes nice catch indeed sunslayer

 Respond  
Jethro   -  Dec 07, 2009

Nice catch sunslayer. My example doesn't have that single-lettered bug. :p

 Respond  
sunslayer   -  Dec 07, 2009

@RJosh, true but i would use * instead of + so it will match singe lettered words

 Respond  
Jethro   -  Dec 07, 2009

RJosh, alternatively, you can do:

alias _upper return $regsubex($1-,/(?<=\A|\s)(.)/g,$upper(\1))

This does the same thing. It's shorter and doesn't require the $lower() identifier.

 Respond  
RJosh   -  Dec 07, 2009

@Sunslayer;

$regsubex($1-,/(\w)(.+?)(\W)/g,$+($upper(\1),$lower(\2),\3))

will capitalize the first letter and make the rest of the word lowercase for each word which looks better imo

I'm not really sure why you had to use (.+)(\W|\b). You should have only needed two backreferences at most.

alias _upper return $regsubex($1-,/(\w)(\w+)/g,$upper(\1) $+ $lower(\2))
 Respond  
sunslayer   -  Dec 07, 2009

@Testor thats because Nick-away is one word :p

$regsubex($1-,/(\w)(.+?)(\W|\b)/g,$+($upper(\1),$lower(\2),\3))

will separate words by any non alphanumeric char

And if you Lower the whole string, then new sentences are all also lower cased, unless it actually does that o.O. if your referring to

$lower(\2)

that doesn't lower the whole string, just $right($1,-1)

 Respond  
sunslayer   -  Dec 07, 2009
$regsubex($1-,/(\w)(.+?)(\W)/g,$+($upper(\1),$lower(\2),\3))

will capitalize the first letter and make the rest of the word lowercase for each word which looks better imo

 Respond  
Aucun50   -  Dec 06, 2009

Simple but i could see using it.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.