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)
}
#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
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. =)
.. 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?