BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.3 support => Topic started by: Stelai on June 28, 2007, 09:58:42 am

Title: Notify, am I doing it right ?
Post by: Stelai on June 28, 2007, 09:58:42 am
Hey there. I'm on the roll of trying the latest dev release of Bebot, which so far works like a charm. Still, I've been working on a simple module, but some stuff wasn't going the way I hoped, so I had to "hack" a bit into the roster file, and I wonder if there's a "clean" way to do it.

So there it goes, basicly i give members of my (raid)bot the possibility to add players to a list, and receive notifies by tell when theses players log in and out.

I went through all the db and commands stuff. But when I add a buddy that isn't in the users table, it gets buddyremoved cause the said toon is not tagged as "notify" in the #___users table. So instead of buddying them in my module, I came to use $this->bot->user->add to add the toon in the user table with an "ANONYMOUS" access level. So far all goes okay.

But when the roster updates, it removes the buddy of the buddylist (on a criteria I don't really understand).

So that little hack I did that when my module adds an anonymous user, I set the source field as the name of my module, and in the roster update, I added a check source=="mymodulename" to the check that avoids the botadmin to get buddy removed. (By the way is there anything checking the source of a member at any point in the bot's execution? This all might cause a bug)

It works all like a charm, but i'm pretty sure I'm doing something wrong here, cause hacking the roster this way sure isn't intended. On the other hand, I'm not that keen on adding the said toons as users of the bot, cause they shouldn't be able to use commands, or to even know their log in/out are notified.

Is there an "intended" way to do such a thing with only tinkering inside my module ? I'm also curious on what do I have to do to have the "lastseen" field of the user table updated for theses ANONYMOUS guys.

Thanks by advance,
Stel.
Title: Re: Notify, am I doing it right ?
Post by: Temar on June 28, 2007, 12:09:23 pm
i had a problem with buddies and my bot too
http://bebot.link/index.php/topic,807.15.html (http://bebot.link/index.php/topic,807.15.html)
I downloaded the SVN version of Roster.php (http://svn.shadow-realm.org/index.py/BeBot/trunk/modules/Roster.php?view=log) and everything is workin fine now
Title: Re: Notify, am I doing it right ?
Post by: Stelai on June 28, 2007, 12:59:42 pm
I'll have a look into SVN's roster. Thanks for the hint :)
Title: Re: Notify, am I doing it right ?
Post by: Alreadythere on June 28, 2007, 04:58:51 pm
You can just use the !notify command to add those users, or copy the code out of the add_notify() function in the notify module.

The correct (as in only supported) way to add users to notify is to add them as anonymous users to the bot and then set the notify flag to 1.
Title: Re: Notify, am I doing it right ?
Post by: Stelai on June 28, 2007, 05:15:55 pm
You can just use the !notify command to add those users, or copy the code out of the add_notify() function in the notify module.

The correct (as in only supported) way to add users to notify is to add them as anonymous users to the bot and then set the notify flag to 1.

Aye that's what I did, cause for some reason I couldn't access to notify->add_notify() from outside the notify module. The issue was about roster wiping out the anonymous buddies when updating. I guess the SVN roster will fixitall.
Title: Re: Notify, am I doing it right ?
Post by: Alreadythere on June 28, 2007, 06:31:39 pm
The issue was about roster wiping out the anonymous buddies when updating. I guess the SVN roster will fixitall.
Yes, the SVN version syncs buddy list and characters on notify.
Title: Re: Notify, am I doing it right ?
Post by: Ebag333 on June 29, 2007, 05:56:57 pm
The issue was about roster wiping out the anonymous buddies when updating. I guess the SVN roster will fixitall.
Yes, the SVN version syncs buddy list and characters on notify.

I'm not so sure about that, Alreadythere.  Not to air our dirty laundry, but I have two "members only" bots that are using the raid part of the roster module, and both are wiping the member list periodically.

Seems to be random too, no rhyme or reason (will go a few days, then all of a sudden...pffft!).
Title: Re: Notify, am I doing it right ?
Post by: Alreadythere on June 29, 2007, 06:04:14 pm
Could you check your logs please? Is it happening during the roster update or the buddy list cleanup?
Title: Re: Notify, am I doing it right ?
Post by: Temar on June 29, 2007, 06:41:09 pm
i got the roster thing when i was having a prob
now it works fine
some of you might know my bot
battle150
SimplePortal 2.3.7 © 2008-2024, SimplePortal