Jump to content

WANTED: Auto NoteCard Giver Script (asap plz)


DjWhiteBoi
 Share

You are about to reply to a thread that has been inactive for 3834 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I need a script that automatically gives out a notecard to ALL avatars in range each time they visit the sim.   I know this is possible because I have seen it at many sims but I can't seem to find it anywhere.   

 

I don't want the script to keep spamming them with a notecard tho.  Only a one time thing. Unless they leave and come back.

 

Or if it would be better..   just have it keep a list of avatars that it has offered the notecard to and make it so it doesn't ever offer it to them again weather they leave and come back or not.    But also have it so I can reset that list so after x amount of time I can just reset list and it will start giving it out to those people again (good for keeping updated contests/rules etc)

 

Plz just IM me in world as its so much easier and faster to get back to you.    Even if I am not online I will get your IM in just a few minutes on my phone.

 

Thanks :)

Link to comment
Share on other sites

Ok I found one that does just about exactly what I want it to do.  But I can't seem to get it working if anyone could take a look at this for me plz:

 

//********** VIRGIX NOTECARD, TEXTURE 6 LANDMARK  AUTOMATIC GIVER *******************// By Virgix Bing - free to use!//Yet another script who gives everyone a notecard, a texture and a LM... or any combination of the three!//So, what is new? Basically, three things://  1) Key of the avies...//          this can be really useful to send automatic messages to your visitors;//  2) Auto-reset://           never go out-of-memory!//  3) Mail reports://           you get automatic mail reports, see example below.//  4) Fully notecard configurable://           set up once and forget it!//  5) you can choose the number of the items to give://           if you want to give three things, or only one, or a combination of the three...//          simply put only a textute, name it as you like, and the script will give out only a texture!//  6) the usual help... simply say "#help" in chat (without quotes).////Mail report example:// Subject: Visitor list - update!// From: Virgix Notecard giver <dbcfd3dc-878e-c9aa-88c0-76449215d8ef@lsl.secondlife.com>  to virgix//Object-Name: Virgix Notecard giver//Region: Epilais (255232, 263424)//Local-Position: (82, 180, 265)//Visitor List://Alex Astino , 96a51525-c63b-4471-8446-720d762ff742//Man Oxe , 4b352511-85bd-4320-8a26-d968a20bad86//Gillo Rax , e6252525-e702-46fc-8c8f-6d84fb09986e//Total = 3//* End of listing *//No need to configure from here: the script reads//the configuration from a notecard called "configuration"//see below for details://#  This is the configuration file//# The name of the notecard you will give//notecard=MyNotecard//#  Range form the object in which it will give the notecard.//range=50//#  Email to send listings//email_address=virgix@virgilio.org//#  Rate in seconds of scan for people to give notecard too. Should increase with range.//# NOTE: the lower it is the more laggy it is so think before you put it on 0.1.//rate=5//# Name of the object//name=Virgix Notecard giver//#hovertext is the text over the object: if set to  "N" (without quotes) no text will showed//hovertext=Automatic notecard giver//# end of the configuration filestring notecard_name = "configuration";  // name of notecard goes here// internalsinteger DEBUG = FALSE; // TRUE;integer line;key queryhandle;                   // to separate Dataserver requestskey notecarduuid;list given_to;list given_to_name;integer max_length  = 20; // Maximum length the list can reach before resetinginteger current_number = 0;// Config data loaded from notecard, with some sane defaultsstring notecard = "MyNotecard"; // The notecard to give (must be in objects inventory)string email_address = "unknown@noserver.urk";float range = 50; // Range form the object in which it will give the notecard.float rate = 5; // Rate in seconds of scan for people to give notecard too. Should increase with range.// NOTE: the lower it is the more laggy it is so think before you put it on 0.1.string name = "Notecard giver";string hovertext = "Notecard giver beta";// is name on admitted list?integer check_given_list (string name){	if ( llListFindList(given_to_name, [name]) >= 0 )	{		return TRUE;	} else{	return FALSE;}}Reset_List(){	string body = "Visitor List:";	integer len = llGetListLength( given_to_name );	integer i;	for( i = 0; i < len; i++ )	{		body = body + "\n" + (llList2String(given_to_name, i) + " , " +  llList2String(given_to, i));	}	body = body + "\n" + ("Total = " + (string)len );	body = body + "\n" + ("* End of listing *");	llEmail( email_address, "Visitor list - update!" ,body);	given_to = [];	given_to_name = [];	llOwnerSay("Reset done!");}init(){	queryhandle = llGetNotecardLine(notecard_name, line = 0);// request line	notecarduuid = llGetInventoryKey(notecard_name);}default{	state_entry()	{		llSetText( "INITIALIZING:\n please wait...", <1.0,0.0,0.0>, 1.0 );		init();	}	dataserver(key query_id, string data)	{		if (query_id == queryhandle)		{			if (data != EOF)			{   // not at the end of the notecard				// yay!  Parsing time				// pesky whitespace				data = llStringTrim(data, STRING_TRIM_HEAD);				// is it a comment?				if (llGetSubString (data, 0, 0) != "#")				{					integer s = llSubStringIndex(data, "=");					if(~s)//does it have an "=" in it?					{						string token = llToLower(llStringTrim(llDeleteSubString(data, s, -1), STRING_TRIM));						data = llStringTrim(llDeleteSubString(data, 0, s), STRING_TRIM);						//Insert your token parsers here.						if (token == "email_address")							email_address = data;						else if (token == "rate")							rate = (integer)data;						else if (token == "range")							range = (integer)data;						else if (token == "name")							name = (string)data;						else if (token == "hovertext")							hovertext = (string)data;						else if (token == "notecard")							notecard = (string)data;					}				}				queryhandle = llGetNotecardLine(notecard_name, ++line);				if(DEBUG) llOwnerSay("Notecard Data&colon; " + data);			}			else			{				if(DEBUG) llOwnerSay("Done Reading Notecard");				llOwnerSay("-- Configuration as read from " + notecard_name + "--");				llOwnerSay("Email set to " + (string)email_address);				llOwnerSay("rate set to:  " + (string)rate);				llOwnerSay("name of the object set to: " + (string)name);				llOwnerSay("range of object set to: " + (string)range);				llOwnerSay("Text over object set to: " + (string)hovertext);				llOwnerSay("Name of notecard set to: " + (string)notecard);				llOwnerSay("-- End of configuration of " + (string)name + "--");				llOwnerSay("** to change configuration edit the object and change + " + notecard_name + "**");				if (hovertext == "N")				{					llSetText( "", <0,0,0>, 0.0 );				}				else				{					llSetText( hovertext, <0.0,1.0,1.0>, 1.0 );				}				llSetObjectName(name);				llSetObjectDesc("Supplied by Virgix Bing");				llSensorRepeat("", "", AGENT , range, PI,rate);				llListen(0, "", llGetOwner(), "");				llSay(0, "Activated.");			}		}	}	sensor(integer num_detected)	{		integer i;		integer group_members = 0;		for (i = 0; i != num_detected; i++)		{			//annoto i visitatori			if( llDetectedKey( i ) != llGetOwner() )			{				string detected_name = llDetectedName( i );				if( check_given_list( detected_name ) == FALSE )				{					given_to_name += detected_name;					given_to += (string)llDetectedKey( i );					//check if list is too big					if (llGetListLength(given_to) > max_length) Reset_List();					//Give al...					if (llGetInventoryType(notecard) != INVENTORY_NONE ) llGiveInventory(llDetectedKey(i),notecard);					if (llGetInventoryType(llGetInventoryName(INVENTORY_TEXTURE, 0)) != INVENTORY_NONE ) llGiveInventory(llDetectedKey(i),llGetInventoryName(INVENTORY_TEXTURE, 0));					if (llGetInventoryType(llGetInventoryName(INVENTORY_LANDMARK, 0)) != INVENTORY_NONE ) llGiveInventory(llDetectedKey(i),llGetInventoryName(INVENTORY_LANDMARK, 0));					llSay(0, "You welcome, " + detected_name);					if(DEBUG) llOwnerSay("Materials given to: " + detected_name);				}			}		}	}	// since it uses notecards, change values when inventory changes	changed(integer change)	{		// We want to reload channel notecard if it changed		if (change & CHANGED_INVENTORY)			if(notecarduuid != llGetInventoryKey(notecard_name))				init();	}	listen(integer channel, string name, key id, string message)	{		if(message == "#help")		{			llOwnerSay("Here are a list of commands:");			llOwnerSay("#help  - this message");			llOwnerSay("#reset - reset list");			llOwnerSay("#list  - says the names of the avatars");		}		else if(message == "#reset")		{			Reset_List();		}		else			if( message == "#list" )			{				llOwnerSay("Visitor List:" );				integer len = llGetListLength( given_to_name );				integer i;				for( i = 0; i < len; i++ )				{					llOwnerSay(llList2String(given_to_name, i) + " , " +  llList2String(given_to, i));				}				llOwnerSay("Total = " + (string)len );				llOwnerSay("* End of listing *");			}	}}

 

 

I need to make a ''configuration'' note card with this script.  I did that.  I changed the settings on the configuration notecard but those changes are not taking effect.  They are keeping the default settings and will not update to the settings I changed.  I have reset script and everything.


Any help would be great. Thanks .

Link to comment
Share on other sites

Yea it sounds simple but that is a lot of lines for sure.

 

I finally have it working. But the range seems a little low..     I was just playing around with it and set it to 500 range just to see how far it would reach and it doesn't reach that far.  The max range on it is between 95-100.

 

Anyway to increase max range over 100? Would help on a big sim.

Link to comment
Share on other sites

Your range is in meters, and by looking at things closer, your script uses a sensor(best way to do what you want it to do) however, to reduce lag, Linden Labs has defined that sensors can only sense up to 96 meters. There's a way of increasing the range with another script but sadly it's beyond my scope of a scripter.

Link to comment
Share on other sites

integer max_length  = 20; // Maximum length the list can reach before reseting

Change that line ^^

Don't get too greedy and test it well, otherwise it'll try to remember too many people, run out of memory and crash before clearing itself.  Presumably there's a reason the author set it at 20.  I haven't read through the whole script in detail, having concentrated on the notecard-reading so far, since that was your problem.  Older scripts faced a memory limit of 16k so couldn't store much.  Newer (mono) operation allows up to 64k so, keeping it simple, you may well be able to store 4 times as much (80 people), but there's no guarantee!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3834 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...