The Picky Mother (Period Ender)

By Numuruzero on Sep 01, 2008

Mothers, as we all know, tend to pick on kids about their grammar. They're all ashamed, but that's not the point. This script simply adds a dot to the end of anything you say, as long as whatever you said doesn't already end in a dot, comma, question mark, or exclamation point. Thanks to Eugenio. I made it originally but just couldn't get it to work. He did something apparently irrelevant and made it work, so, kudos to him. It'll also halt if you begin with an exclamation point since it's assumed you're using a bot command when you do that.

alias doton { set %dot on | echo -a Dot script is now on. }
alias dotoff { unset %dot | echo -a Dot script is now off. }
on *:INPUT:*: {
  if (%dot == on) {
    if ($left($1,1) == /) { $1- | halt }
    if ($left($1,1) == !) { msg $active $1- | halt }
    if ($right($1-,1) == $chr(33)) { msg $active $1- | halt }
    if ($right($1-,1) == $chr(46)) { msg $active $1- | halt }
    if ($right($1-,1) == $chr(63)) { msg $active $1- | halt }
    if ($right($1-,1) == $chr(44)) { msg $active $1- | halt }
    haltdef
    msg $active $1- $+ .
  }
}

Comments

Sign in to comment.
troll   -  Apr 27, 2011

nice, just added some colors and i like it

 Respond  
Jonesy44   -  Sep 02, 2008

basically using isin means ALL the text must be matched..

if (abc isin abcdefg) YES

but,

if (abc isin aqubertc) NO

So trying to match ". ! ?" etc is trying to match . ! ? in that succection not one of them, somwhere, which regex can do

 Respond  
napa182   -  Sep 01, 2008

well instead of regex you can use tokens

alias dot { $iif($1 == on,set %dot on,$iif($1 == off,unset %dot)) | echo -a $iif(%dot,Dot script is now on.,Dot script is now off.) }
on *:INPUT:*: {
  if (%dot) {
    if ($istok(/ !,$left($1,1),32)) { $1- | halt }
    if ($istok($chr(33) $chr(46) $chr(63) $chr(44),$right($1-,1),32)) { msg $active $1- | halt }
    msg $active $1- $+ .
    haltdef
  }
}
 Respond  
Eugenio   -  Sep 01, 2008

'Tch.

 Respond  
_Daniel_   -  Sep 01, 2008

Regex na Cadeia!!

 Respond  
napalm`   -  Sep 01, 2008

I take it you labeled as follows:

1: if ($right($1-,1) isin ! . ? ,) {

2: if ($regex($1-,(!|.|\?|\,)$)) {

Functionality:

1: Matches last character in $1- to: ! . ? ,

2: Matches last character in $1- to: ! . ? ,

Also, you said "no because that would need to match all of the text" exactly what does that mean? I thought we were just matching punctuations?

 Respond  
Jonesy44   -  Sep 01, 2008

1: no because that would need to match all of the text

2: Yeah, that would work.

 Respond  
napalm`   -  Sep 01, 2008

Er,

if ($regex($right($1-,1),/($chr(33)|$chr(46)|$chr(63)|$chr(44))/) {

can be:

if ($right($1-,1) isin ! . ? ,) {

or..

if ($regex($1-,(!|.|\?|\,)$)) {

 Respond  
Numuruzero   -  Sep 01, 2008

Oh yeah, well I can make people laugh at my sad attempts at regex. So NO REGEX FOR ME. Unless I start learning HTML in which case there will be hearty laughs all around.

 Respond  
Jonesy44   -  Sep 01, 2008

Lmfao! Regex is very helpful. I'm more used to using it in PHP. where i know what things mean, i can only use the basic expressions in mIRC.

 Respond  
Numuruzero   -  Sep 01, 2008

Regex hurts people. That's what's wrong with it. It used to be a samurai in a past life. You're welcome Eugene. Just don't crush us with your skull.

 Respond  
Numuruzero   -  Sep 01, 2008

Ouch. I think you just hurt my brain.

 Respond  
Jonesy44   -  Sep 01, 2008

What's wrong with regex?

 Respond  
Eugenio   -  Sep 01, 2008

ew @ regex
/me barfs
Thanks for regocnition
/me 's head expands && rates 6

 Respond  
Jonesy44   -  Sep 01, 2008
on *:INPUT:*: {
  if (%dot) {
    if (!$regex($left($1,1),/(\/|!)/)) {
      if ($regex($right($1-,1),/($chr(33)|$chr(46)|$chr(63)|$chr(44))/) {
        msg $active $1-
      }
    }
    else {
      msg $active $+($1-,.)
      halt
    }
  }
}
 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.