7 chatbotlib.pl - Library for accessing chatbots
11 require "/usr/share/monolith-chat/bots/chatbotlib.pl";
14 @rooms = cb_get_all_rooms ();
15 $msg = cb_wait_message (rooms => \@rooms, msgtypes => CB_POSTING|CB_ENTER);
16 cb_post_message (room => $roomid, text => "the message");
27 use vars qw($_cb_server $_cb_userid);
29 =item cb_init (\@ARGV);
31 Initialize the chatbot library. This parses and removes parameters
32 from the global C<@ARGV> which control the behaviour of the chatbot.
37 =item -s http://server/so-bin/chatbot.so
39 The URL of the C<chatbox.so> shared object script on the
40 server. This defaults to C<http://localhost/so-bin/chatbox.so>
44 The user ID to use. The default is 0 (anonymous).
52 # This is a reference to the global @ARGV array.
55 for (my $i = 0; $i < @$ARGV-1; ++$i)
57 if ($ARGV->[$i] eq '-s')
59 ($_, $_cb_server) = splice @$ARGV, $i, 2;
61 elsif ($ARGV->[$i] eq '-u')
63 ($_, $_cb_userid) = splice @$ARGV, $i, 2;
68 =item @rooms = cb_get_all_rooms ()
70 Return a list of all rooms.
80 Copyright (C) 2003 Richard W.M. Jones.