print "${BGreen}Loading chat.pl\n";
($name, $aliases, $addrtype, $length, @ips) = gethostbyname($ENV{HOSTNAME});
($a, $b, $c, $d) = unpack('C4', $ips[0]);
$my_ip = "$a.$b.$c.$d";
# sub cmd_ch {
#  mcl_chatall("${col_W}$_ ${col_K}: ${col_B}Fate${col_K}\(${col_W}3${col_K}\)");
# }
open(FILE, "/testfile");
@estilarge = <FILE>;
sub cmd_testchat2 {
 mcl_chatall("@estilarge"); }

sub cmd_testchat {
 mcl_chatall(chr(10)," $_ is correct ",chr(10)) }

sub cmd_sendip { mcl_send("$_ $my_ip"); }

sub cmd_cc {
  mcl_chatall("${col_W}$_");
}

sub cmd_blink {
	mcl_chatall("\e[5m\e[37m col_W\n"); }

sub cmd_cco {
  mcl_chatalle(":${col_B}\[${col_W}$_${col_B}\]\n");
}

sub cmd_ch {
  mcl_chatall("${col_W}\[${col_B}OEC${col_W}\]	${col_W}$_ ",chr(10),chr(13),"${col_W}\[${col_B}OEC${col_W}\]");
}

sub cmd_showcolour {
  mcl_chatalle(":${col_n}n ${col_r}r ${col_g}g ${col_y}y ${col_b}b ${col_m}m ${col_c}w ${col_n}n");
}

sub cmd_showcolour2 {
  mcl_chatalle(":${col_K}K ${col_R}R ${col_G}G ${col_Y}Y ${col_B}B ${col_M}M ${col_C}C ${col_W}W");
}

sub cmd_weirdchat {
 @string = @_;
 $newstuff=reverse(@string);
 mcl_chatall("$newstuff"); }

sub cmd_weirdclan {
 @string = @_;
 $newstuff=reverse(@string);
 mcl_send("clan $newstuff"); }

sub cmd_weirdtown {
 @string = @_;
 $newstuff=reverse(@string);
 mcl_send("town $newstuff"); }

sub cmd_weirdsay {
 @string = @_;
 $newstuff=reverse(@string);
 mcl_send("say $newstuff"); }

sub cmd_weirdimm {
 @string = @_;
 $newstuff=reverse(@string);
 mcl_send("imm $newstuff"); }


sub mcl_chatalle {
 run("/chatall emote @_");
}


sub mcl_chatall {
 run("/chatall @_");
}


sub ipaddress {
    s/\\\%i/percenti/g;
    s/\%i/$my_ip/g;
    s/percenti/\%i/g;
}

userinput_add(\&ipaddress);

1;









