Menu

Can I run every action handler matched?

Help
Wild Bill
2003-05-05
2003-06-22
  • Wild Bill

    Wild Bill - 2003-05-05

    I would like to make SmartIRC run every action that is matched by the message sent, such that if I have an action handler triggered by "^moo" and one by "^moocow", both are ran when somebody says "moocow". Is there any way I can do this?

    The reason I need this is because of a function I run every time something is said. It catches everything said so that I can make the bot spy on channels, copy things said, silence people (kickban them if they say something), etc. Currently, if a command is run, the function that catches everything is NOT run, so people can loop around the foul language catcher, the silencer, etc. by using a command.

     
    • Nobody/Anonymous

      Yes!
      And it's _very_ easy to fix it.
      Look in the function
      Net_SmartIRC::_handleactionhandler(&$ircdata)

      and comment the
      break;
      statement that breaks the loop when on the first match.
      The backside of doing this is that if you have alot of handlers it will take longer time 'til the loop is finished.

       
      • Mirco Bauer

        Mirco Bauer - 2003-06-22

        this will create a overhead, because all handlers are checked for every message, even if a message is already handled... in SmartIRC 0.6.0 I will make it nicer, the datapacket ($data) will have a flag handled which can be true or false, so then the bot autor can decide if the datapaket should get further processed or not...

         

Log in to post a comment.