File: wallop.pl

package info (click to toggle)
sirc 2.211-5
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 372 kB
  • ctags: 356
  • sloc: perl: 4,254; ansic: 1,201; sh: 571; makefile: 66
file content (30 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (4)
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
#  wallop.pl, minimal version by orabidoo, 14 Oct 95
#  does not attempt to reformat incoming wallops, just sends them out

sub cmd_wall {
  &tell("*\cbE\cb* No text to send"), return unless $args;
  &tell("*\cbE\cb* You're not on a channel"), return unless $talkchannel;
  $wallop_text=$args;
  $wallop_channel=$talkchannel;
  &addhook("353", "wallopnames");
  &sl("NAMES $talkchannel");
}
&addcmd("wall");

sub hook_wallopnames {
  local($wallop, @wallop)=("", split(/ +/, $_[0]));
  shift @wallop; shift @wallop; shift @wallop;
  $wallop[0] =~ s/^://;
  foreach (@wallop) {
    $wallop.=$_."," if s/^\@//;
  }
  if ($wallop eq '') {
    &tell("*\cbE\cb* No ops to wallop");
  } else {
    $wallop =~ s/,$//;
    &sl("NOTICE ".$wallop." :\cb[WallOp/".$wallop_channel."]\cb ".$wallop_text);
  }
  &remhook("353", "wallopnames");
  $silent=1;
}