These forums are CLOSED. Please visit the new forums HERE
Iming (or a similar result) an Object, is it possilbe? |
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-28-2005 22:09
If i want to give a command to an object, but i'm not near it, how would I go about doing it? (If possible)
|
Brian Mifflin
Scripting Addict
Join date: 15 Dec 2004
Posts: 182
|
04-28-2005 22:26
You can use llEmail to send an email to the object using it's key.....just remember the key changes when you rez it everytime.
http://secondlife.com/badgeo/wakka.php?wakka=email _____________________
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-28-2005 22:34
Hmmm....That would prove to be difficult if it changed everytime. This is basically a scripted pet...and I want to be able to talk to it fron long distances..
|
Brian Mifflin
Scripting Addict
Join date: 15 Dec 2004
Posts: 182
|
04-28-2005 22:37
You can use an external server to keep track of the key and use XMLRPC, or.....just wait for 1.7 is a few months which is supposed to have object <-> object communication :/
_____________________
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-28-2005 22:40
Ah...ok, great. Thanks!
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-29-2005 09:15
would there be a way to get the key on_rez, and somehow automatically IM the current key, without using an external server? For example, Using the GetKey Function to get the key, then sending that information with LLSay. My avatar would have an object attached that is listening for any UUID. Using that information, I could have the attached object send certain phrases ( to activate listen function on the pet), or anything it hears that starts with a certain word (is that possible), to my pet, using MessageLink. Am I totally off here?
|
Ushuaia Tokugawa
Nobody of Consequence
![]() Join date: 22 Mar 2005
Posts: 268
|
04-29-2005 09:40
would there be a way to get the key on_rez, and somehow automatically IM the current key, without using an external server? If you are rezzing the pet from another object (such as an attachment which rezzes the pet when cued by a chat command from the owner), the pet's key would be available to the rezzor through the object_rez event handler. |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
04-29-2005 09:42
object_rez will give you the key of the object that just rezzed. Alternately, you can use llGetKey in the on_rez event to get the key in the object itself.
If you're looking for item-to-item communication in one sim without using another server (such as internal email), try listeners. If, however, you need the two objects to communicate at long distance (between two or more sims), you're going to have to use email or XMLRPC. It's also been mentioned that we'll get object-to-object communication at some point. Random Link for Good Measure. _____________________
---
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-29-2005 09:46
Ah...Yes my pet is being rezzed from an attached object. So in theory, I could tell it to listen for me to say "Send Cancel" and it could LinkMessage my pet wherever it is (in the same sim), giving it the command to Die, given that I told the pet to listen to the object. in a ll Listen command? What I'm trying to do here is achieve the longest distance communication from me to my object. (longer then shout).
|
Ushuaia Tokugawa
Nobody of Consequence
![]() Join date: 22 Mar 2005
Posts: 268
|
04-29-2005 09:55
Ah...Yes my pet is being rezzed from an attached object. So in theory, I could tell it to listen for me to say "Send Cancel" and it could LinkMessage my pet wherever it is (in the same sim), giving it the command to Die, given that I told the pet to listen to the object. in a ll Listen command? What I'm trying to do here is achieve the longest distance communication from me to my object. (longer then shout). Get the key of the object from the rezzor using object_rez, then use llEmail to send the object messages over long distances. I don't know where the notion of link messages came from for this situation, but they are not viable as the attached rezzor and the pet will not be linked. |
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-29-2005 10:04
Ok...so something like this?
default { state_entry() { llListen( 0, "", NULL_KEY, "" ); } listen( integer channel, string name, key id, string message ) { if ( id == llGetOwner() ) { if (message == "Send Cancel" ![]() { llEmail(id, "Subject", "bye" ![]() } object_rez(key id) { llSay(0, "New Key Obtained" + (string)id); //giving both me and the object the key } Also, doesent llEmail lag the servers..I heard the Lindens don't like it if you use it a ton, or has this been fixed? |
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
04-29-2005 10:17
Also, doesent llEmail lag the servers..I heard the Lindens don't like it if you use it a ton, or has this been fixed? There is a built-in lag of 20 seconds for an email. This is a script-lag not a sim lag. The lag is there to stop spamming, so it's really a feature! /esc _____________________
http://slurl.com/secondlife/Together
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-29-2005 10:20
So I won't get blocked if I'm sending a lot of emails? (not that I plan to, just curious, I want this to be functional)
|
Ushuaia Tokugawa
Nobody of Consequence
![]() Join date: 22 Mar 2005
Posts: 268
|
04-29-2005 10:20
Ok...so something like this? Almost, you will need to store the pet's id in a global and the email address must be formatted properly: CODE
|
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
04-29-2005 10:20
Ok...so something like this? --- Unformatted Code --- This is quickly becoming a pet peeve of mine, so I'm going to start mentioning it in this thread. When you post code, please use the "code" or "php" tags. It makes our job a hell of a lot easier. ![]() So for starters, let's clean that up a bit: CODE default Much, much better. Now, to answer your question, you need to "store" the key you've obtained. You also need to add "@lsl.secondlife.com" to the end as a string. I'm going to store it as a key, to show you why you need this: CODE key the_key = ""; // Stores key we want Otherwise, remember to use llGetNextEmail at the receiving end to get the message. Edit: Corrected a minor formatting error with "Send Cancel," to allow you to say it in any combination of upper- and lowercase letters. Damn you Ushuaia for beating me to the punch. ![]() _____________________
---
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-29-2005 10:44
Odd...the script send the e-mail no matter what I say...What's going on?
And how do I use getnextemail? Do I my pet to contantly get nextemail? Use a timer ? |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
04-29-2005 12:01
Odd...the script send the e-mail no matter what I say...What's going on? Not sure. The code looks fine at my end. And how do I use getnextemail? Do I my pet to contantly get nextemail? Use a timer ? Yep. Timer the llGetNextEmail command. When it finds a new email, it'll call the email event. _____________________
---
|
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
|
04-29-2005 12:25
Ok...I got the timer set up. But it's still sendind no matter what I say AND the message isnt getting to the pet. =(
|
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
04-29-2005 12:33
Check the braces "{}" around the llEmail call, then. Your listen event will call every time you say something, unless you set it to something like this:
CODE llListen(0,"",llGetOwner(),"send cancel"); ... which should fix your more immediate problem. As for getting the key to the email event, check your code. Our examples should work fine so long as you place llGetNextEmail into the pet. _____________________
---
|
Ushuaia Tokugawa
Nobody of Consequence
![]() Join date: 22 Mar 2005
Posts: 268
|
04-29-2005 12:39
Ok...I got the timer set up. But it's still sendind no matter what I say AND the message isnt getting to the pet. =( If you're using Jeffrey's version, there is an extraneous semicolon on the end of this line: CODE
that you should remove in order for the message only to be sent when "send cancel" is chatted. |