File: newaway

package info (click to toggle)
epic5 3.0.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: ansic: 75,810; makefile: 648; ruby: 227; python: 215; sh: 78; perl: 13
file content (40 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (5)
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
if (word(2 $loadinfo()) != [pf]) { load -pf $word(1 $loadinfo()); return; };

# newaway.m
# v1.2 by Joseph Carter <knghtbrd@debian.org>
# v1.0-1.1 by Matthew Green
#
# Public domain, as was the original
#
# Changes:
#  28 Jun 1999, v1.2 - rewrote the whole thing for epic4  =>
#   5 Jul 1999, v1.3 - replaced some @ var ='s with ^assign
#                    - moved the whois check out of _na.show
#                    - we now display away differently if in whois

package newaway;

alias _na.show {
  @ :nick = encode($tolower($0));
  @ :away = encode($tolower($1-));

  unless (_na.nick[$nick] == away) {
    @ _na.nick[$nick] = away;
    return 1;
  };
  return 0;
};

on #^311 311 "*" { ^assign _na.whois.$lastserver() 1; };
on #^318 311 "*" { ^assign -_na.whois.$lastserver(); };

on ^301 "*" {
  if (_na.whois[$lastserver()]) {
    xecho -b away     : $1-;
  } elsif (_na.show($*)) {
    xecho -b $0 is away: $1-;
  };
};

on ^unload "newaway *" { purge _na; };