Page 1 of 1
IRC bot class - help needed on getting the hostname
Posted: Sat Aug 26, 2006 7:14 pm
by Stijn Herreman
I'm writing an IRC bot class in PHP, and need some help to get a specific piece of information.
For the USER command, I need the hostname. mIRC gets this by itself, but I need to get it with PHP.
An example of a possible hostname is d54C38C01.access.telenet.be
Any help would be apreciated.
Posted: Sat Aug 26, 2006 8:01 pm
by feyd
I believe there's an IRC class on phpclasses.org.
Posted: Sun Aug 27, 2006 1:29 am
by timvw
Since your establishing a connection from the webserver you can (should) use the webserver hostname... $_SERVER['NAME'] or $_SERVER['ADDR'] will do just fine...
Posted: Sun Aug 27, 2006 12:50 pm
by Stijn Herreman
feyd wrote:I believe there's an IRC class on phpclasses.org.
I also found one on PEAR, but wanted to write my own
@timvw: I'll try your solution
Posted: Sun Aug 27, 2006 1:57 pm
by feyd
I wasn't suggesting using them, but looking at them for examples of what they are using.
Posted: Sun Aug 27, 2006 5:38 pm
by timvw
Stijn Herreman wrote:
@timvw: I'll try your solution
It all depends on the irc network you're trying to connect with.. A couple of them require that you have an identd running.. (kreynet doesn't require this.. but without and identd it just takes a lot longer to get connected...)
Posted: Sun Aug 27, 2006 5:40 pm
by daedalus__
You may want to head into some php channels on IRC and ask around, I've seen alot of great stuff in them including one bot that would process php code and output the results to the channel.
a-mazing.