// ===================================================================== // Web Link // skimi3d script library ยท https://grid.skimi3d.com/scripts/web-link // // Touch it and the visitor is offered a web page. The sign outside a // shop pointing at its catalogue, the poster with the event details, // the notice board linking to the rules. // // It is an OFFER, always. Nothing here can open anything on anybody's // screen without them agreeing to it first, and that is by design of // the platform rather than of this script. // // Plain LSL. // ===================================================================== // --------------------------------------------------------------------- // Settings // --------------------------------------------------------------------- // Where it points. It has to start with http:// or https://. string URL = "https://grid.skimi3d.com/"; // The line the visitor is asked. They see this next to Go and Cancel, // so it should say where they are being taken and why. string QUESTION = "Open the skimi3d grid site?"; // Floating words above it. Empty for none. string LABEL = "Touch to open our site"; vector LABEL_COLOUR = <1.0, 1.0, 1.0>; // Who may touch it. 0 = everyone, 1 = only the owner, 2 = same group. integer WHO_MAY_TOUCH = 0; // --------------------------------------------------------------------- // Everything below here is the machinery // --------------------------------------------------------------------- integer mayTouch(key who) { if (WHO_MAY_TOUCH == 1) return who == llGetOwner(); if (WHO_MAY_TOUCH == 2) return llSameGroup(who); return TRUE; } default { state_entry() { llSetText(LABEL, LABEL_COLOUR, 1.0); // Checked once, out loud, at the start. An address without its // http:// is quietly refused by the viewer, and from the // outside that looks exactly like a broken script. if (llSubStringIndex(URL, "http://") != 0 && llSubStringIndex(URL, "https://") != 0) { llOwnerSay("My URL does not begin with http:// or https://, so nothing will happen when anyone touches me."); } } touch_start(integer total) { key who = llDetectedKey(0); if (!mayTouch(who)) { llRegionSayTo(who, 0, "This one is not yours to open."); return; } // One at a time. Offering a page to five people at once is five // dialogs and a throttle, and the fifth person gets nothing. llLoadURL(who, QUESTION, URL); } on_rez(integer start) { llResetScript(); } }