ok well with my bot i want a chat room and i used this code:
Code:
elsif($msg =~ /^\!chat/)<br /> {<br /> if (!defined $chat) { <br /> $chat = $self;<br /> $chat->sendmsg("The chatroom is empty, this conversation is now the chatroom!",Font => "Tahoma",Color => '663300',Effect => "B");<br /> $chatters++;<br /> $self->sendmsg("Chat: $username has started chat. $chatters in room\n");<br /> open (DATA, ">>logs/chat.txt");<br /> print DATA "Room created by $username - " . localtime() . "\n\n";<br /> close(DATA);<br /> } else {<br /> $self->sendmsg("Please wait. You are being invited to the chatroom", "$username",Font => "Tahoma",Color => '999900',Effect => "B");<br /> $chat->send("CAL", "$victim"); <br /> }
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Sun Dec 28, 2003 4:48 pm Post subject:
I would recommend using $chat->invite($victim). Since that wont break when you change protocols, and it actualy works
I'm not sure if that is your specific program but its definitly possible.
Also make sure that $victim is actualy holding there email address. Since in the two entries above it you use $username, i'm betting that $victim is not the right variable.
Let use know if you get it working. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com
You can make it work for WiredBots code, you just have to change a few things.
1. Wherever there's an IF/ELSIF for a command like this, change it to a sub. Example: if ($msg =~ /\/help/i) == sub help {
2. Immediately after the sub you'll need $victim, $msg, and $self from the shift. If $self isn't being sent, look from on_im.pl to commands.pl to make sure it is being sent a recieved from the shifts.