NICK irc command?

Back to Module Development

Page: 1  
From User Message Body
subworx
Post #503
Member
Date: 10:37 pm, Apr 2 2007
Posts: 7


hi guys

i'm currently trying to improve my pizza timer to track nick changes.

the simple reason is, if i create a timer and change my nick, the highlighting won't work any more.
so on any nick changes in the channel i want the bot to check all pizza_* timers for the original nickname, so i can exchange it with the new one

but i don't know how to call this method...

inside the .conf, i tried playing around with various commands and used seen_mod as an example (join pizzatimer someFunction)
quit, kick, part, join, privmsg and notice all work as intended, but "nick" results in an undefinded type, and that's exactly what i need, since a nick change looks like this:
Code
SubWorx!xyz@xyz.net NICK :Sub|testen


how can i add this type/event myself, or might you guys be so kind to add it with the next version of php-irc ?

in the seen mod i didn't really find something about nick changes and with above type included, one could easily enhance it to really track users, a nice side effect ;)
because right now it looks like this:
Code
· Sub|blubb is now known as blubb
<SubWorx> !seen Sub|blubb
<Maedchen_fuer_Alles> SubWorx, I last saw Sub|blubb 24 min 42 sec ago quitting: Quit: Leaving.



thanks in advance for your help :)

greets
Sub

Manick
Post #504
user avatar
Admin
Date: 5:03 am, Apr 3 2007
Posts: 223


type nick module function


(do this above where you use nick...)

--Manick
PHP-IRC Developer
subworx
Post #505
Member
Date: 11:17 pm, Apr 3 2007
Posts: 7


hi Manick

first of all, thanks for your help so far.

i tried what you wrote (after finding the section in the readme, stupid me :/ )

my .conf looked like this first:

Code
file pizzatimer modules/pizzatimer/pizzatimer.php
type nick pizzatimer channelaction


which didn't really do anything at all
the bot got the lines stating "NICK: newName" but nothing happens

then i changed it to

Code
file pizzatimer modules/pizzatimer/pizzatimer.php
type nick pizzatimer channelaction
nick pizzatimer channelaction


now the bot crashes and burns :P

Code
(Bot@PhatNET) > :SubWorx!~xyz@xyz.net NICK :test
Notice: Undefined index:  function in /php-irc-2.2.1/parser.php on line 981
Notice: Undefined index:  module in /php-irc-2.2.1/parser.php on line 982
Notice: Undefined index:   in /php-irc-2.2.1/parser.php on line 982
Fatal error: Method name must be a string in /php-irc-2.2.1/parser.php on line 983


what did i do wrong, or what might be the cause of this crash?
(the method i'm calling right now:
Code
public function channelaction($line, $args)
{
  $this->dccClass->dccInform("function triggered using command ".$line['cmd']);
}

i hope it's correct. wanted to print everything to the dcc admin interface first, before flooding the channel with debug messages ;) )

thank you very much again

Sub

Manick
Post #506
user avatar
Admin
Date: 2:20 am, Apr 4 2007
Posts: 223


you need: "type nick module function"

do not change module or function, put that EXACT string in your file.

--Manick
PHP-IRC Developer
backdawn
Post #1074
Member
Date: 11:43 pm, Dec 19 2010
Posts: 4


can u make bot just 1 file ?

   

Back to Module Development