milkbone57 22 years ago
parent
commit
f98d35b372
  1. 1
      docs/VERSION.txt
  2. 2
      mb.conf
  3. 5
      mos.pl
  4. 24
      plugins/Net-Demo.pl
  5. 25
      plugins/Net-OSCAR/Net-OSCAR.pl
  6. 20
      plugins/Tk-Chat/Milkbone/Chat.pm
  7. 21
      plugins/Tk-Chat/Tk-Chat.pl

1
docs/VERSION.txt

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
0.7
--
* Ticker runs in BList
* Milkbone::Hooks works
* Net-Demo mostly working
* Fixed a random typing notifications bug that appeared out of nowhere

2
mb.conf

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
# mb.conf - milkbone global configuration file
Goodbye sorry, gotta, go
Modules Tk-PluginsConf, Net-Demo, Tk-GUI, Tk-Logon, Tk-BList, Tk-Profile, Tk-File, Tk-About, Tk-Convo, Tk-Conf, Tk-AddBuddy
Modules Tk-PluginsConf, Net-Demo, Tk-GUI, Tk-Logon, Tk-BList, Tk-Profile, Tk-File, Tk-About, Tk-Convo, Tk-Conf, Tk-AddBuddy, Tk-Chat
Plugins XAMP, Monitor, Counterstrike
Port 5190
HeavyLogging 0

5
mos.pl

@ -25,7 +25,7 @@ eval { @@ -25,7 +25,7 @@ eval {
use Milkbone;
use Milkbone::Hooks qw(load_options pre_mainloop post_mainloop
protocol_signon load_plugins);
protocol_signon load_plugins create_logon_prompt);
$| = 1;
@ -40,8 +40,9 @@ eval { @@ -40,8 +40,9 @@ eval {
load_plugins;
pre_mainloop;
protocol_signon -user => 'test', -pass => 'test';
protocol_signon(-user => 'test', -pass => 'pass');
data("me") = "test";
#create_logon_prompt;
MOSLoop;
post_mainloop;

24
plugins/Net-Demo.pl

@ -35,13 +35,23 @@ register_hook "protocol_signon", sub { @@ -35,13 +35,23 @@ register_hook "protocol_signon", sub {
hook("buddy_in", -group => 'Buddies', -buddy => 'test_user');
});
hook("after", -time => 1000, -code => sub {
hook("msg_in", -user => 'thatguy', -msg => '<b>hey</b>');
});
hook("after", -time => 1500, -code => sub {
hook("protocol_send_im", -dest => 'thatguy', -msg => '<b>hey there</b>');
});
# hook("after", -time => 1000, -code => sub {
# hook("msg_in", -user => 'thatguy', -msg => '<b>hey</b>');
# });
# hook("after", -time => 1500, -code => sub {
# hook("protocol_send_im", -dest => 'thatguy', -msg => '<b>hey there</b>');
hook("after", -time => 500, -code => sub {
register_hook "protocol_chat_accept", sub {
hook("protocol_chat_joined", -name => 'erer', -user => 'er',
-url => 'ere');
hook("protocol_chat_buddy_in_ere", -user => 'charles');
};
hook("protocol_chat_invited", -user => 'thatguy',
-url => 'er');
});
};
1;

25
plugins/Net-OSCAR/Net-OSCAR.pl

@ -20,9 +20,9 @@ my $tick_interval = 1; @@ -20,9 +20,9 @@ my $tick_interval = 1;
register_hook("protocol_add_buddy", sub { $oscar->add_buddy($ARGS{-group}, $ARGS{-buddy}); } );
register_hook("protocol_add_buddy_group", sub { $oscar->add_buddy($ARGS{-group}); } );
register_hook("protocol_away_status", sub { $is_away; } );
register_hook("protocol_chat_accept", sub { $oscar->chat_accept($chats{$ARGS{-chat}}) });
register_hook("protocol_chat_decline", sub { $oscar->chat_decline($chats{$ARGS{-chat}}); undef $chats{$ARGS{-chat}}; });
register_hook("protocol_chat_invite", sub { $chats{$ARGS{-chat}}->invite(@ARGS{-user, -msg}) });
register_hook("protocol_chat_accept", sub { $oscar->chat_accept($ARGS{-url}) });
register_hook("protocol_chat_decline", sub { $oscar->chat_decline($chats{$ARGS{-url}}); delete $chats{$ARGS{-url}}; });
register_hook("protocol_chat_invite", sub { $chats{$ARGS{-url}}->invite(@ARGS{-user, -msg}) });
register_hook("protocol_chat_join", sub { $oscar->chat_join($ARGS{-chat}) });
register_hook("protocol_chat_part", sub { $chats{$ARGS{-chat}}->part; });
register_hook("protocol_chat_send", sub { $chats{$ARGS{-chat}}->chat_send($ARGS{-msg}, !($ARGS{-reflect} or 1)) });
@ -160,32 +160,34 @@ sub signon @@ -160,32 +160,34 @@ sub signon
$oscar->set_callback_chat_invite(
sub {
hook("protocol_chat_invited", -user => $_[1], -msg => $_[2], -url => $_[4]);
#$chats{$_[3]->{name}} = $_[3];
$chats{$_[4]} = $_[3];
hook("protocol_chat_invited", -user => $_[1], -msg => $_[2], -url => $_[4]);
} );
$oscar->set_callback_chat_joined(
sub {
hook("protocol_chat_joined");
hook("protocol_chat_joined", -url => $_[2]->{url}, -name =>
$_[2]->{name});
} );
$oscar->set_callback_chat_closed(
sub {
hook("protocol_chat_closed");
hook("protocol_chat_closed", -url => $_[1]->{url});
} );
$oscar->set_callback_chat_buddy_in(
sub {
hook("protocol_chat_buddy_in", -user => $_[1], -chat => $_[2]->name);
print $oscar->buddy($_[1])->{comment};
hook("protocol_chat_buddy_in_" . $_[2]->{url},
-chat => $_[2]->{url});
} );
$oscar->set_callback_chat_buddy_out(
sub {
hook("protocol_chat_buddy_out", -user => $_[1], -chat => $_[2]->name);
hook("protocol_chat_buddy_out_" . $_[2]->{url},
-chat => $_[2]->{url});
} );
hook("tk_getmain")->after(30, \&tick) unless option("MOSHLoop");
hook("tk_getmain")->repeat(30, \&tick) unless option("MOSHLoop");
register_hook("tick", \&tick) if option("MOSHLoop");
$should_die = 0;
@ -204,7 +206,6 @@ sub tick @@ -204,7 +206,6 @@ sub tick
{
return unless $oscar;
$oscar->do_one_loop;
hook("tk_getmain")->after(30, \&tick) unless $should_die || option("MOSHLoop");
}
sub request_info

20
plugins/Tk-Chat/Milkbone/Chat.pm

@ -29,6 +29,10 @@ sub on_msg_in @@ -29,6 +29,10 @@ sub on_msg_in
sub on_buddy_in
{
my ($self, $buddy) = @_;
$self->{blist}->insert('end', $buddy);
$self->{display}->insertHTML('end',
"<font color='blue'>$buddy has entered the room");
}
sub on_buddy_out
@ -47,12 +51,24 @@ sub init @@ -47,12 +51,24 @@ sub init
# $self->bind("<Escape>" => [$self, "destroy"]);
hook("tk_seticon", -wnd => $self);
$self->{menu} = $self->Menu(-borderwidth => 0, -activeborderwidth => 0);
$self->{menu_file} = $self->{menu}->cascade(-label => "File", -tearoff => 0);
$self->{menu_file}->command(-label => "Close", -command => [$self, "destroy"]);
$self->configure(-menu => $self->{menu});
my $top = $self->Frame;
$self->{display} = $top->Browser(-background => 'white')->pack(-expand => 1, -fill => 'both', -side => 'left', -padx => 1);
$self->{blist} = $top->Listbox(-background => 'white')->pack(-expand => 1, -fill => 'both', -side => 'right', -padx => 1);
$top->pack(-expand => 1, -fill => 'both', -padx => 3, -pady => 5);
$self->{in} = $self->BrowseEdit(-height => 4)->pack(-fill => 'x', -padx => 3, -pady => 5);
$self->update;
$self->geometry("+" . int(($self->screenwidth() / 2) - int($self->width() / 2)) . "+" . int(($self->screenheight() / 2) - int($self->height() / 2)) );
$self->deiconify;
$self->resizable(0, 0);
$self->update();
}
1;
1;

21
plugins/Tk-Chat/Tk-Chat.pl

@ -7,33 +7,38 @@ use Milkbone; @@ -7,33 +7,38 @@ use Milkbone;
use Milkbone::Chat;
register_hook("protocol_chat_invited", sub {
if($self->messageBox(-title => "Join Chat?",
if(hook("tk_getmain")->messageBox(-title => "Join Chat?",
-message => "$ARGS{-user} has invited you to join a chat. Would you like to accept?", -type => 'YesNo',
-icon => 'question', -default => 'no') =~ m/yes/i)
{
hook("protocol_chat_accept", -url => $ARGS{-url});
hook("protocol_chat_accept", -url => $ARGS{-url});
}
else
{
hook("protocol_chat_decline", -url => $ARGS{-url});
}
});
register_hook("protocol_chat_joined", sub {
my $chat = hook("tk_getmain")->MBChat;
$chat->init($ARGS{-chat});
register_hook("protocol_chat_buddy_in_$ARGS{-chat}", sub {
$chat->init($ARGS{-name});
register_hook("protocol_chat_buddy_in_$ARGS{-url}", sub {
$ARGS{-self}->on_buddy_in($ARGS{-user});
}, {-self => $chat});
register_hook("protocol_chat_buddy_out_$ARGS{-chat}", sub {
register_hook("protocol_chat_buddy_out_$ARGS{-url}", sub {
$ARGS{-self}->on_buddy_out($ARGS{-user});
}, {-self => $chat});
register_hook("protocol_chat_msg_in_$ARGS{-chat}", sub {
register_hook("protocol_chat_msg_in_$ARGS{-url}", sub {
$ARGS{-self}->on_msg_in($ARGS{-user});
}, {-self => $chat});
register_hook("protocol_chat_closed_$ARGS{-chat}", sub {
register_hook("protocol_chat_closed_$ARGS{-url}", sub {
$ARGS{-self}->destroy;
}, {-self => $chat});
});
1;
1;

Loading…
Cancel
Save