Hi All! A lot of time I just wach and now here is my first modification of Leandro OPchat script. I modify it for using in version 0.7.4 - ops are still registrated in asociative variable - I can not find faster way to figure out all OPs online. I add function MSG from user - if non op sends message it reaches OPs, and user gets feedback. I use it in my Hub for one reason - users send messages to my OPs if someone is sharing win or Prog folder and any available OP can help. Here is modified script

--------------------------Start-----------------------------

#Operator chat script for
#Open DC Hub version 0.7.4
#base Leandro Morgado - leandro.morgado@clix.pt
#modifications for version 0.7.4 MarcZ marcz@apollo.lv

my $botname = "OPerChats";
my %ops = ();

sub main()
{
odch::register_script_name($botname);
}

#add admin in %ops with value 2
sub op_admin_connected()
{
my($nick) = @_;
$ops{$nick} = 2;
#@ops = %ops;

#odch::data_to_user($nick,"\$To: $nick From: $botname \$ Niks: $nick Liste: @ops");
}

#add ops in %ops with value 1
sub op_connected()
{
my($nick) = @_;
$ops{$nick} = 1;
}

#remove user from %ops
sub user_disconnected()
{
my($nick) = @_;
delete $ops{$nick};
}

#When the hub receives data
sub data_arrival()
{
my($nick, $data) = @_;
my($type) = odch::get_type($nick);

#If the data is destined for the bot
if($data =~ /\$To: $botname/){
# and the person that sent the data is op or admin
if($type >= 8){
#Send the msg to everyone in %ops
while (($key) = each %ops) {
#except back to original user - we don't want repeats
if($key ne $nick){
#Get only the relevant text
my @msgdata = split(/\$/,$data);
odch::data_to_user($key,"\$To: $key From: $botname \$$msgdata[-1]");
}
else{
#odch::data_to_user($key,"\$To: $key From: $botname \$$msgdata[-1]");
#odch::data_to_user($key,"\$To: $key From: $botname \$$key = $nick|");
#odch::data_to_user($key,"\$To: $key From: $botname \$$value = $user|");
}
}
}
#if the sender is not an op. Mesage sent to OPs and information back tu user
else{
while (($key) = each %ops){
my @msgdata = split(/\$/,$data);
odch::data_to_user($key,"\$To: $key From: $botname \$ <MSG from user $nick> $msgdata[-1]");
}
{
odch::data_to_user($nick, "\$To: $nick From: $botname \$ Your mesage is sent to OPs!|");
}
}
}
}

--------------------------------Finish----------------------