Need help creating a "base" module.

Back to Module Development

Page: 1  
From User Message Body
leon
Post #781
Member
Date: 12:16 pm, Aug 10 2008
Posts: 2


Im trying to make a bot that voices people in #chan
when it recives a private message with the text "join" and prints a small message to #chan.

I know some PHP and shouldnt have any problems once i have a working base to start from. And i have a mIRC Script version to better describe what i want it to do.

Code

on *:text:*:?:{

  if ($strip($1) == join) {
    if ($nick !isvoice #chan) { 
      mode #chan +v $nick
      msg #chan $nick has joined..
    }
  }
}


Don't know if it helps or not but figured ill post it anyways.

If someone could help me create the base module and base conf i would be very grateful.

Andreas Leon


efreak
Post #782
Member
Date: 2:49 am, Aug 11 2008
Posts: 15


So basically you want the following to happen?

1. person joins and doesnt get +v
2. person /msg botnick join
3. bot /mode #chan +v person
4. bot /msg #chan person has joined

This is what you want?

Also, "on" part (trigger) goes in the .conf file and the function itself goes in the .php file.

You can use the example below, or simply use the auto-op module thats available for download and change the .conf trigger to wait for a privmsg instead of a join. The example below will only work in the one channel (#CHANNEL), which you can change if you want.

modules/voicer/voicer.conf
Code
file voicer modules/voicer/voicer.conf
priv join true true true 0 voicer voicer


modules/voicer/voicer.php
Code
class voicer extends module
{
     $nick = irc::myStrToLower( $line[ 'fromNick' ] );
     $this->ircClass->changeMode([b]$CHANNEL[/b], "+", "v", $nick)
}


then add to function.conf
Code
include modules/voicer/voicer.conf


leon
Post #784
Member
Date: 9:30 am, Aug 11 2008
Posts: 2


Tyvm, i didnt know you could set the "where" in the .conf, you just helped me made sense of the autoop mod :), i should be able to take it from here. Thanks again!

   

Back to Module Development