mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
40 lines
769 B
Plaintext
40 lines
769 B
Plaintext
|
|
trigger OnAttach()
|
|
{
|
|
debugSpeakMsg( self, "attached" );
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnSpeaking( string text )
|
|
{
|
|
if ( text.equals( "go" ))
|
|
{
|
|
obj_id lookAt = getLookAtTarget( self );
|
|
if ( lookAt == null )
|
|
return SCRIPT_CONTINUE;
|
|
listenToMessage( lookAt, "handleBroadcast" );
|
|
debugSpeakMsg( self, "subscribed" );
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnHearSpeech( obj_id speaker, string text )
|
|
{
|
|
dictionary stuff = new dictionary();
|
|
stuff.put( "objid", self );
|
|
if ( text.equals( "send" ) )
|
|
{
|
|
broadcastMessage( "handleBroadcast", stuff );
|
|
debugSpeakMsg( self, "broadcast" );
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleBroadcast()
|
|
{
|
|
debugSpeakMsg( self, "received from " + params.getObjId( "objid" ));
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|