User:ELQ Homewood
Revision as of 03:54, 1 November 2009 by ELQ Homewood (talk | contribs)
I'm ELQ Homewood from North Carolina, USA. I'm a scripter specializing in in-world club items,
professional tools and club/business systems.
I speak English and script in LSL. I'm a web developer and application programmer with a focus on
desktop-web-vw integration. My in-world store is at [1].
Simple HTTP-In from your Desktop!
Here's a tutorial that will help show how a simple html form can be used, straight from the desktop, to communicate with your LSL scripts ;o)
- First, you'll need a prim.
- In this prim use this script - alter it how you want, it's pretty simple and it's mostly the script for http-in we've all seen a hundred times.
key requestURL; default { touch_start(integer num_detected) { requestURL = llRequestURL(); // Request that an URL be assigned to me. } http_request(key id, string method, string body) { if ((method == URL_REQUEST_GRANTED) && (id == requestURL)) { // An URL has been assigned to me. llOwnerSay(body); llOwnerSay("Copy and paste the above url into your html form action."); } else if ((method == URL_REQUEST_DENIED) && (id == requestURL)) { // I could not obtain a URL llOwnerSay("ERROR: " + body); requestURL = NULL_KEY; } else if (method == "POST") { llOwnerSay(body); llHTTPResponse(id,200,"Baddabean!"); } else { // An incoming message has come in using a method that has not been anticipated. llHTTPResponse(id,405,"Unsupported Method"); } } //use this if you have a way to update the prim url, such as an offworld file or db //changed(integer change) { //if(change & CHANGED_REGION_START) llResetScript(); //} }
<html><head><title>Testing 1-2-3</title></head> <body> <form name="frmTest" method="POST" action=""> Ask this inworld: <input type="text" size="40" name="question" value="What bean won't give you gas?" /><br /> <input type="submit" value="Ask"></form> </body> </html>