• Welcome to Valhalla Legends Archive.
 

Get Users from a Bnet channel with php

Started by privatewilly, January 30, 2004, 05:14 AM

Previous topic - Next topic

privatewilly

Hi!
The subject says it all.
Does someone know a ways to list the users that are actually present in a battle.net channel in php?

The Webbot here works as complete chat programm, but I only need the user list.

Any guesses?

thx,
Willy

j0k3r

#1
I believe there are multiple threads here that touch on the subject, maybe go look through them, tell us what you find, then write your own?
QuoteAnyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin
John Vo

privatewilly

I tried to search but didn't find anything.
But because you asked so nicely, and knowing now that there is something that can be found,
I will try again :)

Tuberload

#3
You are either going to have to interface the PHP script with a bot made in another programming language, or make a bot of sort out of PHP that will connect, logon, join the specified channel, and gather information.

I would go with the first suggestion, but either should work. Keep in mind the second solution assumes PHP supports sockets, and I don't know whether it does or not.

Edit: PHP does have socket support, so code on!
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

privatewilly

Doesn't anyone know if this has been done already?
"This" = only php-bot-sort-of-thing.

:)

j0k3r

Let me ask why does it have to be in PHP?
QuoteAnyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin
John Vo

privatewilly

#6
That way, I could easily display just who is present in a spezific channel.
I don't need the rest (chatting, pics, etc.).
I only want to do a script which asks "is someone online?", and the response will be "yes, 5" or "no".

And for the php-question: cause i can only access php. perhaps asp. but no bot on a server or such a thing.

You understand, I'm running a "Query-Server-Site-With-Php", so I'm just interested in that part.

And I thought "maybe someone has a solution for that".

ps: I'm aware that this post is a complete mess :)

Tuberload

Quote from: privatewilly on February 02, 2004, 08:22 AM
That way, I could easily display just who is present in a spezific channel.
I don't need the rest (chatting, pics, etc.).
I only want to do a script which asks "is someone online?", and the response will be "yes, 5" or "no".

And for the php-question: cause i can only access php. perhaps asp. but no bot on a server or such a thing.

You understand, I'm running a "Query-Server-Site-With-Php", so I'm just interested in that part.

And I thought "maybe someone has a solution for that".

ps: I'm aware that this post is a complete mess :)

Maybe you can't read, but I gave you two solutions to your little problem in a previous post...
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

privatewilly

yes, no problems with reading so far. Got even my screen turned on.
I thank you for your solutions. But I asked if someone already has a working solution in his sleeve, and I wanted to answer joker's question.


MyndFyre

One of the features I've wanted to implement in my bot that is somewhat held up while my computer is fixed is to do something like this.  Basically, I'm using the .NET Platform for the bot application and my website....  The website provides a web service that basically says "User_Joined(string screenName, string pid)" and "User_Left(string screenName)," and we keep the users list in state memory.  Whenever someone requests the page, it checks state memory to see if that user has been online.

That was my solution, although how you could move this to PHP, I'm not sure.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Kp

Quote from: privatewilly on February 02, 2004, 08:22 AM
I only want to do a script which asks "is someone online?", and the response will be "yes, 5" or "no".

If you only want to say whether someone is online, the task becomes much easier.  In such a case, your client merely needs to logon as 'anonymous' and issue a /whois, then parse the result.  Logging on as anonymous means you can use the chatgate, that you won't disturb the channel's users, and that you have a lot less material to parse.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

privatewilly

thx, for the hint.
"anonymous"logon already works.

blinkdude

my web channel is done in php.... use vb to connect if you dont know alot about packets and blah flags use CSB by  cuphead.... on the Userjoins Event use OCD or sqlvb6.dll to update who joins  and then send it to MySql.


Private Sub CSB_UserJoins(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, SimulatedEvent As Boolean)

txtsqlq.text = "Insert into `table name` where `ID` =" & Username & "and `ping` =" & ping & "and `icon` ="  & icon
call sqlinsert(txtsql.text)
End Sub

then when the lea i think its UserLeaves use


Private Sub CSB_UserLeaves(ByVal Username As String, ByVal Flags As Long, SimulatedEvent As Boolean)

txtsqlq.text = "Delete from `blah` where `ID` =" &  Username
call del(txtsql.text)
End Sub

for the calls you need the dll thats the way i use... just search on google for Vb To MySql and im sure youll find something just as ez ... heres a link to my web bot...  http://www.eternalsoldiers.net/esbot/chnnel.php and if you want to just use spht web bot you can and use this link for just users in channel.  http://www.valhallalegends.com/skywing/isapi/BinaryChatISAPI.dll?channellistex=accname
<Total-Assault@Azeroth> WTF IS THIS CLAN A BUNCH OF NERDS?
<Yoni[vL]@Azeroth> Yes.
<Grok> Yes.
<[vL]Kp> You sound surprised.
<Total-Assault> at least they admit it
&

Grok

"sqlvb6.dll"?  What is that, a bare-naked MSSQL ODBC?

If you're using VB6 for such a trivial application such as a bot, there's no excuse to not use ADO and ADOX.  If you're wanting more power than you can get with an Access database, you can install MSDE too.

blinkdude

#14
Yea but with that dll it will handle the queries 1 by 1 , in order not all at once  this is wat it says on the file i found came with .dll and module's text



' MySQL Module for Visual Basic written in Delphi
'
' Introduction: The dll this module links to is in fact a wrapper for libmySQL.dll,
' which, because of the complicated data structures would be harder to implement in VB.
' libmySQL.dll is part of the mySQL package and can be freely distributed as such.
<Total-Assault@Azeroth> WTF IS THIS CLAN A BUNCH OF NERDS?
<Yoni[vL]@Azeroth> Yes.
<Grok> Yes.
<[vL]Kp> You sound surprised.
<Total-Assault> at least they admit it
&