Author Topic: Help with inStr  (Read 1185 times)

If you're going to only allow your own chat messages anyway, just use the following procedure:

Code: [Select]
package foobar
{
    function NMH_Type::send( %this )
    {
        %value = %this.getValue();
        
        if ( %value $= "hi there" )
        {
            %value = "Hey. The message detection is working.";
        }
        
        %this.setValue( %value );
        parent::send( %this );
    }
};

activatePackage( "foobar" );

Execute this, start or join a game and type "hi there".
With this script, set %value to "" to block the message from being sent and set it to something else to send that instead.

If you're going to only allow your own chat messages anyway, just use the following procedure:

Code: [Select]
package foobar
{
    function NMH_Type::send( %this )
    {
        %value = %this.getValue();
        
        if ( %value $= "hi there" )
        {
            %value = "Hey. The message detection is working.";
        }
        
        %this.setValue( %value );
        parent::send( %this );
    }
};

activatePackage( "foobar" );

Execute this, start or join a game and type "hi there".
With this script, set %value to "" to block the message from being sent and set it to something else to send that instead.

Thank you for the input, I'll work with this for a while, but I'm trying to get that one I made to work, it's quite annoying now