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