Jump to content
Tanatos Tantalus

Read Chat messages from llOwnerSay

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 :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

If you're talking about 7 Seas fishing rods. It does say some of the info on another hidden channel. But I can't remember if the Pro Rod comes with the instructions to us it, or if it's just with the area kit.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...