I am pulling my hair out - newbie here:)
|
|
Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
|
10-31-2007 09:59
I am trying to write a script that I can insert say in a door in my house. When someone open the door by touch, various information about the person and object is sent to a database. I know the php and sql. However, I am having problems with the lsl. Here is what I have:
//Begin Script
default {
touch_start(integer total_number) { string name = llDetectedName(0); string object = llGetObjectDetails(0); string owner = llGetOwner(0); string sim = llGetRegionName(0); key http_request_id; http_request_id = llHTTPRequest( "http://www.xxxxxxxx.com/xxxx.php", [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], "name=" + name + "&object=" + "&owner=" + owner + "&sim=" + sim); }
}
//End Script
Many thanks in advance.
Everett
|
|
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
|
10-31-2007 11:33
Not sure what your trying to do. But your functions calls are all wrong. Check out the lsl wiki to make the proper calls. E.g llGetObjectDetails returns a list and not a string, and it takes two parameters (list llGetObjectDetails( key id, list params )); Unless you get this right you won't get anywhere.
|
|
Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
|
More details
10-31-2007 15:00
Basically, I am trying to get the owner of the object's name, the object's name, the person who touched the object and the sim they are in and send it to a sql database. I used getobjectdetails because in the wiki it said that gave you the item description, but I could also go for object name. I am still trying to rework it, but any help would be appreciated.
Many thanks
Everett
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
10-31-2007 16:48
There is no easy way to get the object owner's name. There's an llKey2Name function, but that won't work if the person is offline, and I don't know if it works if the person is in a different sim.
string name = llDetectedName(0);
-- This is correct.
string object = llGetObjectDetails(0);
-- This is not. Look at the Wiki, this function takes an object key, and a list where you specify what object details you want. It returns information about any object. It would be easier for you to use llGetObjectName, since that returns the name of the object in which the script is running.
string owner = llGetOwner(0);
-- llGetOwner does not take any arguments, and it returns a UUID, not a name. Again, look at the Wiki, it will tell you what arguments a function needs, and what information it returns. And as I said, there's no easy way to get from the owner's key to the owner's name. There are a few options using HTTP calls to off-world databases, search the forums, you should find those threads.
string sim = llGetRegionName(0);
-- Again, check the Wiki. This is almost right, the function does not take any parameters, but it will return the current sim name.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
10-31-2007 18:43
From: Everett Streeter Basically, I am trying to get the owner of the object's name, the object's name, the person who touched the object and the sim they are in and send it to a sql database. I used getobjectdetails because in the wiki it said that gave you the item description, but I could also go for object name. I am still trying to rework it, but any help would be appreciated.
Many thanks
Everett This is your script going into your object. Just look into the mirror to see who the owner is everytime someone touchs it  The same goes for the object name, it is always going to be what you named it to begin with. If you only have one house in one sim then sim name really isn't going to be very usefull either. So next question: Do you have houses in multiple sims and are you trying to find out if someone went in the front door or backdoor etc? If not then look in the wiki under llKey2Name to see how to get the name of the person that touched the door.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
|
Been reading the wiki a lot
11-01-2007 08:11
I have no problems sending the information of the avatar that touches the object to my sql database. For example, let's say I have several homes in several sims with doors, that why I need object info, so I know what object was touched. That part was easy for me. But when I use Getobjectdetails, which I finally got to work  It still gave me only information from the avatar that touched it, and not the object information itself. What I want to do is give each door a different name, say "front door" and "back door" - when either is opened, the avatar that touched it along with the name of the door would be sent - again, getting the avatar information is easy and works - its getting "front door" or "back door" to be sent along with that information that is proving difficult. I have searched for examples and been reading a lot about objects, maybe its because I am blond, but I just can't get it  Thanks,
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
11-01-2007 08:21
You seem to be sending in the key of the person who touched the door, not the key of the door itself. Try calling llGetObjectDetails with the object's key, not with the toucher's key.
Or, as I said in my previous post, try llGetObjectName instead. That will give you the object's name.
|
|
Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
|
Thank you ziggy  and everyone
11-01-2007 09:27
I thought I tried those last night and it didn't work, but everything works perfect now. Once I test it, I will post it. I guess I needed some sleep  Thanks again,
|