Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: gorshing on March 17, 2003, 06:06 PM

Title: online command
Post by: gorshing on March 17, 2003, 06:06 PM
I would just like to get some of you guys opinion on how to implement an online command in VB.  This is also for a chat bot, I haven't yet made the step into the binary bot world :-/

First off if anybody knows of any site/thread/code that already discusses this, could you please post the link and my apologies for posting a stupid thread.  But I have searched and haven't yet found anything.

One of my thoughts is once the command is executed, to do a whois on all usernames in an array.  Then as the results are returned back, store those in an array also.  Once all the results are accounted for /msg the user.  But this seems very ineffeciant to me.

Another way would to do this about every 10-30 seconds, but again I don't like this way either.

I have a single threaded application and do not want to do a multi threaded application for this reason.

Does anybody else have any comments or other ideas?  BTW I am going to store the usernames in an access database for now, but that doesn't matter at this point ... I think.

Thanks again,
Title: Re: online command
Post by: Noodlez on March 17, 2003, 06:33 PM
exactly what are you trying to accomplish?
Title: Re: online command
Post by: Kp on March 18, 2003, 12:43 PM
There is another way to go about it, depending on how "dedicated" this application is going to be (and on how limited).  If you are willing to confine it to <= 25 users and a dedicated account, just friendlist all the people you want to watch and send "/f l" on a timer and parse the results. :p  If you want something more flexible, the idea you discussed would be better.  However, be aware that doing all those queries could take up a substantial portion of your flood queue.  Additionally, since battle.net uses the amazingly unhelpful "That user is not logged on." response when someone isn't online (I'd much prefer if it had the username), you'll have to do some heuristics to figure when you have all the results.  You could just count up number of responses, but that then presumes the user hasn't manually tried anything in the interim (which he/she very well might, if you're querying enough people not to be able to use the friendlist -- that'd be a lot of people and quite a bit of time).  Another potential problem, if you search on command, is that the user gets impatient waiting for the bot to perform its queries and leaves, thus wasting your work. :p

Your ideas are on the right track, but I suggest seriously thinking about whether an online list is worth the amount of effort you'll have to put into it to make it work well.
Title: Re: online command
Post by: Camel on March 18, 2003, 01:25 PM
eurijk! solved this long ago. have your bot log in 15 or 20 times, and have each one do a whois one one user. :)
Title: Re: online command
Post by: gorshing on March 18, 2003, 01:28 PM
Thanks for the replies

Kp, I never though of using the friends list, and this may be what I'll end up doing.

I do not believe that I'll end up with more than that.

Camel, I'll have to look into that also.

Thanks again,
gorshing
Title: Re: online command
Post by: Zakath on March 18, 2003, 02:46 PM
QuoteAdditionally, since battle.net uses the amazingly unhelpful "That user is not logged on." response when someone isn't online (I'd much prefer if it had the username), you'll have to do some heuristics to figure when you have all the results.

Woo! Kp, you used the word "heuristic" in normal speech. :P
Title: Re: online command
Post by: Grok on March 19, 2003, 01:47 AM
QuoteWoo! Kp, you used the word "heuristic" in normal speech. :P

That's the pragmatic choice.
Title: Re: online command
Post by: tA-Kane on March 19, 2003, 04:21 PM
Quoteeurijk! solved this long ago. have your bot log in 15 or 20 times, and have each one do a whois one one user. :)
Obviously, long ago, there was no friends list.

But, you could keep tabs on more than 25 people fairly efficiently this way; using multiple accounts' friends lists, and doing /f l on each everytime you do /online.

Of course, if you have quite a number of people to keep tabs with, it'll eat up your bandwidth fairly quick, especially if you're not on broadband or better.
Title: Re: online command
Post by: Arta on March 20, 2003, 03:55 AM
Perhaps I'm missing something, but the "That user is not logged on." problem doesn't seem like a problem at all to me...

If you have 10 users you want to check, do a /whois on them all, parse the "name is using product in ..." messages and mark the users they specify as being online. Mark everyone else as being offline. Problem solved?
Title: Re: online command
Post by: gorshing on March 20, 2003, 04:31 AM
Arta, that is the way I'm heading.  I just didn't know if anybody else had another trick up their sleave.

I googled for eurijk! but I couldn't find anything, and also nobody on this board by that name.

Thanks again for the replies
Title: Re: online command
Post by: Zakath on March 20, 2003, 08:44 AM
Eurijk! wrote zDsBot. His website can be found here (http://newds.zefga.net/), but I don't know if you'll find anything useful there.
Title: Re: online command
Post by: tA-Kane on March 20, 2003, 12:39 PM
QuoteEurijk! wrote zDsBot.
He also headed up Prolix.
http://prolix.sourceforge.net.