Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Owner Key Name2Key  

Name2Key

Usage sample

Category: Owner Key
By : Takat Su
Created: 2011-10-16 Edited: 2011-10-16
Worlds: Second Life

the Zip file

Download all files for Name2Key
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Name2Key_1.lsl
Get file # 2. Name2Key_2.lsl
Get file # 3. Name2Key_3.lsl
Get file # 4. Name2Key_4.lsl
1 integer cmdName2Key = 19790;
2 integer cmdName2KeyResponse = 19791;
3
4 default {
6 llMessageLinked( LINK_SET, cmdName2Key, "Test Name", NULL_KEY );
7 }
8
9 link_message( integer inFromPrim, integer inCommand, string inKeyData, key inReturnedKey ) {
10 if( inCommand == cmdName2KeyResponse ) {
11 list lParts = llParseString2List( inKeyData, [":"], [] );
12 string lName = llList2String( lParts, 0 );
13 key lKey = (key)llList2String(lParts, 1 );
14 }
15 }
16 }

Name2Key

Google App Python Code - not needed unless you want to make your own app engine

Category: Owner Key
By : Takat Su
Created: 2011-10-16 Edited: 2011-10-16
Worlds: Second Life

1 rom google.appengine.ext import webapp
2 from google.appengine.ext.webapp.util import run_wsgi_app
3 import urllib, urlparse
4
5 kURL = 'http://vwrsearch.secondlife.com/client_search.php?session=00000000-0000-0000-0000-000000000000&q='
6 kProfile = "Resident profile"
7 kResult = "secondlife:///app/agent/"
8
9 class MainPage( webapp.RequestHandler ):
10 def get(self):
11 inName = self.request.get("name").upper()
12 name = inName.replace(" ", "%20")
13 data = urllib.urlopen(kURL + name).read()
14 start = data.index( kProfile )
15 foundName = data[start+18:start+18+len(inName)]
16 key = '00000000-0000-0000-0000-000000000000'
17 if foundName.upper() == inName:
18 start = data.index( kResult )
19 key = data[start+len(kResult):start+len(kResult)+36]
20 else:
21 foundName = inName
22
23 self.response.out.write("%s:%s" % (foundName, key))
24
25
26 application = webapp.WSGIApplication(
27 [('/', MainPage)],
28 debug = True)
29
30 def main():
31 run_wsgi_app(application)
32
33 if __name__ == "__main__":
34 main()

Name2Key

app.yaml file - not needed unless you want to make your own app engine

Category: Owner Key
By : Takat Su
Created: 2011-10-16 Edited: 2011-10-16
Worlds: Second Life

1 application: name2key
2 version: 1
3 runtime: python
4 api_version: 1
5
6 handlers:
7 - url: .*
8 script: name2key.py

Name2Key

Library

Category: Owner Key
By : Takat Su
Created: 2011-10-16 Edited: 2011-10-16
Worlds: Second Life

1 integer cmdName2Key = 19790;
2 integer cmdName2KeyResponse = 19791;
3
4 list gRequests;
5
6 key requestName2Key( string inName ) {
7 list lNameParts = llParseString2List( inName, [" "], [] );
8 string lFirstName = llList2String( lNameParts, 0 );
9 string lLastName = llList2String( lNameParts, 1 );
10 return llHTTPRequest( "http://name2key.appspot.com/?name=" + lFirstName + "%20" + lLastName, [], "" );
11 }
12
13 default {
14 link_message( integer inFromPrim, integer inCommand, string inName, key inKey ) {
15 if( inCommand == cmdName2Key )
16 gRequests += [requestName2Key( inName ), inKey ];
17 }
18
19 http_response(key inKey, integer inStatus, list inMetaData, string inBody ) {
20 integer lPosition = llListFindList( gRequests, [inKey]);
21 if( lPosition != -1 ) {
22 llMessageLinked( LINK_SET, cmdName2KeyResponse, inBody, llList2Key( gRequests, lPosition+1 ) );
23 gRequests = llDeleteSubList( gRequests, lPosition, lPosition + 1 );
24 }
25 }
26 }

Back to the Best Free Tools in Second Life and OpenSim.