Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Formatted Sensor Dialog script by Evil Fool
- // You may give this script away for free, but please leave creator information in.
- // Next owner MUST have script modify access if any of this code is used in part or whole
- //CONFIG
- integer gChann = -293190;
- integer gStride = 9;
- //END CONFIG
- list names;
- integer gPos = 0;
- key tReq; //Toucher's key
- dialog(key id)
- {
- integer nTop = gPos + gStride - 1;
- list buttons = llList2List(names, gPos, nTop);
- string msg = llDumpList2String(buttons, "\n");
- while(llGetListLength(buttons) % 3 != 0)
- {
- buttons = llListInsertList(buttons, [" "], gStride);
- }
- if (gPos >= gStride)
- {
- buttons += ["<<"];
- }else{
- buttons += [" "];
- }
- buttons += [" "];
- if (nTop - 1 < llGetListLength(names))
- {
- buttons += [">>"];
- }else{
- buttons += [" "];
- }
- llDialog(id, msg, buttons, gChann);
- }
- default
- {
- state_entry()
- {
- llListen(gChann, "", NULL_KEY, "");
- }
- touch_start(integer num_times)
- {
- if (llDetectedKey(0) == llGetOwner())
- {
- tReq = llDetectedKey(0);
- llOwnerSay("Scanning area...");
- llSensor("", NULL_KEY, AGENT, 25.0, PI); //Senses all agents in a sphere area
- }
- }
- sensor(integer num_detected) //When the sensor senses something
- {
- names = [];
- gPos = 0;
- integer i;
- for (i = 0; i < num_detected; i++)
- {
- names = names + llDetectedName(i);
- }
- dialog(tReq);
- }
- listen(integer channel, string name, key id, string msg)
- {
- if (msg == ">>")
- {
- gPos = gPos + gStride;
- dialog(id);
- }else if (msg == "<<")
- {
- gPos = gPos - gStride;
- dialog(id);
- }else if (msg == " ")
- {
- llOwnerSay("Sorry, this is just a filler!");
- }else{
- llOwnerSay(msg);
- }
- }
- } // END //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement