Jump to content

Read Chat messages from llOwnerSay


Tanatos Tantalus
 Share

You are about to reply to a thread that has been inactive for 2288 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi Community :)

I just started learning LSL and decided to write a script that reads the chat and analyses the messages sent by my fishing rod to automatically calculate some income statistics. But somehow I cant get the script to listen to those messages generated by the rod (spoken via "llOwnerSay" i guess).

Using this listener code doesn't trigger a listen event after a fishing attempt gets posted to the chat:

llListen(PUBLIC_CHANNEL, "", "uuid-of-my-fising-rod-here", "");

Am I doing something wrong here? Or is it even possible to listen to those messages?

Thank you for your answers :)

Link to comment
Share on other sites

If the fishing rod is using llOwnerSay() then no, you're not going to be able to intercept the messages by script in a listen event (or anything else).    The simulator passes the message direct to the object's owner, and no channels are involved, so there is nothing that could fire a listen event.

There's a couple of other issues with the fragment, too. 

First, PUBLIC_CHANNEL is 0, the public chat channel, which I hope the fishing rod isn't using.   

Second, objects' uuids change each time the object is rezzed, so filtering messages by UUID wouldn't work too well anyway, since you'd have to read, and then enter, a new UUID each time you re-rezzed the fishing rod.

For reference, if you want to filter for messages coming from  particular objects that belong to you, the way to do it is:

integer iObjectChannel = 12345;//or whatever channel the object uses, obviously
key kOwner;
string strObjectName = "Object name goes here";
default
{
	state_entry()
	{
		kOwner = llGetOwner();
		llListen(iObjectChannel,strObjectName,"","");
		//filter for messages on that channel from objects with the correct name
	}

	listen(integer channel, string name, key id, string message)
	{
		if(llGetOwnerKey(id) == kOwner){
			//if the uuid of the owner of whatever just sent a message is the same as the uuid of the owner of the object containing this script
			//then do stuff
		}
	}
}

But that wouldn't help you here.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2288 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...