Okay, this is for AIM users only, but you can always alter the code to work with MSN. If you are using RBot, you don't have to change much at all, but otherwise, just erase "$colors".
Okay, in the coding where it sends the reply to the user, replace this:
Code:
<br />$aim->send_im($victim, "$reply");<br />
(..or whatever it says..)
With this:
Code:
if(-e "sms/$victim.txt"){<br />open(MESSAGE, "sms/$victim.txt");<br />$sm = <MESSAGE>;<br />close(MESSAGE);<br />$aim->send_im($victim, "$colors$reply\n<font color=red>\[SYSTEM MESSAGE: $sm\] Type .confirm to confirm that you have read this notice.</font>");<br /><br />}else{<br />$aim->send_im($victim, "$colors$reply");<br />}<br />
Also, you have to add the confirm command. My confirm command is it's own perl file, here it is...
confirm.pl
Code:
<br /> sub confirm{<br /> $victim = shift;<br /><br /> if(-e "sms/$victim.txt"){<br /> unlink("sms/$victim.txt");<br /> $reply = "Thank you for confirming your system message.";<br /> }else{<br /> $reply = "Oops! You don't have any system messages to delete!";<br /> }<br /><br />return $reply;<br /> }<br /> 1;
So whenever you want to add a system message (maybe if you have a command that promotes somebody from a Mod to an Admin or something), just put this into the code:
Code:
open(DATA, ">sms/WHO YOU WANT THE SYSTEM MESSAGE TO BE FOR.txt");<br />print(DATA "THE SYSTEM MESSAGE THAT YOU WANT THE BOT TO DISPLAY");<br />close(DATA);
But make sure to edit those two sections.. So maybe in a file called "botmail.pl" that sends a "Mail" through your bot, you would put the following when a botmail is sent:
Code:
open(DATA, ">sms/$mailreceiver.txt");<br />print(DATA "You have new Bot-Mail from <b>$victim</b>!");<br />close(DATA);
So um.. feel free to use it.. I realize that instead of using a ton of text files I could have used just one, but I find a folder much more organized and easier to access messages.
Also, you could just make the bot send one IM to the person, but this is more fun and it ensures that the person reads the message. Don't hesitate to give pointers!