Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use Minecraft::RCON;
- use Xchat qw( :all );
- my $name = 'Minecraft rcon relay script';
- my $version = '0.1';
- my $nick = 'YOURNICK';
- register( $name, $version, "Relay channel text to minecraft");
- foreach('Channel Message', 'Channel Msg Hilight')
- {
- hook_print($_, \&relay);
- }
- sub relay
- {
- my $rcon = Minecraft::RCON->new( {
- password => 'YOURPW',
- port => 'YOURPORT',
- address => 'YOURMCSERVER',
- strip => '1',
- convert => '0'
- });
- if($rcon->connect)
- {
- my $result = $rcon->command("/tell $nick ".$_[0][1]);
- return EAT_NONE;
- }
- else
- {
- warn "rcon: could not connect\n";
- return EAT_NONE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment