… | |
… | |
23 | } |
23 | } |
24 | |
24 | |
25 | sub do_list { |
25 | sub do_list { |
26 | my ($board, $who, $npc) = @_; |
26 | my ($board, $who, $npc) = @_; |
27 | my $cont = CFBoard::get ($board); |
27 | my $cont = CFBoard::get ($board); |
28 | if (@{$cont || []}) { |
|
|
29 | $who->reply ($npc, "$board content:"); |
|
|
30 | my $idx = 0; |
|
|
31 | for (@$cont) { |
28 | if (@$cont) { |
32 | $who->reply ($npc, "<$idx> $_->[0]: $_->[1]"); |
29 | my $msg = "$board content:\n\n"; |
33 | $idx++; |
30 | $msg .= "<$_> $cont->[$_][0]: $cont->[$_][1]\r" |
34 | } |
31 | for 0 .. $#$cont; |
|
|
32 | $who->reply ($npc, $msg); |
35 | } else { |
33 | } else { |
36 | $who->reply ($npc, "$board is empty."); |
34 | $who->reply ($npc, "$board is empty."); |
37 | } |
35 | } |
38 | 1 |
36 | 1 |
39 | } |
37 | } |