BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => 0.3.x Custom/Unofficial Modules => Topic started by: Blueeagle on March 04, 2007, 03:39:39 pm
-
I've been working on a bot mail system that allows members and guests to send offline messages to eachother. This is a huge improvement over offline tells.
Features:
- All registered alts of a player has got access to the same mailbox.
- Configurable with the new settings module to allow different levels of access to send and read mail. (IE it can be restricted so only leaders/admins may send mail and everyone may read mail sendt or only leaders can read mail but everyone can send mail to them or all but guests can send/recieve and so on)
- Configurable expiration time of read and unread mail
- Conigurable (global) notificaton of unread mail when a player logs on any of his alts
To do: (ignore the to-do list in the Mail.php file.
- Cron jobs got lost in a brainfart. Needs to be re-implemented.
- Colors of message windows needs to be ported to the new Colors module
- Implement a mass messaging feature so that leaders (configurable ofcourse) can send messages to everyone of a certain access level. (Not sure how this should be done. Ideas are welcome)
- For those running a webserver on the same machine as the bot it would be possible to implement a web-based send mail interface that iterfaces directly with the database. Not sure how to best make such an interface to be implementable by various boards used by guilds tho.
- Testing, testing and more testing
Please give feedback.
Attatchment: modules/Mail.php
Edit: Added more stuff to the TO-DO list
-
Nice idea!
For more info on colors check the wiki (http://bebot.link/wiki/doku.php?id=colors)
-
Nice idea!
For more info on colors check the wiki (http://bebot.link/wiki/doku.php?id=colors)
Yeah, I saw that. I had it all set up but I lost it when I was updating the svn tree. :p
-
Thats a really good idea, mind if I help out?
-
Always thought about doing this, but never got off my fat ass.
Good job.
-
Well.. here goes my check of the script...
Line 186: $mailbox=$this->bot->alts->main($user);
Line 187: $no_of_messages=$this->new_mail_count($name);
I assume it's supposed to use main for mail, but it still checks mail for $name instead of $mailbox.
Maybe make the logon notify a user setting instead of a script setting? Since some people might want to be notified and others doesn't.
For when you add cron, maybe go over buddylist and see if anyone has any unread mail still?
You should remove all commented things that isn't yours (like all the stuff from the template you don't use).
-
Thats a really good idea, mind if I help out?
Thank you and no, go right a head. :)
Edit: Khalem talked something about setting up a dev branch. Now I don't know how to do that but it might be a good idea if several people are to be working on this.
-
Well.. here goes my check of the script...
Line 186: $mailbox=$this->bot->alts->main($user);
Line 187: $no_of_messages=$this->new_mail_count($name);
I assume it's supposed to use main for mail, but it still checks mail for $name instead of $mailbox.
Maybe make the logon notify a user setting instead of a script setting? Since some people might want to be notified and others doesn't.
For when you add cron, maybe go over buddylist and see if anyone has any unread mail still?
You should remove all commented things that isn't yours (like all the stuff from the template you don't use).
Yeah I think I missed some notifies. This probably explains it. Thank you.
-
Some errors I caught:
- in mail_send() you have checks to escape the string and replace some stuff. It's working on $mail_message instead of $message though, or the variable in the INSERT should be $mail_message.
- if($settings['Logon_notificaton']=TRUE) in buddy() will always be true ;)
- if(msg===1) in buddy() got one = too many
- I've had to adapt the settings names to the ucfirst(strtolower()) format now used in SVN (I guess you posted the module before I made the change in SVN).
As I don't like spam right on logon I've added a slight delay to the notifies. And I've added default access levels for the commands.
Here (http://www.m8y.de/ao/bebot/Mail.phps) is my modified version with the fixes/adds.
PS: forgot to add: if you aren't allowed to send mail it just returns an empty tell. Missing some return value there.
-
Good job mate!
Just to find something to pick on:
- if(msg===1) in buddy() got one = too many
= assings
== checks for equality
=== checks for identicality
if (1 == "1") is true while
if (1 === "1") is false because 1 is an integer while "1" is a string
A moot point since the variable type is irellevant in this case. :)
-
hehe, you said assings ;D
(sorry, had to do it)
-
= assings
== checks for equality
=== checks for identicality
if (1 == "1") is true while
if (1 === "1") is false because 1 is an integer while "1" is a string
A moot point since the variable type is irellevant in this case. :)
Didn't know that yet, nice to learn that.
-
hehe, you said assings ;D
(sorry, had to do it)
Aw poo! ;)
-
Why did you add the make_item_blob() function btw? Not sure what's it supposed to archieve, and it's crashing my AORC :P
-
Because itemrefs sendt trough make_blob were rendered useless.
-
Replace " with ' in the itemref before posting it in the blob, works for me all the time with the standard make_blob() function.
-
For some reason I cant send mails... it give me the empty tell. and I understand that is because of missing permissions? well I have tryed all the access lvls, but it's the same.
-
1 thing im after not sure if u got
is mailbot for ALL admin or leader etc
was thinking maybe were owner can see all msg for leader/admin/superamin/owner
but like admin only see leader/admin
these msgs being sent are not specifit for any 1 just AN admin
i was thinking of making somit along the line but look like it would be better as part of ur module
-
oh and also i run SVN
Fatal error: Call to a member function on a non-object in /home/Bots/Testbot/modules/Mail.php on line 109
-
It doesn't do what you want, it's just a kind of offline message system between users.
Though I don't see any possible error in line 109 - did you download the file version in my post here (http://bebot.link/index.php/topic,697.msg5467.html#msg5467)?
-
yes i downloaded it from this topic on 1st post
-
how can you not see this Problem?
Because I'm talking about the version I posted, which is this one here (http://www.m8y.de/ao/bebot/Mail.phps).
It is already up-to-date for 0.3.5 or current SVN.
Basically it's a slightly modified version of the one Blueeagle posted first.
-
Oh yer sorry
-
I am having a proble with the following line
$query="INSERT INTO #___mail_message (mailbox, recipient, sender, message, expires) VALUES('$mailbox', '$recipient', '$sender', '$message', 'FROM_UNIXTIME($expires)')";
Line 264
it will not accept
FROM_UNIXTIME($expires)'
for somereason it keeps with the whole thing.. and the time is in the ()'s
rsbot [2007-11-24 00:57:44] [TELL] [INC] Nytridra: !mail send nytridr tes
ties
MySQL error (# 0) on query: INSERT INTO rsbot_mail_message (mailbox, re
cipient, sender, message, expires) VALUES('Metanyt', 'Nytrid
r', 'Nytridra', 'testies', 'FROM_UNIXTIME(1211587064)')
Incorrect datetime value: 'FROM_UNIXTIME(1211587064)' for column 'expires' at ro
w 1
rsbot [2007-11-24 00:57:44] [TELL] [OUT] -> Nytridra: Message sent to Nyt
ridr (Metanyt).
this use to work.. so IDK what changed..