home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 4 / Windows 6-Pak (InfoMagic) (Disc 4) (1999).ISO / Text-Chat-Scripts / pp-320m.exe / pp300 / r-whois.mrc < prev    next >
Encoding:
Text File  |  1998-10-10  |  27.9 KB  |  564 lines

  1. ; -----------------------------------------------------
  2. ; Peace and Protection (by misspai)
  3. ; -----------------------------------------------------
  4. ; Whois/Who display and a few
  5. ; misc. other raw events based on
  6. ; Whois/Who replies.
  7. ; -----------------------------------------------------
  8. alias -l code {
  9.   if ($right($1,3) != .US) return $read -ns [ $+ [ $gettok($1,$gettok($1,0,46),46) ] ] pp300\country.txt
  10.   set %.cc.two $calc($gettok($1,0,46) - 1) $+ - $+ $gettok($1,0,46)
  11.   set %.cc.two $read -ns [ $+ [ $gettok($1,%.cc.two,46) ] ] pp300\country.txt
  12.   if (%.cc.two != $null) return %.cc.two
  13.   return United States
  14. }
  15. alias country {
  16.   set %.cc.found $code($1)
  17.   if (%.cc.found == $null) dispa Location of %col.target $+ $1 $+  is unknown.
  18.   else dispa Location of %col.target $+ $1 $+  - %.cc.found
  19. }
  20. alias usa country $1 $+ .us
  21. ; -----------------------------------------------------
  22. ; Hiding of Who from IAL update,
  23. ; and clone scan on join
  24. ; -----------------------------------------------------
  25. #_rawhalts off
  26. raw *:*:.disable #_rawhalts | return
  27. #_rawhalts end
  28. #-ialupdate2 off
  29. raw 315:*:{
  30.   set %-ial.update $remtok(%-ial.update,$2,32)
  31.   if (%-ial.update == $null) .disable #-ialupdate #-ialupdate2
  32.   halt
  33. }
  34. #-ialupdate2 end
  35. #-ialupdate off
  36. raw 352:*:halt
  37. raw 315:*:{
  38.   set %-ial.update $remtok(%-ial.update,$2,32)
  39.   if (%-ial.update == $null) .disable #-ialupdate #-ialupdate2
  40.   if ($2 ischan) {
  41.     if (%+clonescan.youjoin) {
  42.       set %.+sc.quiet %+clonescan.hide
  43.       clones $2
  44.       unset %.+sc.quiet
  45.     }
  46.     set %.xw $_usebot($2,login) | if (%.xw != $null) _botcmd %.xw $2 $me
  47.     if (join isin %autobot. [ $+ [ $2 ] ] ) { set %.xw $_usebot($2,opme) | if (%.xw != $null) _botcmd %.xw $2 $me }
  48.     if (((X ison $2) || (W ison $2)) && (%pp.net == undernet)) if (%-recentpart. [ $+ [ $2 ] ] < 1) auto xpq $2
  49.   }
  50.   halt
  51. }
  52. #-ialupdate end
  53. ; -----------------------------------------------------
  54. ; Channel scan
  55. ; -----------------------------------------------------
  56. #-chanscan off
  57. raw 352:*:{
  58.   if ((%pp.net == undernet) && ($6 isin xw) && ($3 == cservice) && ($4 == undernet.org)) halt
  59.   if (G isin $7) { inc %-cscan.gone | set %-cscan.away %-cscan.away $6 }
  60.   else inc %-cscan.here
  61.   if (* isin $7) { set %-cscan.ircops %-cscan.ircops $6 }
  62.   inc %-cscan.hops $8
  63.   if (%-cscan. [ $+ [ $5 ] ] == $null) {
  64.     set %-cscan. [ $+ [ $5 ] ] $8 $6
  65.     set %-cscan.servs $addtok(%-cscan.servs,$5,32)
  66.   }
  67.   else set %-cscan. [ $+ [ $5 ] ] %-cscan. [ $+ [ $5 ] ] $6
  68.   halt
  69. }
  70. raw 315:*:{
  71.   set %-cscando $remtok(%-cscando,$2,32)
  72.   if (%-cscando == $null) .disable #-chanscan
  73.   if (%-cscan.gone == $null) set %-cscan.gone 0
  74.   %-cscan.total = %-cscan.gone + %-cscan.here
  75.   set %-cscan.type %-cscantype. [ $+ [ $2 ] ]
  76.   set %-cscan.type. [ $+ [ $2 ] ]
  77.   set %-cscan.head $2 [[ $+ %col.info1 $+ $lower($2) $+ ]
  78.   if ($remove(%-cscan.type,r) != d) {
  79.     if (r isin %-cscan.type) {
  80.       set %-cscan.head @Scan [[ $+ %col.info1 $+ $lower($2) $+ ]
  81.       window -c @Scan
  82.       window -a $+ $_spec1d @Scan $_winpos(14%,7%,8%,8%) @Close %font.basic
  83.       titlebar @Scan for $2
  84.     }
  85.     disprs-div %-cscan.head
  86.     disprs %-cscan.head Scan results for %col.target $+ %-cscan.total $+  users-
  87.   }
  88.   if (a isin %-cscan.type) disprs %-cscan.head away- %col.dark $+  $+ %-cscan.gone $+  $_plural(user,%-cscan.gone) away %col.dark $+ ( $+ $_p(%-cscan.gone,%-cscan.total) $+ ) - %col.dark $+  $+ %-cscan.here $+  $_plural(user,%-cscan.here) not away %col.dark $+ ( $+ $_p(%-cscan.here,%-cscan.total) $+ )
  89.   if (w isin %-cscan.type) {
  90.     if (%-cscan.gone == 0) {
  91.       if (a !isin %-cscan.type) disprs %-cscan.head away- no users are away
  92.     }
  93.     else disprs %-cscan.head away- %col.dark $+ $_s2cs(%-cscan.away)
  94.   }
  95.   if (i isin %-cscan.type) {
  96.     if (%-cscan.ircops == $null) disprs %-cscan.head ircops- no ircops found
  97.     else {
  98.       set %-cscan.num $_numtok(32,%-cscan.ircops)
  99.       disprs %-cscan.head ircops- %col.dark $+  $+ %-cscan.num $+  $_plural(ircop,%-cscan.num) %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ )
  100.       disprs %-cscan.head ircops- %col.dark $+ $_s2cs(%-cscan.ircops)
  101.     }
  102.   }
  103.   if (h isin %-cscan.type) disprs %-cscan.head hops- average server hops %col.dark $+  $+ $_round($calc(%-cscan.hops / %-cscan.total),2)
  104.   if ((s isin %-cscan.type) || (l isin %-cscan.type)) {
  105.     set %-cscan.best $server
  106.     set %-cscan.num %-cscan. [ $+ [ $server ] ]
  107.     set %-cscan.num $calc($_numtok(32,%-cscan.num) - 2)
  108.     set %-cscan.todo $_numtok(32,%-cscan.servs)
  109.     :loop1
  110.     set %-cscan.serv $gettok(%-cscan.servs,%-cscan.todo,32)
  111.     set %-cscan.chk %-cscan. [ $+ [ %-cscan.serv ] ]
  112.     set %-cscan.chk $_j($_numtok(32,$remtok(%-cscan.chk,$me,32)))
  113.     if (%-cscan.chk > %-cscan.num) { set %-cscan.num %-cscan.chk | set %-cscan.best %-cscan.serv }
  114.     if ($_vd(-cscan.todo) > 0) goto loop1
  115.     if (s isin %-cscan.type) {
  116.       if (%-cscan.best == $server) { inc %-cscan.num | disprs %-cscan.head server- favorite server is your server, %col.info2 $+ %-cscan.best $+ , with %col.dark $+  $+ %-cscan.num $+  $_plural(user,%-cscan.num) $+ , including you %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ ) }
  117.       else {
  118.         disprs %-cscan.head server- favorite server is %col.info2 $+ %-cscan.best $+ , with %col.dark $+  $+ %-cscan.num $+  $_plural(user,%-cscan.num) %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ )
  119.         if (%+disp.options) disprs %-cscan.head server- %col.option $+ ShiftF9 to change to this server | set %_sf9.server %-cscan.best
  120.       }
  121.     }
  122.     if (l isin %-cscan.type) {
  123.       set %-cscan.who %-cscan. [ $+ [ %-cscan.best ] ]
  124.       if (s isin %-cscan.type) disprs %-cscan.head server- users on favorite server- %col.dark $+ $_s2cs($gettok(%-cscan.who,2-,32))
  125.       else disprs %-cscan.head server- users on favorite server, %col.info2 $+ %-cscan.best $+ - %col.dark $+ $_s2cs($gettok(%-cscan.who,2-,32))
  126.     }
  127.   }
  128.   else unset %-cscan.best
  129.   if (m isin %-cscan.type) {
  130.     set %-cscan.who %-cscan. [ $+ [ $server ] ]
  131.     set %-cscan.num $calc($_numtok(32,%-cscan.who) - 2)
  132.     if ((%-cscan.best != $server) || (s !isin %-cscan.type)) disprs %-cscan.head server- %col.dark $+  $+ %-cscan.num $+  other $_plural(user,%-cscan.num) on your server %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ , or $_p($_i(%-cscan.num),%-cscan.total) including yourself)
  133.     if (((%-cscan.best != $server) || (l !isin %-cscan.type)) && (%-cscan.num > 0)) disprs %-cscan.head server- other users on your server- %col.dark $+ $_s2cs($remtok($gettok(%-cscan.who,2-,32),$me,32))
  134.   }
  135.   if ($remove(%-cscan.type,r) != d) disprs-div %-cscan.head
  136.   if (d isin %-cscan.type) {
  137.     window -c @Server
  138.     window -l $+ $_spec1d @Server $_winpos(14%,7%,8%,8%) @Server %font.basic
  139.     set %-cscan.todo $_numtok(32,%-cscan.servs)
  140.     titlebar @Server usage for $2 ( $+ %-cscan.total users, %-cscan.todo servers)
  141.     :loop2
  142.     set %-cscan.serv $gettok(%-cscan.servs,%-cscan.todo,32)
  143.     set %-cscan.info %-cscan. [ $+ [ %-cscan.serv ] ]
  144.     set %-cscan.hop $gettok(%-cscan.info,1,32)
  145.     set %-cscan.info $gettok(%-cscan.info,2-,32)
  146.     set %-cscan.cnt $_numtok(32,%-cscan.info)
  147.     set %.line 1
  148.     :loop3
  149.     if (%.line <= $line(@Server,0)) {
  150.       if ($strip($remove($gettok($line(@Server,%.line),4,32),$chr(40))) < %-cscan.hop) { inc %.line | goto loop3 }
  151.     }
  152.     iline @Server %.line $chr(160) ò %col.info2 $+ %-cscan.serv $+  ( $+ %col.att $+ %-cscan.hop $+  $_plural(hop,%-cscan.hop) $+ ) - %col.misc $+ (ping unknown) - %col.dark $+ %-cscan.cnt $+  $_plural(user,%-cscan.cnt) %col.dark $+ ( $+ $_p(%-cscan.cnt,%-cscan.total) $+ ) - $_s2cs(%-cscan.info)
  153.     if ($_vd(-cscan.todo) > 0) goto loop2
  154.     iline @Server 1 Currently sorted by server hops (closest servers first)
  155.     iline @Server 2 Double click to connect to a server, right-click for options
  156.     iline @Server 3 $chr(160)
  157.     window -b @Server
  158.     unset %_serv.pop1 %_serv.pop4 %_serv.pop4o
  159.     set %_serv.pop2 Sort by number of users
  160.     set %_serv.pop3 Sort by server name
  161.   }
  162.   unset %-cscan.*
  163. }
  164. #-chanscan end
  165. ; -----------------------------------------------------
  166. ; Display of WhoWas info
  167. ; -----------------------------------------------------
  168. #-whowashide off
  169. raw 369:*:.disable #-whowashide #-whowasaway | halt
  170. #-whowashide end
  171. #-whowasaway off
  172. raw 301:*:if (%-+findingu. [ $+ [ $2 ] ] != $null) halt | set %.dw.rest  $+ %col.dark | _disp.whois $_whoisnick($2) was away ½ $+ %col.dark $+ $replace($3-,,%.dw.rest) $+ ╗ | halt
  173. raw 312:*:{
  174.   if (%-+findingu. [ $+ [ $2 ] ] != $null) { _fuser2 $2 $3 | .enable #-whowashide | halt }
  175.   if ($4 == $null) unset %.ww.opt | else set %.ww.opt , signed off %col.info1 $+ $4-
  176.   _disp.whois $_whoisnick($2) was on %col.info1 $+ $3 $+  $+ %.ww.opt
  177.   set %_last.serv $3 | set %_sf9.server $3
  178. if (%whois.showcc) {
  179.   if ($findtok(net.org.com.edu,$gettok(%_last.whois.addr,$gettok(%_last.whois.addr,0,46),46),46) != $null) halt
  180.   set %.cc.found $code(%_last.whois.addr)
  181.   if (%.cc.found != $null) _disp.whois $_whoisnick($2) was at %col.info1 $+ %.cc.found
  182. }
  183.   halt
  184. }
  185. #-whowasaway end
  186. raw 314:*:{
  187.   if (%-+findingu. [ $+ [ $2 ] ] ) { set %-+findingu. [ $+ [ $2 ] ] $3 | .enable #-whowasaway | halt }
  188.   unset %-ww.nick
  189.   if ($_isopen(%whois.route) == $false) open @Whois
  190.   dispr-div %whois.route | _disp.whois-div
  191.   _disp.whois %col.whois $+ $2 $+  was %col.info1 $+ $3 $+ @ $+ %col.info1 $+ $4
  192.   _disp.whois $_whoisnick($2) was ½ $+ %col.dark $+ $6- $+ ╗
  193.   unset %^follow.* %_last.whois.chan %_last.whoisc
  194.   set %_last.whois $2 | set %_last.whois.identd $3 | set %_last.whois.addr $4
  195.   set %_last.whoisf $2! $+ $3@ $+ $4 | set %_last.whoisr * $6- | set %_last.whoist was
  196.   .enable #-whowasaway | halt
  197. }
  198. raw 406:*:if (%-+findingu. [ $+ [ $2 ] ] ) { set %-+findingu. [ $+ [ $2 ] ] | dispa There was no such user %col.target $+ $2 | .enable #-whowashide } | else { unset %-ww.nick | if ($_isopen(%whois.route) == $false) open @Whois | dispr-div %whois.route | _disp.whois-div | _disp.whois There was no such user %col.whois $+ $2 } | halt
  199. raw 369:*:if ($_isopen(%whois.route)) dispr-div %whois.route | .disable #-whowasaway | halt
  200. ; -----------------------------------------------------
  201. ; Display of Whois info
  202. ; -----------------------------------------------------
  203. #-whoisaway off
  204. raw 301:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | set %.dw.rest  $+ %col.dark | _disp.whois $_whoisnick($2) is away ½ $+ %col.dark $+ $replace($3-,,%.dw.rest) $+ ╗ | halt
  205. #-whoisaway end
  206. raw 310:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt
  207. raw 307:*:if (= isin $2) halt | if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt
  208. raw 308:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt
  209. raw 309:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt
  210. raw 311:*:{
  211.   .enable #-whoisaway
  212.   if (%-+hidewhois. [ $+ [ $2 ] ] ) halt
  213.   set %-ww.nick $2
  214.   if (%-waitwhois. [ $+ [ $2 ] ] != $null) if (%+whois.inchan) goto usagi
  215.   if ($_isopen(%whois.route) == $false) open @Whois
  216.   dispr-div %whois.route
  217.   :usagi
  218.   _disp.whois-div
  219.   _disp.whois %col.whois $+ $2 $+  is %col.info1 $+ $3 $+ @ $+ %col.info1 $+ $4
  220.   _disp.whois $_whoisnick($2) is ½ $+ %col.dark $+ $6- $+ ╗
  221.   unset %^follow.* %_last.whois.chan %_last.whoisc
  222.   set %_last.whois $2 | set %_last.whois.identd $3 | set %_last.whois.addr $4
  223.   set %_last.whoisf $2! $+ $3@ $+ $4 | set %_last.whoisr * $6- | set %_last.whoist is | inc %-num.whois | halt
  224. }
  225. raw 312:*:{
  226.   if ($findtok(%-sping.user,$2,32) != $null) sping $2 $3
  227.   if (%-+hidewhois. [ $+ [ $2 ] ] ) halt
  228.   if (%+disp.options) set %.ww.opt %col.option $+ (ShiftF9 to change to this server) | else unset %.ww.opt
  229.   _disp.whois $_whoisnick($2) on %col.info1 $+ $3 $+  %.ww.opt
  230.   if (%+whois.servername) _disp.whois $_whoisnick($2) on %col.info1 $+ $4-
  231.   set %_last.serv $3 | set %_sf9.server $3
  232. if (%whois.showcc) {
  233.   if ($findtok(net.org.com.edu,$gettok(%_last.whois.addr,$gettok(%_last.whois.addr,0,46),46),46) != $null) halt
  234.   set %.cc.found $code(%_last.whois.addr)
  235.   if (%.cc.found != $null) _disp.whois $_whoisnick($2) at %col.info1 $+ %.cc.found
  236. }
  237.   halt
  238. }
  239. raw 313:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) an   IRCop   | halt
  240. raw 316:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt
  241. raw 317:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | if ($4 !isnum) _disp.whois $_whoisnick($2) is idle %col.dark $+ $duration($3) | else _disp.whois $_whoisnick($2) is idle %col.dark $+ $duration($3) $+ , signed on %col.info1 $+ [[ $+ $asctime($4) $+ ]] | halt
  242. raw 318:*:{
  243.   .disable #-whoisaway #-whoisno
  244.   if (%-+hidewhois. [ $+ [ $2 ] ] ) { set %-+hidewhois. [ $+ [ $2 ] ] | set %-waitwhois. [ $+ [ $2 ] ] | if ($findtok(%-sping.user,$2,32) != $null) dispa No user %col.target $+ $2 $+  found to serverping. | set %-sping.user $remtok(%-sping.user,$2,32) | halt }
  245.   if ((%-num.whois > 1) || (. isin $2) || (* isin $2) || (? isin $2) || ($2 == 0)) {
  246.     if (@ isin %whois.route) _disp.whois End of whois %col.whois $+ ( $+ $2 $+ ) %col.option $+ (right-click for options)
  247.     else _disp.whois End of whois %col.whois $+ ( $+ $2 $+ ) %col.option $+ (see "PP Tools...Do to last /whois" for options)
  248.   }
  249.   if ((%-waitwhois. [ $+ [ $2 ] ] != $null) && (%+whois.inchan)) dispr-div %-waitwhois. [ $+ [ $2 ] ]
  250.   elseif ($_isopen(%whois.route)) dispr-div %whois.route
  251.   set %-waitwhois. [ $+ [ $2 ] ]
  252.   unset %-num.whois | halt
  253. }
  254. raw 319:*:{
  255.   if (%-ccwhois. [ $+ [ $2 ] ] != $null) {
  256.     set %.cc.chans %-ccwhois. [ $+ [ $2 ] ]
  257.     set %.cc.num $_numtok(32,%.cc.chans)
  258.     :loop1
  259.     set %.cc.cha $gettok(%.cc.chans,%.cc.num,32)
  260.     set %.cc.on $remtok($_format.chans2($3-),%.cc.cha,44)
  261.     set %.cc.onnum $_numtok(44,%.cc.on)
  262.     if ((%.cc.onnum > 0) && ($me isop %.cc.cha)) {
  263.       set %.cc.perv $_setting(match.chancheck,%.cc.cha)
  264.       :loop2
  265.       set %.cc.onchk $gettok(%.cc.on,%.cc.onnum,44)
  266.       set %.cc.pnum $_numtok(32,%.cc.perv)
  267.       :loop3
  268.       set %.cc.pchk $gettok(%.cc.perv,%.cc.pnum,32)
  269.       if (%.cc.pchk iswm %.cc.onchk) {
  270.         _prog.punish chancheck ChannelCheck %.cc.onchk %.cc.pchk %.cc.cha $2 $2 $gettok($address($2,5),2,64)
  271.         if ($result == warn) .timer 1 30 _recch $2 %.cc.cha
  272.         goto next
  273.       }
  274.       if ($_vd(.cc.pnum) > 0) goto loop3
  275.       if ($_vd(.cc.onnum) > 0) goto loop2
  276.     }
  277.     :next
  278.     if ($_vd(.cc.num) > 0) goto loop1
  279.     set %-ccwhois. [ $+ [ $2 ] ]
  280.   }
  281.   if (%-+hidewhois. [ $+ [ $2 ] ] ) halt
  282.   set %.wd.wrap $calc(%linewrap.whois - $len($2) - 10)
  283.   if ((%linewrap.whois > 0) && ($len($3-) > %.wd.wrap) && (%.wd.wrap > 15)) {
  284.     set %.wd.chans $3-
  285.     :loopc
  286.     if ($len(%.wd.chans) <= %.wd.wrap) set %.wd.todo %.wd.chans
  287.     else {
  288.       set %.wd.todo $left(%.wd.chans,%.wd.wrap)
  289.       set %.wd.todo $_ltok($_j($_numtok(32,%.wd.todo)),32,%.wd.todo)
  290.     }
  291.     _disp.whois $_whoisnick($2) on $_format.chans(%.wd.todo)
  292.     set %.wd.chans $remtok($remove(%.wd.chans,%.wd.todo),!,32)
  293.     if (%.wd.chans != $null) goto loopc
  294.   }
  295.   else _disp.whois $_whoisnick($2) on $_format.chans($3-)
  296.   set %_last.whoisc $3-
  297.   set %_last.whois.chan $_format.chans2($3-)
  298.   if ($chr(160) isin $3-) _disp.whois $_whoisnick($2) on a channel name containing fake spaces. (could be a "fake" channel)
  299.   elseif (( isin $3-) || ( isin $3-) || ( isin $3-) || ( isin $3-) || ( isin $3-)) _disp.whois $_whoisnick($2) on a channel name containing format codes. (could be a "fake" channel)
  300.   unset %^follow.* | set %.dw.num $_numtok(44,%_last.whois.chan)
  301.   if (%.dw.num == 10) _disp.whois $_whoisnick($2) is on an awful lot of channels, don't you think?
  302.   :loop | set %^follow. [ $+ [ %.dw.num ] ] $gettok(%_last.whois.chan,%.dw.num,44) | if ($_vd(.dw.num) > 0) goto loop
  303.   halt
  304. }
  305. ; -----------------------------------------------------
  306. ; Display of "no such user"
  307. ; -----------------------------------------------------
  308. raw 401:*failed to deliver*:{
  309. if ($chr(1) isin $9) disps Someone left %pp.net before they could reply to the CTCP %col.info2 $+ $_rchop(2,$9) $+  you sent them.
  310. else disps The person you sent this message to has left %pp.net $+ - %col.dark $+ $9-
  311.   halt
  312. }
  313. #-whoisno off
  314. raw 401:*no such*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | unset %-ww.nick | if ($_isopen(%whois.route) == $false) open @Whois | dispr-div %whois.route | _disp.whois-div | _disp.whois No such user %col.whois $+ $2 | halt
  315. #-whoisno end
  316. raw 401:*no such*:{
  317.   set %.iden $gettok($2,1,64)
  318.   if (%-+findping. [ $+ [ %.iden ] ] == $2) {
  319.     set %-+findping. [ $+ [ %.iden ] ]
  320.     dispa No new nickname could be located for %col.target $+ %-+findpingn. [ $+ [ %.iden ] ] $+  (user probably left IRC)
  321.     set %-+findpingn. [ $+ [ %.iden ] ]
  322.     halt
  323.   }
  324.   if (%-isnosuch. [ $+ [ $2 ] ] <= 0) {
  325.     if ($_ischan($2)) disps [[ $+ %col.info1 $+ $lower($2) $+ ] No such channel
  326.     else disprs $2 No such user %col.target $+ $2
  327.   }
  328.   _timersinc 15 -isnosuch. $+ $2
  329.   halt
  330. }
  331. ; -----------------------------------------------------
  332. ; Display of away info
  333. ; -----------------------------------------------------
  334. raw 301:*:{
  335.   if ($2 != $me) {
  336.     if (%-isaway. [ $+ [ $2 ] ] <= 0) {
  337.       set %.dw.rest  $+ %col.dark
  338.       dispr $2 %col.target $+ $2 $+  is away ½ $+ %col.dark $+ $replace($3-,,%.dw.rest) $+ ╗
  339.     }
  340.     _timersinc 60 -isaway. $+ $2
  341.   }
  342.   halt
  343. }
  344. ; -----------------------------------------------------
  345. ; Display of Who info
  346. ; -----------------------------------------------------
  347. raw 354:*:inc %-num.who | _disp.whois $2- | halt
  348. raw 352:*:{
  349.   unset %-ww.nick
  350.   if (%-num.who == $null) { if ($_isopen(%whois.route) == $false) open @Whois | dispr-div %whois.route | _disp.whois-div }
  351.   if (G isin $7) set %.who.away AWAY | else set %.who.away NOT AWAY
  352.   if (* isin $7) set %.who.ircop   IRCop   | else unset %.who.ircop
  353.   if (+ isin $7) set %.who.op + | elseif (@ isin $7) set %.who.op @ | else unset %.who.op
  354.   if (d isin $7) set %.who.deaf (deaf) | else unset %.who.deaf
  355.   if (%+who.two.line) {
  356.     _disp.whois %col.whois $+ $6 $+  %col.info3 $+ %.who.op $+  $+ $left($2,1) $+ %col.dark $+ $_rchop(1,$2) $+  %col.who1 $+ $3 $+ @ $+ $4 $+  %col.info2 $+ %.who.away $+  %.who.ircop %.who.deaf
  357.     _disp.whois $str($chr(160),3) ½ $+ %col.who2 $+ $9- $+ ╗ ½ $+ %col.who3 $+ $5 $+ ╗ %col.option $+ Hops: $8 $+ 
  358.   }
  359.   else _disp.whois %col.whois $+ $6 $+  %col.info3 $+ %.who.op $+  $+ $left($2,1) $+ %col.dark $+ $_rchop(1,$2) $+  %col.who1 $+ $3 $+ @ $+ $4 $+  ½ $+ %col.who2 $+ $9- $+ ╗ ½ $+ %col.who3 $+ $5 $+ ╗ %col.option $+ Hops: $8 $+  %col.info2 $+ %.who.away $+  %.who.ircop %.who.deaf
  360.   inc %-num.who | halt
  361. }
  362. raw 315:*:if (%-num.who < 1) _disp.whois No users found %col.whois $+ ( $+ $2 $+ ) | elseif ((%-num.who > 1) || (. isin $2) || (* isin $2) || (? isin $2)) _disp.whois End of who %col.whois $+ ( $+ $2 $+ ) | if ($_isopen(%whois.route)) dispr-div %whois.route | unset %-num.who | halt
  363. ; -----------------------------------------------------
  364. ; Internal aliases and identifiers
  365. ; for Whois/Who display
  366. ; -----------------------------------------------------
  367. alias _disp.whois-div {
  368.   if (%+time.stamp) {
  369.     if (%+whois.log) write $_wrapfile($logdirwhois.log) $timestamp $strip(%@w) $strip(%=)
  370.     if (%+whois.retain) write $_ppdir $+ who-temp.txt  $+ %col.base $+ $timestamp %@w %=
  371.   }
  372.   else {
  373.     if (%+whois.log) write $_wrapfile($logdirwhois.log) $strip(%@w) $strip(%=)
  374.     if (%+whois.retain) write $_ppdir $+ who-temp.txt %@w %=
  375.   }
  376. }
  377. alias _disp.whois {
  378.   if ($1 == $null) return | set %_last.disp $1-
  379.   if ((%-waitwhois. [ $+ [ %-ww.nick ] ] != $null) && (%+whois.inchan)) {
  380.     set %.oldwr %whois.route
  381.     set %whois.route %-waitwhois. [ $+ [ %-ww.nick ] ]
  382.   }
  383.   else unset %.oldwr
  384.   if ($_isopen(%whois.route) == $false) open @Whois
  385.   if ((%+whois.to.front) && (@ isin %whois.route)) window -ar @Whois
  386.   if (%+time.stamp) set %.dw.show $timestamp %@w $1- | else set %.dw.show %@w $1-
  387.   if (@ isin %whois.route) echo %col.base -i2 %whois.route %.dw.show
  388.   else echo %col.base %whois.route %.dw.show
  389.   if (%+whois.log) write $_wrapfile($logdirwhois.log) $strip(%.dw.show)
  390.   if (%+whois.retain) write $_ppdir $+ who-temp.txt  $+ %col.base $+ $replace(%.dw.show,, [  $+ [ %col.base ] ] )
  391.   if (%.oldwr != $null) set %whois.route %.oldwr
  392. }
  393. alias _whoisnick if ((%whois.nicks == Off) || ($len($1) > 15)) return $str($chr(160),3) | if (%whois.nicks == Hide) return $_color(back) $+  $+ $1 $+  | return %col.whois $+ $1 $+ 
  394. alias _format.chans {
  395.   set %.fc.num $_numtok(32,$1-)
  396.   set %.fc.cur 1
  397.   unset %.fc %.+fc.deaf
  398.   :loop
  399.   set %.fc.z $gettok($1-,%.fc.cur,32)
  400.   if ($left(%.fc.z,1) == -) { set %.fc.z $_rchop(1,%.fc.z) | set %.+fc.deaf $true }
  401.   if (($left(%.fc.z,1) isin +@) && ($mid(%.fc.z,2,1) isin &#)) set %.fc %.fc %col.info3 $+ $left(%.fc.z,1) $+  $+ $mid(%.fc.z,2,1) $+ %col.dark $+ $_rchop(2,%.fc.z)
  402.   else set %.fc %.fc  $+ $left(%.fc.z,1) $+ %col.dark $+ $_rchop(1,%.fc.z)
  403.   if ($_vi(.fc.cur) <= %.fc.num) goto loop
  404.   if (%.+fc.deaf) return (deaf) %.fc
  405.   return %.fc
  406. }
  407. alias _format.chans2 {
  408.   set %.fc.num $_numtok(32,$1-)
  409.   set %.fc.cur 1
  410.   unset %.fc
  411.   :loop
  412.   set %.fc.z $gettok($1-,%.fc.cur,32)
  413.   if ($left(%.fc.z,1) == -) set %.fc.z $_rchop(1,%.fc.z)
  414.   if (($left(%.fc.z,1) isin +@) && ($mid(%.fc.z,2,1) isin &#)) set %.fc %.fc $_rchop(1,%.fc.z)
  415.   else set %.fc %.fc %.fc.z
  416.   if ($_vi(.fc.cur) <= %.fc.num) goto loop
  417.   return $_s2c(%.fc)
  418. }
  419. ; -----------------------------------------------------
  420. ; Delete whois log on startup
  421. ; -----------------------------------------------------
  422. on 1:start:set %.who.file $_ppdir $+ who-temp.txt | if ($exists(%.who.file)) .remove %.who.file
  423. ; -----------------------------------------------------
  424. ; Last seen
  425. ; -----------------------------------------------------
  426. #lastseen off
  427. alias -l _dpseen {
  428.   if ($comchan($nick($chan,$1),0) == 1) {
  429.     if ($nick($chan,$1) == $remove($gettok($gettok($address($nick($chan,$1),5),2-,33),1,64),~)) _sseen $nick($chan,$1) $ctime  $+ $nick($chan,$1) $+ ! $+ $gettok($address($nick($chan,$1),5),2-,33) $chan
  430.     else {
  431.       _sseen $nick($chan,$1) $ctime  $+ $nick($chan,$1) $+ ! $+ $gettok($address($nick($chan,$1),5),2-,33) $chan
  432.       _sseen $remove($gettok($gettok($address($nick($chan,$1),5),2-,33),1,64),~) $ctime $nick($chan,$1) $+ ! $+ $gettok($gettok($address($nick($chan,$1),5),2-,33),1,64) $+ @ $+ $gettok($address($nick($chan,$1),5),2-,64) $chan
  433.     }
  434.   }
  435. }
  436. on 1:part:#:{
  437.   updatenl
  438.   if ($nick == $me) {
  439.     set %.num $nick($chan,0)
  440.     :loop | _dpseen %.num | if ($_vd(.num) > 0) goto loop
  441.   }
  442.   elseif ($comchan($nick,0) == 0) {
  443.     if ($nick == $remove($gettok($address,1,64),~)) _sseen $nick $ctime  $+ $nick $+ ! $+ $address $chan
  444.     else {
  445.       _sseen $nick $ctime  $+ $nick $+ ! $+ $address $chan
  446.       _sseen $remove($gettok($address,1,64),~) $ctime $nick $+ ! $+ $gettok($address,1,64) $+ @ $+ $site $chan
  447.     }
  448.   }
  449. }
  450. on 1:kick:#:{
  451.   updatenl
  452.   if ($comchan($knick,0) == 0) {
  453.     if ($knick == $remove($gettok($gettok($address($knick,5),2-,33),1,64),~)) _sseen $knick $ctime  $+ $knick $+ ! $+ $gettok($address($knick,5),2-,33) $chan
  454.     else {
  455.       _sseen $knick $ctime  $+ $knick $+ ! $+ $gettok($address($knick,5),2-,33) $chan
  456.       _sseen $remove($gettok($gettok($address($knick,5),2-,33),1,64),~) $ctime $knick $+ ! $+ $gettok($gettok($address($knick,5),2-,33),1,64) $+ @ $+ $gettok($address($knick,5),2-,64) $chan
  457.     }
  458.   }
  459. }
  460. on !1:quit:{
  461.   if ($nick == $remove($gettok($address,1,64),~)) _sseen $nick $ctime  $+ $nick $+ ! $+ $address $comchan($nick,1)
  462.   else {
  463.     _sseen $nick $ctime  $+ $nick $+ ! $+ $address $comchan($nick,1)
  464.     _sseen $remove($gettok($address,1,64),~) $ctime $nick $+ ! $+ $gettok($address,1,64) $+ @ $+ $site $comchan($nick,1)
  465.   }
  466. }
  467. on 1:disconnect:{
  468.   if (%pp.net == Offline) return
  469.   _flushseen
  470.   set %.fil $_ppdir $+ lastseen.dat
  471.   set %.num $ial(*,0)
  472.   :loop | _dsseen %.num | if ($_vd(.num) > 0) goto loop
  473. }
  474. alias -l _dsseen {
  475.   if (%+lastseen.onlyrecknown) if (($ial(*,$1).nick !isnotify) && ($maddress($ial(*,$1)) == $null)) return
  476.   if ($comchan($ial(*,$1).nick,1) != $null) {
  477.     if ($ial(*,$1).nick == $remove($ial(*,$1).user,~)) write -s [ $+ [ $ial(*,$1).nick ] ] %.fil $ial(*,$1).nick $ctime  $+ $ial(*,$1).nick $+ ! $+ $ial(*,$1).addr $comchan($ial(*,$1).nick,1)
  478.     else {
  479.       write -s [ $+ [ $ial(*,$1).nick ] ] %.fil $ial(*,$1).nick $ctime  $+ $ial(*,$1).nick $+ ! $+ $ial(*,$1).addr $comchan($ial(*,$1).nick,1)
  480.       write -s [ $+ [ $remove($ial(*,$1).user,~) ] ] %.fil $remove($ial(*,$1).user,~) $ctime $ial(*,$1).nick $+ ! $+ $ial(*,$1).user $+ @ $+ $ial(*,$1).host $comchan($ial(*,$1).nick,1)
  481.     }
  482.   }
  483. }
  484. on !1:nick:_sseen $nick $ctime  $+ $nick $+ ! $+ $address $comchan($newnick,1)
  485. #lastseen end
  486. alias _sseen {
  487.   if (%+lastseen.onlyrecknown) if (($gettok($strip($3),1,33) !isnotify) && ($maddress($strip($3)) == $null)) return
  488.   inc %_ssnum | set %_sseen. [ $+ [ %_ssnum ] ] $1- | if (%_ssnum >= 20) _flushseen
  489. }
  490. alias _flushseen {
  491.   set %.fil $_ppdir $+ lastseen.dat
  492.   set %.2fl 1
  493.   :loop
  494.   _flushseen2 %_sseen. [ $+ [ %.2fl ] ]
  495.   if ($_vi(.2fl) <= %_ssnum) goto loop
  496.   unset %_ssnum %_sseen.*
  497. }
  498. alias -l _flushseen2 if ($1 != $null) write -s [ $+ [ $1 ] ] %.fil $1-
  499. alias _findseen {
  500.   _flushseen
  501.   if ($1 == $null) return No user specified
  502.   if ((* isin $1) || (? isin $1) || (! isin $1) || (@ isin $1)) return Invalid user
  503.   set %.fs $1 $+ !*@*
  504.   if ($comchan($1,0) > 0) {
  505.     if ((%+lastseen.hidechan) && ($2 != !)) set %.chan IRC
  506.     else set %.chan  $+ $comchan($1,1) $+ 
  507.     if ((%+lastseen.hideaddr) && ($2 != !)) set %.addr  $+ $ial(%.fs,1).nick $+ 
  508.     else set %.addr  $+ $ial(%.fs,1).nick $+ ! $+ $gettok($ial(%.fs,1),2-,33)
  509.     return %.addr is on %.chan right now
  510.   }
  511.   if (($2 == !) || (%+lastseen.identdok)) {
  512.     set %.fs *!* $+ $1 $+ @*
  513.     if ($ial(%.fs,0) > 0) {
  514.       if ((%+lastseen.hidechan) && ($2 != !)) set %.chan IRC
  515.       else set %.chan  $+ $comchan($ial(%.fs,1).nick,1) $+ 
  516.       if ((%+lastseen.hideaddr) && ($2 != !)) set %.addr  $+ $ial(%.fs,1).user $+  (by identd)
  517.       else set %.addr $ial(%.fs,1).nick $+ ! $+  $+ $ial(%.fs,1).user $+ @ $+ $ial(%.fs,1).host
  518.       return %.addr is on %.chan right now
  519.     }
  520.   }
  521. if ($exists( [ [ $_ppdir ] $+ ] lastseen.dat) == $fasle) return My last seen data is empty.
  522. set %.fs $read -ns [ $+ [ $1 ] ] [ [ $_ppdir ] $+ ] lastseen.dat
  523.   if (%.fs == $null) return I have not seen anyone matching  $+ $1 $+ 
  524.   set %.who $gettok(%.fs,2,32)
  525.   if ((! isin %.who) && ($_not(%+lastseen.identdok)) && ($2 != !)) return I have not seen anyone matching  $+ $1 $+ 
  526.   if ((%+lastseen.hidechan) && ($2 != !)) unset %.chan
  527.   else set %.chan , on  $+ $gettok(%.fs,3,32) $+ 
  528.   if ((%+lastseen.hideaddr) && ($2 != !)) {
  529.     set %.who z $+ %.who
  530.     if (! isin %.who) set %.who  $+ $gettok(%.who,2,31) $+  (by identd)
  531.     else set %.who  $+ $gettok(%.who,2,31) $+ 
  532.   }
  533.   return %.who was last seen $duration($calc($ctime - $gettok(%.fs,1,32))) ago $+ %.chan
  534. }
  535. alias seen if ($1 == $null) _quickhelp /seen | dispa $_findseen($1,!)
  536. alias sayseen if ($1 == $null) _quickhelp /sayseen | say $_findseen($1)
  537. alias sseen sayseen $1-
  538. alias _mseen msg $1 $_findseen($2)
  539. alias clrseen {
  540.   set %.file $_ppdir $+ lastseen.dat
  541.   if ($_not($exists(%.file))) _error Seen database is already empty
  542.   if ($1 == $null) { .remove %.file | dispa Seen database cleared. }
  543.   else {
  544.     _progress.1 Cleaning seen data older than $1 days...
  545.     set %.old $calc($ctime - $1 * 86400)
  546.     set %.max $lines(%.file)
  547.     set %.cur 1
  548.     :loop
  549.     set %.line $read -nl [ $+ [ %.cur ] ] %.file
  550.     if ((%.line == $null) || ($gettok(%.line,2,32) < %.old)) {
  551.       write -dl [ $+ [ %.cur ] ] %.file
  552.       dec %.max
  553.     }
  554.     else inc %.cur
  555.     if ($_vi(.per) > 5) {
  556.       set %.per $int($calc(%.cur * 100 / %.max))
  557.       _progress.2 %.per Entry %.cur of %.max $+ ...
  558.       unset %.per
  559.     }
  560.     if (%.cur <= %.max) goto loop
  561.     _progress.2 100 Cleaning complete!
  562.   }
  563. }
  564.