Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Script Check Section
- string allowed;
- string temp;
- integer DISCREET = TRUE;
- list GET_DETAILS = [OBJECT_SCRIPT_MEMORY, OBJECT_TOTAL_SCRIPT_COUNT, OBJECT_RUNNING_SCRIPT_COUNT];
- //check nearby avatar
- list recent_avatars;
- list results;
- integer SCRIPTS;
- add_avatar(string name) {
- if(!seen(name)) {
- recent_avatars += name;
- if (llGetListLength(recent_avatars) > 50)
- {
- recent_avatars = llDeleteSubList(recent_avatars,0,0);
- }
- }
- }
- integer seen(string name) {
- if(llListFindList(recent_avatars,[name]) > -1) { return TRUE; }
- return FALSE;
- }
- default
- {
- on_rez(integer start_param)
- {
- // Restarts the script every time the object is rezzed
- llResetScript();
- }
- state_entry()
- {
- allowed = llGetObjectDesc() ;
- llSetTimerEvent(604800);
- llSensorRepeat("", NULL_KEY, AGENT, 5, PI, 5);
- }
- sensor(integer total_number)
- {
- if(!seen(llDetectedName(0)))
- {
- results = llGetObjectDetails(llDetectedKey(0),GET_DETAILS);
- SCRIPTS = llList2Integer(results, 1);
- // llSay(0, (string)SCRIPTS);
- temp = "This is a Private Message to you. " +
- "You currently have " + (string)llList2Integer(results, 1) +
- " Total Scripts, of which " +
- (string)llList2Integer(results, 2) +
- " are running.";
- llInstantMessage(llDetectedKey(0), temp );
- {
- if ((integer)SCRIPTS >= (integer) allowed)
- llInstantMessage(llDetectedKey(0), "To help reduce lag in the SIM, please do what you can to reduce your total scripts. If you need assistance, ask a resident.");
- else if ((integer)SCRIPTS < (integer) allowed)
- llInstantMessage(llDetectedKey(0), "We thank you for being Script-Aware and helping keep the SIM lag-free!");
- add_avatar(llDetectedName(0));
- }
- }
- }
- timer()
- {
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement