Jump to content

Low Contents IM Alert


CandiZazzles
 Share

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

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

Recommended Posts

I am in search of a script to alert the owner when their "contents" inside of a object starts to get low. For example if I rezzed 20 items inside a prim, I already have a Auto Rezzer script, but once it has rezzed out 15 items and there is only 5 left inside of the prim, I would like it to alert me via IM or in Local. Any help? :)

Link to comment
Share on other sites

When you write your script, just put a counter in it that reports llGetInventoryNumber(INVENTORY_OBJECT) every time the vendor gives out an object, or when it gets to your magic number of 5.  Have it send you that report by IM and you're all done.

Link to comment
Share on other sites

Have a script for that? I'm still a bit new to scripting and clueless how to..

 

This is the "Auto Rez" script im working with.. Just need to some how have IM alerts when it runs low or a remaining counter via alert.

 

key ItemKey;default{	on_rez(integer param) { llResetScript(); }	state_entry()	{		llSetTimerEvent(0.0); // Not needed until we have an item to watch	}	touch_end(integer num)	{		if (llDetectedKey(0) == llGetOwner()) // Owner touch to rez the first one		{			llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos() + <0.0, 0.0, 0.5>,					ZERO_VECTOR, ZERO_ROTATION, 42); // Never ask why 42. 		}	}	object_rez(key id)	{		ItemKey = id; // We just rezzed something...		llSetTimerEvent(5.0); // Start watching.	}	timer()	{		if (llList2Vector(llGetObjectDetails(ItemKey, [OBJECT_POS]), 0) == ZERO_VECTOR)		{			// Gone? Rez a new one!			llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos() + <0.0, 0.0, 0.5>,					ZERO_VECTOR, ZERO_ROTATION, 42); // Never ask why 42. 		}	}}

 

Link to comment
Share on other sites

Place it inside the object_rez event that is already in your script:

 

object_rez(key id){    ItemKey = id; // We just rezzed something    llSetTimerEvent(5.0); // Start watching    integer itemsRemaining = llGetInventoryNumber(INVENTORY_OBJECT);    if(itemsRemaining < 5)    {        llOwnerSay("Only " + (string)itemsRemaining + " left in object inventory.");    }}

 Of course, you can change it to " < 6 " if you want to know when there are only 5 left - I wrote it in the quote quickly.

This will be a private message that shows only in the owner's local chat screen (not exactly an IM, but still private).

Link to comment
Share on other sites

I'm afraid you have misunderstood the purpose of this forum.  If you are writing a script and need help with it, that's fine.  If you are looking for an existing script, though, you really should be posting in the Wanted forum.  If you want someone to write a script for you, you should post  in InWorld Employment for someone to hire.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3969 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...