[Addon]
Script=Cryoa's File Server Tracker
Version=1.1
Author=Cryoa
Desc=This is File Server Tracking Addon for Invision
Date=January 18th, 2002
[script]
n0=alias FSTReport {
n1=  if $1 != $null {
n2=    set %FSTnickrec $replace($address($1,3),~,=)
n3=    set %FSTnicklog $replace($address($1,3),~,=,*,^)
n4=    if %FSTnickrec == $null { set %FSTnickrec $1 }
n5=    if %FSTnicklog == $null { set %FSTnicklog $1 }
n6=
n7=    if $gettok($r.fstRec(Servers,%FSTnickrec),3,32) != $null {
n8=      FSTsolowin
n9=      set %FSTrepNick $gettok($r.fstRec(Servers,%FSTnickrec),1,32)
n10=      set %FSTrepHost $gettok($r.fstRec(Servers,%FSTnickrec),2,32)
n11=      set %FSTrepStart $gettok($r.fstRec(Servers,%FSTnickrec),6,32)
n12=      set %FSTrepSday $gettok(%FSTrepStart,1,58)
n13=      set %FSTrepShour $gettok(%FSTrepStart,2,58)
n14=      set %FSTrepSmin $gettok(%FSTrepStart,3,58)
n15=      set %FSTrepAMPM am
n16=      if %FSTrepShour > 12 { set %FSTrepAMPM pm | dec %FSTrepShour 12 } 
n17=      set %FSTrepSmonth $time(m)
n18=      if %FSTrepSday < $time(d) { if %FSTrepSmonth == 1 { set %FSTrepSmonth 12 } | else { dec %FSTrepSmonth 1 } }
n19=
n20=      set %FSTrepTST $gettok($r.fstRec(Servers,%FSTnickrec),3,32)
n21=      set %FSTrepDaysServed $gettok(%FSTrepTST,1,58)
n22=      set %FSTrepHoursServed $gettok(%FSTrepTST,2,58)
n23=      set %FSTrepMinutesServed $gettok(%FSTrepTST,3,58)
n24=      set %FSTrepACC $gettok($r.fstRec(Servers,%FSTnickrec),4,32)
n25=      set %FSTrepLSS $gettok($r.fstRec(Servers,%FSTnickrec),7-,32)
n26=      aline -p @FS_SingleReport $c(1) $+ File Server Report for: $c(2) $+ %FSTrepNick
n27=      aline -p @FS_SingleReport $c(1) $+ Last Host Address: $c(2) $+ %FSTrepHost
n28=      aline -p @FS_SingleReport $c(1) $+ Total Time Served: $c(2) $+ %FSTrepDaysServed $c(1) $+ days, $c(2) $+ %FSTrepHoursServed $c(1) $+ hours, $c(2) $+ %FSTrepMinutesServed $c(1) $+ minutes.
n29=      aline -p @FS_SingleReport $c(1) $+ Last (or Current) Start Time: $c(2) $+ $getmonth(%FSTrepSmonth) %FSTrepSday $+ , at %FSTrepShour $+ : $+ %FSTrepSmin $+ %FSTrepAMPM
n30=      aline -p @FS_SingleReport $c(1) $+ Last Time Seen Serving: $c(2) $+ %FSTrepLSS
n31=      aline -p @FS_SingleReport $c(1) $+ Access Count Last Seen: $c(2) $+ %FSTrepACC
n32=      aline -p @FS_SingleReport $chr(9)
n33=      aline -p @FS_SingleReport $c(1) $+ Servers Activity Log:
n34=      if $exists($shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ] ) {
n35=        set %FSTtmpLINES $lines($shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ] )
n36=        set %FSTlct 1
n37=        while (%FSTlct <= %FSTtmpLINES) {
n38=          aline -p @FS_SingleReport $c(2) $+ $read -l [ $+ [ %FSTlct ] ] $shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ]
n39=          inc %FSTlct 1
n40=          continue
n41=        }
n42=      }
n43=      else { aline -p @FS_SingleReport 4No Activity Log Found. }
n44=    }
n45=    else { echo -a 12Cryoa's File Server Report: 4No Record found. }
n46=  }
n47=  else { ECHO -a FILE SERVER TRACKER: need a nick to look up. /FSTreport <nick> (nick has to be currently on iRC) }
n48=}
n49=alias FSTgroupwin {
n50=  if ($window(@FS_Report) == $null) { window -kal10 @FS_Report -1 -1 550 300 @FS_Report } | else { window -r @FS_Report | clear @FS_Report }
n51=  titlebar @FS_Report 
n52=  window -a @FS_Report 
n53=  clear -l @FS_Report 
n54=  clear @FS_Report 
n55=  set %FSTlistCT 1 
n56=  set %FSTrecCT $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n57=  while (%FSTlistCT <= %FSTrecCT) {
n58=    set %FSTtmpitem $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTlistCT)
n59=    aline -l @FS_Report $c(1) $+ $gettok($r.fstRec(Servers,%FSTtmpitem),1,32)
n60=    inc %FSTlistCT 1
n61=    continue
n62=  }
n63=}
n64=alias FSTgraphs {
n65=  if ($window(@FS_Graphs) == $null) { window -ka @FS_Graphs -1 -1 640 400 @FS_Graphs } | else { window -r @FS_Graphs | clear @FS_Graphs }
n66=  set %FSTlistCT 1 
n67=  set %FSTrecCT $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n68=  aline @FS_Graphs $c(1) $+ File Server Graphical Comparison Report
n69=  aline @FS_Graphs $chr(9)
n70=  while (%FSTlistCT <= %FSTrecCT) {
n71=    set %FSTtmpRec $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTlistCT)
n72=    set %FSTtmpDD $gettok($gettok($r.fstRec(Servers,%FSTtmpRec),3,32),1,58)
n73=    set %FSTtmpHH $gettok($gettok($r.fstRec(Servers,%FSTtmpRec),3,32),2,58)
n74=    set %FSTtmpMM $gettok($gettok($r.fstRec(Servers,%FSTtmpRec),3,32),3,58)
n75=    aline @FS_Graphs $c(1) $+ $gettok($r.fstRec(Servers,%FSTtmpRec),1,32) $c(2) $chr(9) $c(1) $+ %FSTtmpDD $C(2) $+ days, $c(1) $+ %FSTtmpHH $c(2) $+ hours, and $c(1) $+ %FSTtmpMM $c(2) $+ minutes.
n76=    aline -p @FS_Graphs $FSTbuildbar($gettok($r.fstRec(Servers,%FSTtmpRec),3,32))
n77=    aline @FS_Graphs $chr(9)
n78=    inc %FSTlistCT 1
n79=    continue
n80=  }
n81=}
n82=alias FSTbuildbar {
n83=  if $numtok($1,58) == 3 {
n84=    set %FSTbbDAY $gettok($1,1,58)
n85=    set %FSTbbHOUR $gettok($1,2,58)
n86=    set %FSTbbDct 1
n87=    if %FSTbbHOUR != 1 { set %FSTbbHOUR $int($calc(%FSTbbHOUR / 2)) }
n88=    set %FSTtmpBAR 04,04
n89=    while (%FSTbbDct <= %FSTbbDAY) {
n90=      set %FSTtmpBAR %FSTtmpBAR $+ o
n91=      inc %FSTbbDct 1
n92=      continue
n93=    }
n94=    set %FSTtmpBAR %FSTtmpBAR $+ 12,12
n95=    set %FSTbbHct 1
n96=    while (%FSTbbHct <= %FSTbbHOUR) {
n97=      set %FSTtmpBAR %FSTtmpBAR $+ .
n98=      inc %FSTbbHct 1
n99=      continue
n100=    }
n101=    set %FSTtmpBAR %FSTtmpBAR $+ 
n102=    return %FSTtmpBAR
n103=  }
n104=  else { return n/a } 
n105=}
n106=alias FSTsolowin {
n107=  if $window(@FS_SingleReport) == $null { /window -dok0 @FS_SingleReport -1 -1 600 400 } | else { /window -a @FS_SingleReport }
n108=}
n109=alias GetMonth {
n110=  if $1 != $null {
n111=    if $1 isnum 1-12 {
n112=      return $gettok(January February March April May June July August September October November December,$1,32)
n113=    }
n114=  }
n115=}
n116=alias FSTopen { if ($dialog($1) == $null) { dialog -m FStrk FStrk } | else { dialog -v FStrk FStrk } } 
n117=alias r.fstrk { if ($2 != $null) { return $readini -n $shortfn($mircdir) $+ FStrk\FSTset.ini $1 $2 } }
n118=alias w.fstrk { if ($3 != $null) { writeini -n $shortfn($mircdir) $+ FStrk\FSTset.ini $1 $2 $strip($3-,burc) } }
n119=alias r.fstRec { if ($2 != $null) { return $readini -n $shortfn($mircdir) $+ FStrk\FSTrec.ini $1 $2 } }
n120=alias w.fstRec { if ($3 != $null) { writeini -n $shortfn($mircdir) $+ FStrk\FSTrec.ini $1 $2 $strip($3-,burc) } }
n121=alias d.fstRec { if ($2 != $null) { remini $shortfn($mircdir) $+ FStrk\FSTrec.ini $1 $2 } }
n122=alias fstcalctime {
n123=  if $2 != $null {
n124=    set %fstNd $gettok($1,1,58)
n125=    set %fstNh $gettok($1,2,58)
n126=    set %fstNm $gettok($1,3,58)
n127=    set %fstOd $gettok($2,1,58)
n128=    set %fstOh $gettok($2,2,58)
n129=    set %fstOm $gettok($2,3,58)
n130=    if %fstNd > %fstOd { set %fstNh $calc(%fstNh + 24) }
n131=    set %fstNm $calc(%fstNm + ((%fstNh - %fstOh) * 60)) 
n132=    return $calc(%fstNm - %fstOm)   
n133=  }
n134=}
n135=alias fstaddtime {
n136=  if $2 != $null {
n137=    set %fstNd $gettok($1,1,58)
n138=    set %fstNh $gettok($1,2,58)
n139=    set %fstNm $gettok($1,3,58)
n140=    set %fstOd $gettok($2,1,58)
n141=    set %fstOh $gettok($2,2,58)
n142=    set %fstOm $gettok($2,3,58)
n143=    set %FSTtmpmin $calc(%fstNm + %FstOm)
n144=    set %FSTtmphour $calc(%fstNh + %FstOh)
n145=    set %FSTtmpday $calc(%fstNd + %fstOd)
n146=    :loop1
n147=    if %FSTtmpmin > 59 { inc %FSTtmphour 1 | dec %FSTtmpmin 60 | goto loop1 }
n148=    :loop2
n149=    if %FSTtmphour > 23 { inc %FSTtmpday 1 | dec %FSTtmphour 24 | goto loop2 }
n150=    return %FSTtmpday $+ : $+ %FSTtmphour $+ : $+ %FSTtmpmin
n151=  }
n152=}
n153=; use format $1-nick $2-host type5 $3-totalservetime $4-Accesses $5-lastTime $6-starttime $7-Last Seen Serving TS
n154=on *:notice:*serv*trig*send*:?:{ 
n155=  if $r.fstrk(Settings,Status) == On && (Access isin $1-) {  
n156=    if $nick != $me {
n157=      unset %FSTrecordname %FSTstrictaddress %FSTlogfilename
n158=      set %FSTtmpTOT2 $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n159=      set %FSTtmpCT2 1
n160=      while (%FSTtmpCT2 <= %FSTtmpTOT2) { 
n161=        if $strip($1,burc) == $gettok($r.fstRec(Servers,$ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2)),1,32) { set %FSTrecordname $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2) | set %FSTlogfilename $replace($ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2),~,=,*,^) | break }
n162=        inc %FSTtmpCT2 1
n163=        continue
n164=      }
n165=      if %FSTrecordname == $null { set %FSTrecordname $address($nick,3) }
n166=
n167=      set %FSTstrictaddress $replace($address($nick,5),~,=)
n168=      if %FSTlogfilename == $null { set %FSTlogfilename $replace($address($nick,3),~,=,*,^) }
n169=      if %FSTlogfilename == $null { set %FSTlogfilename $nick }
n170=      if %FSTstrictaddress == $null { set %FSTstrictaddress $nick }
n171=      if %FSTrecordname == $null { set %FSTrecordname $nick }
n172=
n173=      set %tmpTRK1 $calc($pos($strip($1-,burc),Accessed:,1) + 10)
n174=      set %tmpTRKct 1
n175=      while (%tmpTRKct <= 9) {
n176=        if $mid($strip($1-,burc),$calc(%tmpTRK1 + %tmpTRKct),1) !isnum 0-9 { break }
n177=        inc %tmpTRKct 1
n178=        continue
n179=      }
n180=      set %tmpTRKacc $mid($strip($1-,burc),%tmpTRK1,%tmpTRKct) 
n181=      if (Accessed !isin $strip($1-,burc)) { set %tmpTRKacc TDCC }
n182=      set %FSTtmpTspan $fstcalctime($time(d:HH:nn),$gettok($r.fstRec(Servers,%FSTrecordname),5,32))
n183=      if $gettok($r.fstRec(Servers,%FSTrecordname),3,32) == $null {
n184=        w.fstRec Servers %FSTrecordname $nick %FSTstrictaddress 0:0:0 %tmpTRKacc $time(d:HH:nn) $time(d:HH:nn) $time(dddd mmmm d  h:nntt)
n185=      }        
n186=      elseif %FSTtmpTspan <= $r.fstrk(Settings,MaxSpan) {
n187=        set %FSTtmpStart $gettok($r.fstRec(Servers,%FSTrecordname),6,32)
n188=        set %FSTtmpTST $fstaddtime($gettok($r.fstRec(Servers,%FSTrecordname),3,32),0:0: [ $+ [ %FSTtmpTspan ] ] )
n189=        w.fstRec Servers %FSTrecordname $nick %FSTstrictaddress %FSTtmpTST %tmpTRKacc $time(d:HH:nn) %FSTtmpStart $time(dddd mmmm d  h:nntt)
n190=      }
n191=      else {
n192=        set %FSTtmpStart $gettok($r.fstRec(Servers,%FSTrecordname),6,32)  
n193=        set %FSTtmpLT $gettok($r.fstRec(Servers,%FSTrecordname),5,32)
n194=        set %FSTtmpTST $gettok($r.fstRec(Servers,%FSTrecordname),3,32)
n195=        set %FSTtmpDAY1 $gettok(%FSTtmpStart,1,58)
n196=        set %FSTtmpDAY2 $gettok(%FSTtmpLT,1,58)
n197=        set %FSTtmpMONTH $time(m)
n198=        if %FSTtmpDAY2 < %FSTtmpDAY1 { dec %FSTtmpMONTH 1 }
n199=        if $gettok(%FSTtmpStart,2,58) > 12 { set %FSTtmpAMPM pm | set %FSTtmpThour $calc($gettok(%FSTtmpStart,2,58) - 12) } | else { set %FSTtmpAMPM am | set %FSTtmpThour $gettok(%FSTtmpStart,2,58) }
n200=        write -a $shortfn($mircdir) $+ FStrk\Records\ $+ %FSTlogfilename $+ .log Started Serving on $GetMonth(%FSTtmpMONTH) $gettok(%FSTtmpStart,1,58) at %FSTtmpThour $+ : $+ $gettok(%FSTtmpStart,3,58) $+ %FSTtmpAMPM and stopped at $gettok($r.fstRec(Servers,%FSTrecordname),7-,32) with an Access Count of %tmpTRKacc 
n201=        w.fstRec Servers %FSTrecordname $nick %FSTstrictaddress %FSTtmpTST %tmpTRKacc $time(d:HH:nn) $time(d:HH:nn) $time(dddd mmmm d  h:nntt)
n202=      }
n203=    }
n204=  }
n205=}
n206=on *:text:*serv*trig*send*:#:{ 
n207=  if $r.fstrk(Settings,Status) == On && (Access isin $1-) {  
n208=    if $nick != $me { 
n209=      if (($r.fstrk(Settings,Channels) == All) || ($r.fstrk(Settings,Channels) == $null) || ($istok($r.fstrk(Settings,Channels),$chan,32) == $true)) { 
n210=        unset %FSTrecordname %FSTstrictaddress %FSTlogfilename
n211=        set %FSTtmpTOT2 $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n212=        set %FSTtmpCT2 1
n213=        while (%FSTtmpCT2 <= %FSTtmpTOT2) { 
n214=          if $strip($1,burc) == $gettok($r.fstRec(Servers,$ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2)),1,32) { set %FSTrecordname $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2) | set %FSTlogfilename $replace($ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2),~,=,*,^) | break }
n215=          inc %FSTtmpCT2 1
n216=          continue
n217=        }
n218=        if %FSTrecordname == $null { set %FSTrecordname $address($nick,3) }
n219=        set %FSTstrictaddress $address($nick,5)
n220=        if %FSTstrictaddress == $null { set %FSTstrictaddress $nick }
n221=        if %FSTrecordname == $null { set %FSTrecordname $nick }
n222=        if %FSTlogfilename == $null { set %FSTlogfilename $replace($address($nick,3),~,=,*,^) }
n223=        if %FSTlogfilename == $null { set %FSTlogfilename $nick }
n224=        set %tmpTRK1 $calc($pos($strip($1-,burc),Accessed:,1) + 10)
n225=        set %tmpTRKct 1
n226=        while (%tmpTRKct <= 9) {
n227=          if $mid($strip($1-,burc),$calc(%tmpTRK1 + %tmpTRKct),1) !isnum 0-9 { break }
n228=          inc %tmpTRKct 1
n229=          continue
n230=        }
n231=        set %tmpTRKacc $mid($strip($1-,burc),%tmpTRK1,%tmpTRKct)
n232=        if (Accessed !isin $strip($1-,burc)) { set %tmpTRKacc TDCC }
n233=        ; set %tmpTRKtt $gettok($r.fstRec(Servers,%FSTrecordname),3,32)
n234=        set %FSTtmpTspan $fstcalctime($time(d:HH:nn),$gettok($r.fstRec(Servers,%FSTrecordname),5,32))
n235=        if $gettok($r.fstRec(Servers,%FSTrecordname),3,32) == $null {
n236=          w.fstRec Servers %FSTrecordname $nick %FSTstrictaddress 0:0:0 %tmpTRKacc $time(d:HH:nn) $time(d:HH:nn) $time(dddd mmmm d  h:nntt)
n237=        }        
n238=        elseif %FSTtmpTspan <= $r.fstrk(Settings,MaxSpan) {
n239=          set %FSTtmpStart $gettok($r.fstRec(Servers,%FSTrecordname),6,32)
n240=          set %FSTtmpTST $fstaddtime($gettok($r.fstRec(Servers,%FSTrecordname),3,32),0:0: [ $+ [ %FSTtmpTspan ] ] )
n241=          w.fstRec Servers %FSTrecordname $nick %FSTstrictaddress %FSTtmpTST %tmpTRKacc $time(d:HH:nn) %FSTtmpStart $time(dddd mmmm d  h:nntt)
n242=        }
n243=        else {
n244=          set %FSTtmpStart $gettok($r.fstRec(Servers,%FSTrecordname),6,32)  
n245=          set %FSTtmpLT $gettok($r.fstRec(Servers,%FSTrecordname),5,32)
n246=          set %FSTtmpTST $gettok($r.fstRec(Servers,%FSTrecordname),3,32)
n247=          set %FSTtmpDAY1 $gettok(%FSTtmpStart,1,58)
n248=          set %FSTtmpDAY2 $gettok(%FSTtmpLT,1,58)
n249=          set %FSTtmpMONTH $time(m)
n250=          if %FSTtmpDAY2 < %FSTtmpDAY1 { dec %FSTtmpMONTH 1 }
n251=          if $gettok(%FSTtmpStart,2,58) > 12 { set %FSTtmpAMPM pm | set %FSTtmpThour $calc($gettok(%FSTtmpStart,2,58) - 12) } | else { set %FSTtmpAMPM am | set %FSTtmpThour $gettok(%FSTtmpStart,2,58) }
n252=          write -a $shortfn($mircdir) $+ FStrk\Records\ $+ %FSTlogfilename $+ .log Started Serving on $GetMonth(%FSTtmpMONTH) $gettok(%FSTtmpStart,1,58) at %FSTtmpThour $+ : $+ $gettok(%FSTtmpStart,3,58) $+ %FSTtmpAMPM and stopped at $gettok($r.fstRec(Servers,%FSTrecordname),7-,32) with an Access Count of %tmpTRKacc
n253=          w.fstRec Servers %FSTrecordname $nick %FSTstrictaddress %FSTtmpTST %tmpTRKacc $time(d:HH:nn) $time(d:HH:nn) $time(dddd mmmm d  h:nntt)
n254=        }
n255=      }
n256=    }
n257=  }
n258=}
n259=
n260=Dialog FStrk {
n261=  title "Cryoa's File Server Tracker v.1.0a"
n262=  size -1 -1 200 140
n263=  option dbu
n264=
n265=  button "Ok", 500, 68 125 30 12, Ok
n266=  button "Cancel", 510, 102 125 30 12, cancel
n267=  button "Reports", 203, 165 45 30 12
n268=  button "Graphs", 204, 165 60 30 12
n269=  check "Use !list Polling with interval of", 100, 4 10 80 10
n270=  edit "", 103, 85 10 15 10, center
n271=  text "minutes", 104, 100 12 20 10
n272=  check "Start", 200, 165 10 30 12, push
n273=  check "Stop", 201, 165 25 30 12, push
n274=  text "Channels:", 101, 4 22 25 10
n275=  edit "", 102, 30 20 120 10
n276=  text "Max Time Span Between Ads", 110, 4 32 72 10
n277=  edit "", 111, 76 30 15 10, center
n278=  text "min.", 112, 91 32 15 10
n279=  text "Use the !list polling for more accurate tracking when possible. Keep in mind though this will have all the File servers notice you at once so dont over do it. I recommend not faster then 15 min. When setting the Max Time Span keep in mind that some people run there timers at 1 hour or more. I recommend 70min to start and see how it works for you. This is more critical if not using the !list polling. Also note, although you can track more then one channel, the !list polling only occurs in the first channel in the list. Seperate multiple channels with a space and preceed channel names with the pound/number character. This has been tested to track only Invision and Polaris Fserves. This should track a little over 400 Servers.", 210, 4 42 155 80 
n280=}
n281=on *:dialog:FStrk:*:*:{
n282=  if ($devent == init) {
n283=    if $r.fstrk(Settings,Status) == On { did -b $dname 200 } | else { did -b $dname 201 }
n284=    if $r.fstrk(Settings,Polling) == On { did -c $dname 100 }
n285=    did -ra $dname 103 $r.fstrk(Settings,PollTime)
n286=    did -ra $dname 102 $r.fstrk(Settings,Channels)
n287=    did -ra $dname 111 $r.fstrk(Settings,MaxSpan)
n288=  }
n289=  if ($devent == sclick) {
n290=    if ($did == 200) { did -b $dname 200 | did -eu $dname 201 | w.fstrk Settings Status On | if $r.fstrk(Settings,Polling) == On { .timerLISTPOLL 0 $calc($r.fstrk(Settings,PollTime) * 60) .msg $gettok($r.fstrk(Settings,Channels),1,32) !list } }
n291=    if ($did == 201) { did -b $dname 201 | did -eu $dname 200 | w.fstrk Settings Status Off | .timerLISTPOLL off }
n292=    if ($did == 203) { FSTgroupwin | dialog -x FStrk }
n293=    if ($did == 204) { FSTgraphs | dialog -x FStrk }
n294=    if ($did == 500) {
n295=      w.fstrk Settings PollTime $did($dname,103).text
n296=      w.fstrk Settings Channels $did($dname,102).text 
n297=      w.fstrk Settings MaxSpan $did($dname,111).text
n298=      if ($did($dname,100).state == 1) { w.fstrk Settings Polling On | .timerLISTPOLL 0 $calc($r.fstrk(Settings,PollTime) * 60) .msg $gettok($r.fstrk(Settings,Channels),1,32) !list } | else { w.fstrk Settings Polling Off | .timerLISTPOLL off }
n299=    }
n300=  }
n301=}
n302=menu Channel,Menubar {
n303=  File Server Tracker: FSTopen
n304=}
n305=menu NickList {
n306=  File Server Report for $$1:{ FSTReport $$1 } 
n307=}
n308=menu @FS_Report {
n309=  lbclick:{
n310=    if ($sline(@FS_Report,1) != $null) {
n311=      clear @FS_Report
n312=      FSTViewRec $line(@FS_Report,$sline(@FS_Report,1).ln,1) 
n313=    }
n314=  }
n315=  Clear Activity Log for $strip($$1,burc):{
n316=    unset %FSTnicklog %FSTnickrec
n317=    set %FSTtmpTOT2 $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n318=    set %FSTtmpCT2 1
n319=    while (%FSTtmpCT2 <= %FSTtmpTOT2) { 
n320=      if $strip($1,burc) == $gettok($r.fstRec(Servers,$ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2)),1,32) { set %FSTnickrec $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2) | set %FSTnicklog $replace($ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2),~,=,*,^) | break }
n321=      inc %FSTtmpCT2 1
n322=      continue
n323=    }
n324=    if %FSTnicklog != $null {
n325=      remove $shortfn($mircdir) $+ FStrk\Records\ $+ %FSTnicklog $+ .log 
n326=      clear @FS_Report
n327=      aline -p 4Activity Log Cleared for $1
n328=    }
n329=    else {
n330=      clear @FS_Report
n331=      aline -p 4Could not clear Activity Log for $1
n332=    }
n333=  }
n334=  Clear All Records for $strip($$1,burc):{
n335=    if $$?!="Are you Sure you want to clear all the records for [ $strip($$1,burc) ] " == $true {
n336=      unset %FSTnicklog %FSTnickrec
n337=      set %FSTtmpTOT2 $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n338=      set %FSTtmpCT2 1
n339=      while (%FSTtmpCT2 <= %FSTtmpTOT2) { 
n340=        if $strip($1,burc) == $gettok($r.fstRec(Servers,$ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2)),1,32) { set %FSTnickrec $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2) | set %FSTnicklog $replace($ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2),~,=,*,^) | break }
n341=        inc %FSTtmpCT2 1
n342=        continue
n343=      }
n344=      clear @FS_Report
n345=      if $exists($shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ] ) {
n346=        remove $shortfn($mircdir) $+ FStrk\Records\ $+ %FSTnicklog $+ .log 
n347=        aline -p 4Activity Log Cleared for $1
n348=      }
n349=      else {
n350=        aline -p 4Could not clear Activity Log for $1 (Possibly there wasn't one yet for them)
n351=      }
n352=      if %FSTnickrec != $null {
n353=        $d.fstrec(Servers,%FSTnickrec)
n354=        aline -p 4Record has been completely cleared
n355=        .timer -o 1 1 FSTgroupwin
n356=      }
n357=      else { aline -p 4Record could not be found and therefore no record was deleted }
n358=    }
n359=  }
n360=  Refresh:{ FSTgroupwin }
n361=}
n362=alias FSTViewRec {
n363=  if $1 != $null { 
n364=    set %FSTtmpTOT2 $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,0)
n365=    set %FSTtmpCT2 1
n366=    while (%FSTtmpCT2 <= %FSTtmpTOT2) { 
n367=      if $strip($1,burc) == $gettok($r.fstRec(Servers,$ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2)),1,32) { set %FSTnickrec $ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2) | set %FSTnicklog $replace($ini($shortfn($mircdir) $+ FStrk\FSTrec.ini,Servers,%FSTtmpCT2),~,=,*,^) | break }
n368=      inc %FSTtmpCT2 1
n369=      continue
n370=    }
n371=    if %FSTnickrec == $null { set %FSTnickrec $strip($1,burc) }
n372=    if %FSTnicklog == $null { set %FSTnicklog $strip($1,burc) }
n373=    if $gettok($r.fstRec(Servers,%FSTnickrec),3,32) != $null { 
n374=      set %FSTrepNick $gettok($r.fstRec(Servers,%FSTnickrec),1,32)
n375=      set %FSTrepHost $gettok($r.fstRec(Servers,%FSTnickrec),2,32)
n376=      set %FSTrepStart $gettok($r.fstRec(Servers,%FSTnickrec),6,32)
n377=      set %FSTrepSday $gettok(%FSTrepStart,1,58)
n378=      set %FSTrepShour $gettok(%FSTrepStart,2,58)
n379=      set %FSTrepSmin $gettok(%FSTrepStart,3,58)
n380=      set %FSTrepAMPM am
n381=      if %FSTrepShour > 12 { set %FSTrepAMPM pm | dec %FSTrepShour 12 } 
n382=      set %FSTrepSmonth $time(m)
n383=      if %FSTrepSday < $time(d) { if %FSTrepSmonth == 1 { set %FSTrepSmonth 12 } | else { dec %FSTrepSmonth 1 } }
n384=      set %FSTrepTST $gettok($r.fstRec(Servers,%FSTnickrec),3,32)
n385=      set %FSTrepDaysServed $gettok(%FSTrepTST,1,58)
n386=      set %FSTrepHoursServed $gettok(%FSTrepTST,2,58)
n387=      set %FSTrepMinutesServed $gettok(%FSTrepTST,3,58)
n388=      set %FSTrepACC $gettok($r.fstRec(Servers,%FSTnickrec),4,32)
n389=      set %FSTrepLSS $gettok($r.fstRec(Servers,%FSTnickrec),7-,32)
n390=      aline -p @FS_Report $c(1) $+ File Server Report for: $c(2) $+ %FSTrepNick
n391=      aline -p @FS_Report $c(1) $+ Last Host Address: $c(2) $+ %FSTrepHost
n392=      aline -p @FS_Report $c(1) $+ Total Time Served: $c(2) $+ %FSTrepDaysServed $c(1) $+ days, $c(2) $+ %FSTrepHoursServed $c(1) $+ hours, $c(2) $+ %FSTrepMinutesServed $c(1) $+ minutes.
n393=      aline -p @FS_Report $c(1) $+ Last (or Current) Start Time: $c(2) $+ $getmonth(%FSTrepSmonth) %FSTrepSday $+ , at %FSTrepShour $+ : $+ %FSTrepSmin $+ %FSTrepAMPM
n394=      aline -p @FS_Report $c(1) $+ Last Time Seen Serving: $c(2) $+ %FSTrepLSS
n395=      aline -p @FS_Report $c(1) $+ Access Count Last Seen: $c(2) $+ %FSTrepACC
n396=      aline -p @FS_Report $chr(9)
n397=      aline -p @FS_Report $c(1) $+ Servers Activity Log:
n398=      if $exists($shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ] ) {
n399=        set %FSTtmpLINES $lines($shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ] )
n400=        set %FSTlct 1
n401=        while (%FSTlct <= %FSTtmpLINES) {
n402=          aline -p @FS_Report $c(2) $+ $read -l [ $+ [ %FSTlct ] ] $shortfn($mircdir) $+ FStrk\Records\ [ $+ [ %FSTnicklog ] ] [ $+ [ .log ] ]
n403=          inc %FSTlct 1
n404=          continue
n405=        }
n406=      }
n407=      else { aline -p @FS_Report 4No Activity Log Found. }
n408=    }
n409=  }
n410=  else { ECHO -a FILE SERVER TRACKER: need a nick to look up. /FSTreport <nick> (nick has to be currently on iRC) }
n411=}
