KHD

!sv

KHD
Nov 13th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.61 KB | None | 0 0
  1. alias f2 { parseSV.CSV }
  2. alias parseSV.CSV {
  3.   ;var %file = $sfile(*.csv)
  4.   var %file = $dropbox(Trainer Shiny Values.csv).qt
  5.   if (%file) {
  6.     if ($isFile(shinyvalues.txt)) remove -b $qt(shinyvalues.txt)
  7.     if ($isFile(sv_contacts.txt)) remove -b $qt(sv_contacts.txt)
  8.     msg #debug filtering
  9.     filter -fk %file sortsv.csv
  10.   }
  11. }
  12. alias sortsv.csv {
  13.   var %file = shinyvalues.txt, %re = /,,/, %sub = $+($chr(44),$false,$chr(44))
  14.   tokenize 44 $regsubex($1-, %re, %sub)
  15.   if ($2 isnum 0-4095) {
  16.     if ($read(%file,ns,$2)) write $+(-l,$readn) %file $2 $addtok($v1,$1,44)
  17.     else write %file $2 $1
  18.     write sv_contacts.txt $1 $(|) $+($2,$(|),$3)
  19.   }
  20. }
  21. on *:TEXT:!sv *:*: {
  22.   if ($numtok($1-,32) < 1) return
  23.   var %window = $iif($chan,$v1,$nick), %svFile = shinyvalues.txt, %contactFile = sv_contacts.txt, %tmpFile = sv.tmp, %query = 1
  24.   while ($gettok($2-,%query,44)) {
  25.     var %sv = $gettok($v1,1-,32)
  26.     if (%sv isnum) {
  27.       if ($read(%svfile,ns,%sv)) {
  28.         var %sv_info = $v1, %matchCount = 1
  29.         if ($numtok($2-,44) > 1) write %tmpFile msg %window Matches for %sv
  30.         while ($gettok(%sv_info,%matchCount,44)) {
  31.           write %tmpFile msg %window $v1 $!(|) Contact via $gettok($read(%contactFile, ns, $v1 $(|)),2-,124)
  32.           inc %matchCount
  33.         }
  34.       }
  35.     }
  36.     else {
  37.       if ($read(%contactFile, ns, $2- $(|))) {
  38.         write %tmpFile msg %window $gettok($v1,1,124) $!(|) Contact via $gettok($v1,2-,124)
  39.       }
  40.     }
  41.     inc %query
  42.   }
  43.   if ($isFile(%tmpFile)) {
  44.     play -c %window %tmpFile
  45.     remove %tmpFile
  46.   }
  47.   else {
  48.     msg %window No matches found
  49.   }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment