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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.
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...