Daktyl198 Posted June 6, 2013 Share Posted June 6, 2013 I'd like to start off by saying that I'm pretty much a newbie when it comes to PHP. I've had more experience in it than any other scripting/programming languages though, so I wish to use it for my needs. I've been googling away for the past two weeks or so trying to find a basic PHP IRC bot script that can connect to an IRC server, pass a ping/pong, and join more than one channel. I'd also like the functions to be modular (in a ./commands folder or something). But even with all that googling I don't know what to do. I've only come across older scripts that don't mention PING at all (not to mention that none of them can seem to agree on how to actually connect to the server [sockets_connect vs fsocketopen] and how to do things after [fswrite vs fsputs]) So I come asking for help with a very, very basic script that will pass a PING/PONG, be able to join more than one channel, and that can load !trigger or .trigger functions from single-file .php modules in a subfolder. Even if I somehow figure out to connect and join channels, the "read each line in the channel and load modular triggers and functions" part is probably way out of my league Quote Link to comment https://forums.phpfreaks.com/topic/278827-basic-php-irc-bot/ Share on other sites More sharing options...
trq Posted June 6, 2013 Share Posted June 6, 2013 So... where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/278827-basic-php-irc-bot/#findComment-1434389 Share on other sites More sharing options...
Daktyl198 Posted June 7, 2013 Author Share Posted June 7, 2013 Which function should I use to connect to the server [sockets_connect vs fsocketopen], which function I should use after to send data to the server [fswrite vs fsputs], and how to pass a PING/PONG test. Those three pieces of info should send me on my way Quote Link to comment https://forums.phpfreaks.com/topic/278827-basic-php-irc-bot/#findComment-1434642 Share on other sites More sharing options...
kicken Posted June 7, 2013 Share Posted June 7, 2013 stream_socket_client to connect fwrite or fputs to send data, either is fine fread or fgets to receive data, either is fine Read about the IRC protocol in order to actually talk to the IRC server and process data. Quote Link to comment https://forums.phpfreaks.com/topic/278827-basic-php-irc-bot/#findComment-1434722 Share on other sites More sharing options...
Daktyl198 Posted June 8, 2013 Author Share Posted June 8, 2013 Perfect! I'm pretty sure I can figure out how to make it modular myself Thanks for clearing up which functions to use~ Quote Link to comment https://forums.phpfreaks.com/topic/278827-basic-php-irc-bot/#findComment-1434841 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.