Sentence ender/capitalization

By token on Sep 20, 2007

a simple code for lazy people like me ;) to edit which presets you would like to have on or off; go to the var %tmp and replace the first on/off with the choice you decide to enable/disable the period ender and the second on/off to enable/disable the captialization at the beginning of each sentence. to disable/enable the entire snippet, a simple menu will do that work for you.

#sent.comp on
on *:INPUT:*:{ 
  var %tmp = on,on
  if ($left($1-,1) !iswm /) && ($active !iswm Status Window) { 
  msg $active $+($iif($gettok(%tmp,2,44) = on,$+($upper($left($1,1)),$right($1-,-1)),$1-),$iif($gettok(%tmp,1,44) = on,$chr(46),$chr(32))) }
  halt 
}
#sent.comp end

menu channel { 
  Sentence completer: 
  .Current status $iif($group(#sent.comp).status iswm On, On, Off): 
  ..On/Off:$iif($group(#sent.comp).status iswm on, disable #sent.comp, enable #sent.comp)
}

Comments

Sign in to comment.
Kirby   -  Dec 21, 2008

This looks like a code from quite a while ago.
Anyways, tested and liked it.
Turns out quite useful for people I talk to who communicate like:

too late hun nor is yur muimummu

/me rates 8.0

 Respond  
Bullet_Dodger   -  Sep 26, 2008

Oh yea forgot about that.

 Respond  
Akishoot   -  Sep 26, 2008

Bullet_Dodger: Check to make sure you do not have two 'on *:INPUT' scripts going at once.

 Respond  
Bullet_Dodger   -  Sep 26, 2008

[6:47pm] <~Bullet_Dodger> Testing script
[6:47pm] <~Bullet_Dodger> Testing script.
[6:47pm] <~Bullet_Dodger> Testing script
[6:47pm] <~Bullet_Dodger> Testing script.
[6:47pm] <~Bullet_Dodger> Testing script
[6:47pm] <~Bullet_Dodger> Testing script.

^ Err it repeats everything twice

 Respond  
Eugenio   -  Sep 21, 2008

rofl

 Respond  
napa182   -  Sep 21, 2008

TropicalMeltdown
use the damn edit buttton ffs.. damn flooder.. and if you want color's then add them ur self.

 Respond  
TropicalMeltdown   -  Sep 21, 2008

Put Some colors dude

 Respond  
TropicalMeltdown   -  Sep 21, 2008

no colors dude

 Respond  
TropicalMeltdown   -  Sep 21, 2008

YU ROCK IMRAC

 Respond  
Imrac   -  Sep 20, 2008
#sent.comp on
on *:INPUT:*:{ if (/* !iswm $1-) && ($active != Status Window) { msg $active $regsubex($regsubex($1-,/^((?:\x03\d{0,2}(?:,\d{0,2})?|\x02|\x1f|\x22)*(?:[a-z]))/, $upper(\t)), /([^.?!])$/, \t $+ $chr(46)) | halt } }
#sent.comp end

menu channel,status,query {
  Sentance Completer
  .$iif($group(#sent.comp).status  == on, Disable, Enable) : $iif($group(#sent.comp).status  == on, .disable #sent.comp, .enable #sent.comp)
}

My version of it, handles colors, punctuation at the end, updated menu

 Respond  
TropicalMeltdown   -  Sep 20, 2008

still no colors

 Respond  
Akishoot   -  Sep 07, 2008

Useful to me since later in the evenings I get pretty lazy, and its a great idea. :)

7/10

 Respond  
TropicalMeltdown   -  Sep 07, 2008

4 real add colors

 Respond  
TropicalMeltdown   -  Jul 22, 2008

Hey man it be cool if you could put colors for punc. and Cap letter and stuff

 Respond  
token   -  Sep 20, 2007

glad to hear it =)

 Respond  
guest598594   -  Sep 20, 2007

yea the $iif thing wasnt from ur script

now it works fine, with capital and period :P

 Respond  
token   -  Sep 20, 2007

i found an error. i think what was happening was that the actual snippet only worked if the first letter was lower cased, thus if you chose to not start with a capital letter it wouldn\'t work unless you manually typed it. i\'ve fixed that problem and removed some useless code. it should be a bit cleaner now. thanks mountaindew for your assistance. =)

 Respond  
token   -  Sep 20, 2007

.. yes it should.. $chr(46) returns a period. i hope i explained everything clearly here is how it\'s supposed to work:

the %tmp variable returns two values sperated by a comma. the first value returns whether to end the sentence with a period, the second value returns whether to start the sentence with a capital letter. if you pasted the script exactly as it is now, then everything should be on. i think i am going to edit this a bit, because i think i see what you are talking about mountaindew. when you type the sentence, does it start with a capital without the capital letter option on?

 Respond  
guest598594   -  Sep 20, 2007

hmm...it may be another script of mine then

but you had a lot of unnecessary code in the on input, and you didnt even have a period ender like u said

 Respond  
token   -  Sep 20, 2007

@ SilentExile, thank you

@ mountaindew, could you specify which line in the script? everything worked fine for me so I have no clue why there would be an error.

 Respond  
guest598594   -  Sep 20, 2007
on *:INPUT:*:{ 
  var %x = .!
  if ($left($1-,1) != / && $active != Status Window && $left($1-,1) islower && $right($1-,1) !isin %x) { 
    msg $active $upper($left($1-,1)) $+ $right($1-,$calc($len($1-) - 1)) $+ . | haltdef
  }
}

that works, but idk whats wrong with the menu

 Respond  
guest598594   -  Sep 20, 2007

but it doesnt work for me

it says theres a problem with the $iif

 Respond  
guest598594   -  Sep 20, 2007

dude that is a good idea, i love it!

 Respond  
SilentExile   -  Sep 20, 2007

Not a bad little snippet here. If I had the ability to: 4.5/10.

 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.