12 changed files with 39 additions and 25 deletions
@ -1,16 +1,22 @@
@@ -1,16 +1,22 @@
|
||||
package Counterattack; |
||||
|
||||
use Milkbone; |
||||
use Milkbone::AllHooks; |
||||
use base 'Milkbone::AllHooks'; |
||||
|
||||
register_hook("protocol_eviled", sub { |
||||
warn "$ARGS{-user} has warned you. Counterstrike initiated."; |
||||
hook("protocol_evil", -user => $ARGS{-user}); |
||||
error(-short => "$ARGS{-user} has warned you. Counterstrike initiated."); |
||||
protocol_evil(-user => $ARGS{-user}); |
||||
|
||||
register_hook("msg_in_$ARGS{-user}", sub { |
||||
warn "Counterstrike completed"; |
||||
hook("protocol_evil", -user => $ARGS{-user}); |
||||
protocol_evil(-user => $ARGS{-user}); |
||||
deregister_hook("msg_in_$ARGS{-user}"); |
||||
}, {-user => $ARGS{-user}}); |
||||
}); |
||||
|
||||
register_hook("msg_in", sub { |
||||
deregister_hook("protocol_eviled"); |
||||
}); |
||||
|
||||
1; |
||||
|
Loading…
Reference in new issue