SFV Checker.

By zenx on Oct 25, 2010

Screenshots

SFV checker for mirc, it uses $crc.

I know i could have used loop for checking the files but thought id do that "if" way.

; sfv checker.

alias sfvcheck {

  set %sfv.source $sfile(C:,SFV,Check!)
  if (%sfv.source == $null) || (*.sfv !iswm %sfv.source) { echo -a Either no file selected or not an sfv file. | halt }
  if (!$window(@SFV.check)) { window -k0n @SFV.check }
  aline -p @SFV.check ---------------------------------------------------
  set %filepath.remove $gettok(%sfv.source,-1,92)
  set %filepath $remove(%sfv.source,%filepath.remove)
  set %sfv.path %sfv.source
  set %sfv.lines $lines(%sfv.path)
  if (%sfv.lines == 0) { aline -p @SFV.check SFV File doesnt exist or is empty. | halt }
  set %sfv.loop 0
  sfvloop

}

alias sfvloop {

  inc %sfv.loop
  set %sfv.p %filepath $+ $read(%sfv.path,%sfv.loop)
  if (*;* iswm %sfv.p) { .timer 1 0.1 sfvloop | halt }
  if (*;* !iswm %sfv.p) {
    set %filecrc $upper($gettok(%sfv.p,-1,32))
    set %ourcrc $crc($remove(%sfv.p,$gettok(%sfv.p,-1,32)),2)
    if (%filecrc != %ourcrc) { aline -ph @SFV.check 4error $gettok($read(%sfv.path,%sfv.loop),1,32) }
    if (%filecrc == %ourcrc) { aline -p @SFV.check 9ok! $gettok($read(%sfv.path,%sfv.loop),1,32) }
    if (%sfv.loop != %sfv.lines) { .timer 1 0.5 sfvloop }
    if (%sfv.loop == %sfv.lines) { unset %sfv.* | unset %filecrc | unset %ourcrc | unset %filepath | unset %filepath.remove }
  }
}

menu * {
  SFV Checker:sfvcheck
}

Comments

Sign in to comment.
SiNDAKiT   -  Oct 26, 2010

Yeah this is nice ive checked it and it works like a dream

 Respond  
MashhitDK   -  Oct 25, 2010

Nice... haven't tested this...
But am for sure gonna grab this code for later use :D

 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.