User Control Panel
Advertisements

HELP US, HELP YOU!

System Messages!

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Rameses
Senior Member
Senior Member


Joined: 02 Feb 2004
Posts: 182

Reputation: 31.1Reputation: 31.1Reputation: 31.1

PostPosted: Tue Feb 24, 2004 12:53 am    Post subject: Reply with quote

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! Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group