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;;;;
Or do you want to donate some bucks because you like my scripts??? Visit https://www.paypal.me/OrFeAsGr
Thx! ^_^