capitalize

By AnDyWong on Jan 07, 2009

use it on input::
cap all first in word.. Info:: non colour or format code ie. bold/underline/colour/reverse

alias capfirst {
  var %fs 1 , %txaa , %ou , %tmq 
  while (%fs <= $numtok($1-,32)) {
    %txaa = $gettok($1-,%fs,32)
    %tmq = $upper($left(%txaa,1)) $+ $mid(%txaa,2)
    %ou = %ou %tmq
    inc %fs
  }
  return %ou
}

on *:input:*: {
  var %axx $strip($iif(%capfirst == off,$1-,$capfirst($1-)))
  if (/* iswm $1-) goto x
  msg $target %axx
  haltdef
  :x
}

on *:load:{ set %capfirst on }
menu channel {
Input
.Capitalize- $+ $(%capfirst):/set %capfirst $iif(%capfirst == on,off,on)
}

Comments

Sign in to comment.
napa182   -  Jan 08, 2009

AnDyWong Said:

thanks napa182... :)
i'm new in mirc script.. i made just using idea hehe..

No problem. If you need and help you can find me on /server -m irc.ezzychat.com
in #lobby or most any room on that server......

 Respond  
AnDyWong   -  Jan 07, 2009

thanks napa182... :)
i'm new in mirc script.. i made just using idea hehe..

 Respond  
napa182   -  Jan 07, 2009

you could use $regsubex

$regsubex($1-,/(\w+)/gS,$+($upper($left(\t,1)),$lower($right(\t,-1))))

so the whole code would look like this

on *:input:*:{  if (%capfirst && !$istok($chr(33) $chr(47),$left($1,1),32)) { msg # $regsubex($1-,/(\w+)/gS,$+($upper($left(\t,1)),$lower($right(\t,-1)))) | haltdef } }
menu * {
  .Capitalize Turn $iif(%capfirst,OFF,ON):{ $iif(%capfirst,unset %capfirst,set %capfirst on) | Echo -a Capitalize First Letter Is Now $iif(%capfirst,ON!,OFF!) }
}
 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.