File: whowas

package info (click to toggle)
ircii 4.4-3
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 4,256 kB
  • ctags: 2,797
  • sloc: ansic: 36,743; sh: 907; makefile: 483; lex: 16
file content (125 lines) | stat: -rw-r--r-- 1,752 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Tame the WHOWAS history!
# by Mycroft (mycroft@ai.mit.edu)
# 311 312 313 314 316 317 318 319 353 401 changed for 2.2.2 (server == $0)


ALIAS STRIPCHAN {
  assign function_return $strip(#+-*/\\={}[]<>!@$$%^~`,?:|'\". $0-)
}

ALIAS PURGE {
  foreach $0 i
  {
    purge $0.$i
  }
  ^assign -i
  ^assign -$0
}

ALIAS WHOIS {
  purge whowas.$stripchan($0)
  //whois $0
}

ALIAS WHOWAS {
  purge whowas.$stripchan($0)
  //whowas $0
}

ON #^SEND_MSG 69 * {
  purge whowas.$stripchan($0)
}

ON #^SEND_NOTICE 69 * {
  purge whowas.$stripchan($0)
}

ON #^CONNECT 69 * {
  purge whowas
}

ON #^TIMER 69 * {
  foreach whowas i
  {
    if (time() - whowas.$(i).time > 60)
    {
      purge whowas.$i
    }
  }
  assign -i
}

ON ^311 * {
  _whowas_314 is $1-
  assign -whowas.last
}

ON ^319 * {
  echo *** on channels: $1-
}

ON ^301 * {
  echo *** $0 is away: $1-
}

ON ^313 * {
  echo *** $1 is an IRC operator
}

ON ^317 * {
  if ([$2] == [1])
  {
    echo *** $1 has been idle 1 second
  }
  {
    echo *** $1 has been idle $2 seconds
  }
}

ON ^314 * {
  _whowas_start $stripchan($1) $1-
}

ALIAS _WHOWAS_START {
  assign whowas.$0.314 $1-
  assign whowas.$0.time $time()
  assign whowas.last $0 $stripchan($2).$stripchan($3)
}

ON ^312 * {
  if (whowas.last)
  {
    _whowas_do $whowas.last $stripchan($1) $1-
  }
  {
    _whowas_312 $1-
  }
}

ALIAS _WHOWAS_DO {
  if ([$(whowas.$0.past.$1.$2)])
  {
  }
  {
    assign whowas.$0.past.$1.$2 1
    assign whowas.$0.312 $3-
    _whowas_314 was $(whowas.$0.314)
    _whowas_312 $3-
  }
  assign -whowas.last
}

ALIAS _WHOWAS_314 {
  if ([$5] == [*])
  {
    echo *** $2 $0 $3@$4 \($6-)
  }
  {
    echo *** $2 $0 $3@$4 \($6-) on channel $5
  }
}

ALIAS _WHOWAS_312 {
  echo *** on irc via server $1 \($2-)
}