Nick registration before joining channels

Back to PHP-IRC Feature Requests

Page: 1  
From User Message Body
Agrv
Post #40
Member
Date: 11:44 am, Feb 8 2006
Posts: 8


Hi,

I would find useful a feature that block the JOIN until the bot's nick is registered, because my bot joins channels were it is op'ed or voice'd on joining, but only if it is registered, and registration takes a little time to be validated by the server, so I have to rejoin those servers manually.

Thanks for the great work on PHP-IRC !

Regards,
Agrv

Manick
Post #41
user avatar
Admin
Date: 1:57 am, Feb 9 2006
Posts: 223


One thing you could do is have a module with a timer, and have that timer run once, have it delay for about 60 seconds on the 'connect' string (which I believe is actually broken in 2.2.0... you'll have to get the new parser.php here: http://216.223.173.137/websvn/listing.php?repname=PHP-IRC&path=%2F&sc=0

Then, you could have the bot wait for however long, and then it would join the channel. I do this on one of my bots.

You would also have to remember to remove the timer on destroy() of the module and also on disconnect.

If you would like a more detailed setup of everything, let me know.

--Manick
PHP-IRC Developer
Agrv
Post #42
Member
Date: 8:20 am, Feb 9 2006
Posts: 8


Yes, it would be great if you give me some details.

What i have understood for now :
* i take the channels off from the bot.conf file
* i add them in a callback function launched by a timer after say 15 sec
* the timer is set up when the core catches the "connect" string

However i don't find how to know that the bot is connecting, and what you told about the broken parser.

Thanks for your time.

Manick
Post #44
user avatar
Admin
Date: 5:00 pm, Feb 9 2006
Posts: 223


Okay, well you need to download the new parser.php from that link. A direct link would be here:

Click

'connect' is a type you can use in your function.conf file. It's like 'priv' or 'privmsg', or other ones. So you do:

connect module function

...and when the bot connects to the server, and is fully connected, that function will be run.

--Manick
PHP-IRC Developer
Agrv
Post #46
Member
Date: 8:39 pm, Feb 9 2006
Posts: 8


Thanks, it's working perfectly.

Manick
Post #47
user avatar
Admin
Date: 8:55 pm, Feb 9 2006
Posts: 223


Awesome, just wanted to make sure though:

You use ircClass->maintainChannel() right? This is equilvilent to putting the channel in the bot.conf file.

--Manick
PHP-IRC Developer
Agrv
Post #48
Member
Date: 12:00 am, Feb 10 2006
Posts: 8


Yes, right.
I also use $this->ircClass->purgeMaintainList() on disconnect so he does not rejoin automatically before the timer expires after reconnecting.

Juice
Post #78
Member
Date: 6:35 pm, Feb 12 2006
Posts: 40


how do you make the bot send the info for server auth?

Have a Great Day!
Juice
Admin http://www.nonstophits.net

Have a Great Day!

Juice
Administrator
http://ww4.GameSoda.net
Manick
Post #80 - Reply to (#78) by Juice
user avatar
Admin
Date: 7:17 pm, Feb 12 2006
Posts: 223


You mean, right when the bot connects? That is handled in irc.php. The bot keeps status tags, like STATUS_CONNECTED, STATUS_CONNECTED_REGISTERED etc. When the socket class sends SOCK_CONNECTED to the irc class, the irc class changes status to STATUS_CONNECTED and sends the auth info. Then, if the network registers us, we go to STATUS_CONNECTED_REGISTERED, which is what we stay in while connected to the network.

I hope I haven't mis-interpreted your question, though.

--Manick
PHP-IRC Developer
Juice
Post #92
Member
Date: 9:57 pm, Feb 12 2006
Posts: 40


in the bot.conf file, I can change the nick of my bot and what server it joins. Is there something in there that i can type my auth info and have it send that to be auth'd by the server?

Have a Great Day!

Juice
Administrator
http://ww4.GameSoda.net
   

  Pages (2) [ 1 2 ] Next Page

Back to PHP-IRC Feature Requests