|
hellow, bon, les greeters, c 'est pas ma tasse de thé, j' ai horreur qu'une machine me harcèle dès que j' arrive qlq part, mais voilà un truc de base à mettre ds un HUD....onoff sur clic et reset à la reco...
integer onoff; integer i; integer nombre; integer count;
list presents; list anciens; list salues;
key avat;
default { on_rez(integer i) { llResetScript(); } state_entry() { llOwnerSay("vidage des listes"); presents = []; anciens = []; salues = []; llSetTimerEvent(0.0); llSetText("OFF", <1.0, 0.0, 0.0>, 1.0); }
touch_start(integer total_number) { if(!onoff) { llSetTimerEvent(0.1); llSetText("ON", <0.0, 1.0, 0.0>, 1.0); count = 0; } else { llSetTimerEvent(0.0); llSetText("OFF", <1.0, 0.0, 0.0>, 1.0); } onoff =!onoff; } timer() { llSetTimerEvent(5.0); if(count == 0) { anciens = llGetAgentList(AGENT_LIST_REGION, []); count = 1; } else { presents = llGetAgentList(AGENT_LIST_REGION, []); nombre = llGetListLength (presents); i = 0; do { avat = llList2Key (presents, i); if (llListFindList (anciens, [avat]) == -1 && llListFindList (salues, [avat]) == -1) { llRegionSayTo(avat, 0,"Hello jeune Padawan"); salues += avat; } else if(llListFindList (anciens, [avat]) == -1 &&~llListFindList(salues, [avat])) { llRegionSayTo(avat, 0,"Ouèlecaume bec!"); } } while(i++<nombre); anciens = presents; } } }
sinon, mets toujours ton script.....
Mise à jour, j' avais pas lu de suite le resaluage des revenants....
Merci MenthalOH, je vais l'essayer.
Sinon voici celui que j'ai essayé d'apporter des modifications sans résultat (tjrs novice lol)
Edit:
mon changement se faisait au niveau des lignes :
if (~(vIdxLst = llListFindList( gLstAvs, (vLstChk = (list)llDetectedKey( --vIntSns )) ))){
gLstAvs = vLstChk + llDeleteSubList( gLstAvs, vIdxLst, vIdxLst ); //-- prevents spamming frequent visitors
gLstTms = vLstTmt + llDeleteSubList( gLstTms, vIdxLst, vIdxLst ); //--< **Timeout Culling Section**
où je mettais à la place un message de Welcom Back en changeant la cde
par une autre fonction qui ne devait absolument pas correspondre :/
/*//( v7-D Advanced Avatar Greeter v1.4.2 Annotated )//*/ /*//-- Notes: This script attempts (within the limits of LSL) To only greet avatars once per timeout period The timeout period start when they leave, and favors not re-greeting frequent visitors (perceived as spam) Remove Lines marked **Dynamic Memory Limitation Section** if you are sure of the max avs you want to store Remove Lines marked **Timeout Culling Section** if you want to greet the same avatar only once --//*/ /*//-- Core Variables --//*/ list gLstAvs; //-- List Of Avatars Keys Greeted list vLstChk; //-- List Of Single Av Key Checked During Sensor Processing integer vIdxLst; //-- Index Of Checked Item In List (reused) integer gIntMax = 500; //-- Maximum Number of Names To Store (ignored if Dynamic Memory used) /*//-- Next Line: **Dynamic Memory Limitation Section** --//*/ integer cINT_MEM = 1024; //-- Memory bytes to preserve for safety (Needs to be > ~768) /*//-- Start **Timeout Culling Section** --//*/ integer gIntTmt = 172800; //-- Number Of Seconds since last visit to store Av integer vIntNow; //-- Integer To Store Current Time During Sensor Processing list gLstTms; //-- List Of Most Recent Times Avs Were Greeted At list vLstTmt; //-- List To Store Calculated Timeout During Sensor Processing /*//-- End **Timeout Culling Section** --//*/ default{ state_entry(){ //-- Next Line: **Dynamic Memory Limitation Section** gIntMax = cINT_MEM; //--< **Dynamic Memory Limitation Section** llSensor( "", "", AGENT, 95.0, PI ); //-- Pre-Fire Sensor for immediate results llSetTimerEvent( 30.0 ); //-- How often (in seconds) to look for new people } timer(){ llSensor( "", "", AGENT, 95.0, PI ); //-- Look for avatars } sensor( integer vIntSns ){ //-- Get "now" and "timeout" once, saving timeout as a list for eas of use vLstTmt = (list)(gIntTmt + (vIntNow = llGetUnixTime())); //--< **Timeout Culling Section** do{ //-- Have we greeted these av's in our time frame? if (~(vIdxLst = llListFindList( gLstAvs, (vLstChk = (list)llDetectedKey( --vIntSns )) ))){ gLstAvs = vLstChk + llDeleteSubList( gLstAvs, vIdxLst, vIdxLst ); //-- prevents spamming frequent visitors gLstTms = vLstTmt + llDeleteSubList( gLstTms, vIdxLst, vIdxLst ); //--< **Timeout Culling Section** }else{ //-- New Av, greet and save llRegionSayTo( (string)vLstChk, 0, "Hello " + llDetectedName( vIntSns ) ); gLstAvs = llList2List( vLstChk + gLstAvs, 0, gIntMax ); gLstTms = llList2List( vLstTmt + gLstTms, 0, gIntMax ); //--< **Timeout Culling Section** } }while (vIntSns); /*//-- Start **Dynamic Memory Limitation Section** --//*/ if (cINT_MEM == gIntMax){ //-- check value to see if we need to do this, should happen 1 time only if (cINT_MEM > llGetFreeMemory()){ //-- are we running out of free space? gIntMax = ~([] != gLstAvs); //-- Limit list to current_length - 1 to prevent stack/heap collision } } /*//-- End **Dynamic Memory Limitation Section** --//*/ /*//-- Start **Timeout Culling Section** --//*/ if (vIdxLst = (gLstTms != [])){ if (vIntNow > llList2Integer( gLstTms, --vIdxLst )){ @Loop; //-- Find first index of avatars whose time since last greeting expired if (--vIdxLst){ //-- special loop structure to emulate short circuiting, while preserving vIndLst if (vIntNow < llList2Integer( gLstTms, vIdxLst )){ jump Loop; } } //-- Next 2 Lines: Remove Avs whose time has expired gLstAvs = llList2List( (gLstAvs = []) + gLstAvs, 0, vIdxLst ); gLstTms = llList2List( (gLstTms = []) + gLstTms, 0, vIdxLst ); } } /*//-- End **Timeout Culling Section** --//*/ } } /*//-- License Text --//*/ /*// Free to copy, use, modify, distribute, or sell, with attribution. //*/ /*// (C)2009 (CC-BY) [ http://creativecommons.org/licenses/by/3.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ /*// All usages must contain a plain text copy of the previous 2 lines. //*/ /*//-- --//*/ [php]
[/php]
Dernière modification par MateA ; 24/01/2022 à 15h25.
|