Typos Corrector Script by OrFeAsGr v0.1

By OrFeAsGr on Mar 26, 2016

SCRIPT ID: TYPOS
This script was an idea of the user Mythos in mIRC Forums! He made a first version and asked help for improving it!
Post: http://forums.mirc.com/ubbthreads.php/topics/252669/Re:_Grammar_script.#Post252669
This is what i came up with. It's a little all over the place but it works fast enough. I may update it later but i'm not sure.
v0.1 14/6/2016
-Added ID and version for update checker


on ^*:text:*:#: {
    if ($strip($1) != !typos) {
    if (!%TYPOSversion) || (%TYPOSversion != v0.1) { set %TYPOSversion v0.1 }
      var %x = 1
      var %w = $hget(typos,typos)
      while (%x <= $numtok(%w,126)) {
        if ($+(*,$gettok(%w,%x,126),*) iswm $strip($1-)) {
          set %testwrongs $addtok(%testwrongs,$gettok(%w,%x,126),124)
          set %testcorrects $addtok(%testcorrects,$gettok(%w,$calc(%x + 1),126),124)
        }
        inc %x 2
      }
      if (%testwrongs) {
        msg $chan Typos: %testwrongs
        msg $chan Corrections: %testcorrects
        unset %testwrongs
        unset %testcorrects
      }
    }
    elseif ($strip($1) == !typos) {
      var %f = $hget(typos,typos)
      if ($strip($2) == add) {
        if (!$hget(typos,0).data) {
          hmake typos 100
        }
        if (!$istok($hget(typos,typos),$gettok($strip($3-),1,126),126)) {
          hdel typos typos
          hadd typos typos $iif(%f, $+($v1,~,$strip($3-)), $strip($3-))
          hsave typos typos.hsh
          msg $chan Added Typo: $gettok($strip($3-),1,126) >>>Correction: $gettok($strip($3-),2,126)
        }
        else { msg $chan This matches an already saved typo or correction. }
      }
      elseif ($strip($2) == del) {
        if ($istok($hget(typos,typos),$strip($3-),126)) {
          var %y = $findtok(%f,$strip($3-),1,126)
          var %s = $gettok(%f,$+(%y,-,$calc(%y + 1)),126)
          hadd typos typos $remove(%f,%s)
          hsave typos typos.hsh
          msg $chan Deleted Typo: $strip($3-) 
        }
        else { msg $chan This typo is not on my list :/ }
      }
    }
  }

ON *:START: { hmake typos 100 | hload typos typos.hsh }
;;;;by OrFeAsGr;;;;;
;;;http://humanity.ucoz.com;;;;

To add a typo and it's correction type !typos add typo~correction
e.g !typos add OrFeAsGr is the worst scripter ever~OrFeAsGr is not the worst but not the best
To delete a typo (....and it's correction) type !typos del typo
e.g !typos del OrFeAsGr is the worst scripter ever

It works with multiple words and signle words.

For any suggestions/improvements or anything related leave a comment :)
Check my other scripts if you haven't already! Thx :)
Check my site and Humanity Bot v3.0.1 ! http://humanity.ucoz.com
PEACE <3
Do you want to help me make some money? You can do it without paying for nothing! Just visit my site http://humanity.ucoz.com ,turn off your ad blocker, watch an ad and turn it back on! You'll be giving me something less than a cent! Thanks!

Or do you want to donate some bucks because you like my scripts??? Visit https://www.paypal.me/OrFeAsGr
Thx! ^_^

Comments

Sign in to comment.
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.