Jump to content

Need help with saving PERMISSION_DEBIT so it doesn't ask for it everytime content in object changes


Nora Lapis
 Share

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

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

Recommended Posts

Hi,

Am an amater sripter, doing it for fun to kill time, well, i got stuck...

I managed to fix one script so I like it (details freak), but I got stuck with the PERMISSION_DEBIT.

Its an auction script, has a config card for the floating text and min bids and such, but since it won't be used by only one person i can't always be there to allow debit.

I know there is a way to make it stop asking for debit everytime by saving it somewhere and reseting the one script that is needed to run the auction but I don't know how, my only idea failed :/ .

Anyone out there who knows?

 

 

Link to comment
Share on other sites

PERMISSION_DEBIT is the one permission setting that you always want to be very careful with.  If you set your script up wrong, and other people can get into it, you can easily lose all the L$ in your account.  The smartest way to write a vendor script is to require llRequestPermissions every time that the script is restarted or the object is rezzed.  That way, you will always be aware when someone has tried to reset things.  I almost always also include a changed event with if (change & CHANGED_OWNER){llResetScript();}.  You can't be too careful.

Now, if your script is written so that it also resets when you add or remove anything from inventory, that will automatically force a llRequestPermissions.  There's no good way to avoid that except to rewrite the changed event so that it doesn't reset the script.  Or perhaps so that it only resets the script if you add something to inventory but not if you remove something. Like this ....

changed (integer change){    if (change & CHANGED_INVENTORY)    {        integer InventoryCount = llGetInventoryNumber(INVENTORY_ALL) ;        if ( InventoryCount > gOldInventoryCount)        {            llResetScript();        }        gOldInventoryCount = InventoryCount;    }}

Be sure to make gOldInventoryCount a global integer variable.  With this modification, you can add your no-copy auction items at the start of an auction, accept the debit perms, and then not worry about the script resetting as each of the items is auctioned off and leaves inventory.

 

Link to comment
Share on other sites

Oh, will remember that, actually never thought of adding conditions to the reset....

But my main problem is the configuration card and the floating text. Not every item has the same starting price, and the objects inside we get and we sell within one week and replace with something else. While the text keeps showing the current bid and description whats being auctioned.

So there is a need to reset the script so it gets the new info and show new text, everytime we change the config card. 

And that means new Allow Permission hassle, i seriously want to avoid clicking it everytime, mostly since i am not that much online to click it when they try to set up a new auction.
Its not an premium account and all i want is make sure it pays back the wrongly paid money and to repay the losing bids, won't make me go bankrupt, at least i made sure of that.

Link to comment
Share on other sites

If you simply want to re-read the notecard every time it changes but not reset the script, that's easily done.  Just store the notecard's uuid (which changes every time it's edited) and check that in the changed event.  If the uuid has changed, then start to re-read the notecard there -- something like this:

integer counter;key query;key kNotecardUUID;string strNotecardName = "Config";default{	state_entry()	{		if (llGetInventoryType(strNotecardName)==INVENTORY_NOTECARD){			//if there is a notecard in my inventory called "Config"			kNotecardUUID = llGetInventoryKey(strNotecardName);			//make a note of the uuid			counter=0;			query = llGetNotecardLine(strNotecardName,counter);			//start to read the notecard		}	}	dataserver(key requested, string data)	{		if(requested == query){			//read the notecard and process it		}	}	changed(integer change)	{		if(change & CHANGED_INVENTORY){			//something in my inventory has changed			if(kNotecardUUID !=llGetInventoryKey(strNotecardName)){				//if the notecard's uuid has changed				if (llGetInventoryType(strNotecardName)==INVENTORY_NOTECARD){					//if there is a notecard in my inventory called "Config"					kNotecardUUID = llGetInventoryKey(strNotecardName);					//make a note of the new uuid					counter=0;					query = llGetNotecardLine(strNotecardName,counter);					//and re-read the notcard					//don't forget to clear any lists you've populated using the notecard, though				}			}		}	}}

 

 

  • Like 1
Link to comment
Share on other sites

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