Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

advice needed

wholesale Bing
Registered User
Join date: 27 Jun 2007
Posts: 24
01-20-2008 08:42
had a customer who claims my add board stole some of his inventory items ,

i will post the board code to see if you guys can spot any nasty code

i personally doubt you can steal inventory via a script , but your advice on this subject welcome


CODE


integer rentperiod = 7;
integer rentcost;
string rentinfonotecard = "_RentInformation_";
string rentadtexture = "_RentAdTexture_";
string rentscript;
string rentboardowner;
integer amountpaid = 0;

key renterkey;
string rentername;
integer countdown = 0;

string ItemNotecard="";
string ItemLandmark="";
string ItemObject="";
string ItemTexture="";

string Day2Left = "No";
string Day1Left = "No";

string tstring;

delnonowneritems()
{
integer x;
for (x = llGetInventoryNumber(INVENTORY_ALL) ; x >= 0 ; x--)
{
tstring = llGetInventoryName(INVENTORY_ALL, x);
if ((tstring != rentinfonotecard) && (tstring != rentadtexture) && (tstring != rentscript) && (tstring != ""))
{
llRemoveInventory(tstring);
}
}
}

default
{
state_entry()
{
//llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
rentboardowner = llKey2Name(llGetOwner());
state init;
}
}

state init
{ //Initialize
state_entry()
{
amountpaid = 0;
rentername = "";
renterkey = NULL_KEY;
countdown = 0;
ItemNotecard="";
ItemLandmark="";
ItemObject="";
ItemTexture="";
Day2Left = "No";
Day1Left = "No";
rentcost = (integer)llGetObjectDesc();
rentscript = llGetScriptName();
llSetTexture(rentadtexture, 0);
delnonowneritems();
state waitforrenter;
}
on_rez(integer i) {llResetScript();}
}

state waitforrenter
{ //Accept payment or dispense "about me" notecard
state_entry()
{
llInstantMessage(llGetOwner(), "Ready to rent...");
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), (rentcost*3), (rentcost*4)]);
}

touch_start(integer num)
{
if (llGetInventoryType(rentinfonotecard) == INVENTORY_NONE)
{
llInstantMessage(llDetectedKey(0), "Sorry, I don't have instructions to dispense. Please notify "+rentboardowner);
return;
}
integer perm_mask = llGetInventoryPermMask(rentinfonotecard, MASK_OWNER);
if(perm_mask & PERM_COPY)
{
llGiveInventory(llDetectedKey(0), rentinfonotecard);
}
else
{
llInstantMessage(llDetectedKey(0), "Sorry, I don't have permission to dispense instructions. Please notify "+rentboardowner);
}
}

money(key id, integer amount)
{
if ((amount/rentcost) != (integer)(amount/rentcost))
{
llGiveMoney(id, amount);
llInstantMessage(id, "Refunding, the cost to rent this per week is L$"+(string)rentcost);
return;
}
countdown = (amount / rentcost) * 7 * 24 * 60 * 60; //Seven days in a week, 24 hours in a day, 60 mins in an hour, 60 seconds in a min
llInstantMessage(id, "Thank You "+llKey2Name(id)+", you now have "+(string)(countdown/60/60/24)+" days left on your rent");
renterkey = id;
rentername = llKey2Name(renterkey);
amountpaid = amount;
state acceptitems;
}

link_message(integer sender_num, integer num, string str, key id)
{
if (str == "reset")
{
llInstantMessage(llGetOwner(), "Resetting, please wait...");
llResetScript();
}
}

on_rez(integer i) {llResetScript();}
}

state acceptitems
{ //CTRL drag items into contents
state_entry()
{
llSetTimerEvent(30 * 60);
llAllowInventoryDrop(TRUE);
llInstantMessage(renterkey, "Please hold down the CTRL key and drag an image, notecard, and landmark onto me. Click me when finished to begin displaying your advertisement");
}

timer()
{
llInstantMessage(renterkey, "Did not accept items and start advertisement within 30 minutes, issuing refund");
llGiveMoney(renterkey, amountpaid);
state init;
}

link_message(integer sender_num, integer num, string str, key id)
{
if (str == "reset")
{
llInstantMessage(llGetOwner(), "Resetting, please wait...");
llResetScript();
}
}

touch_start(integer num)
{
if (llDetectedKey(0) != renterkey)
{
return;
}

llInstantMessage(renterkey, "Preparing your advertisement...");

if (ItemTexture != "")
{ llInstantMessage(renterkey, "Texture: "+ItemTexture); }
else
{ llInstantMessage(renterkey, "Texture: <none>"); }
if (ItemNotecard != "")
{ llInstantMessage(renterkey, "Notecard: "+ItemNotecard); }
else
{ llInstantMessage(renterkey, "Notecard: <none>"); }
//if (ItemObject != "")
//{ llInstantMessage(renterkey, "Object: "+ItemObject); }
//else
//{ llInstantMessage(renterkey, "Object: <none>"); }
if (ItemLandmark != "")
{ llInstantMessage(renterkey, "Landmark: "+ItemLandmark); }
else
{ llInstantMessage(renterkey, "Landmark: <none>"); }

//if ((ItemTexture == "") || (ItemNotecard == "") || (ItemObject == "") || (ItemLandmark == ""))
if ((ItemTexture == "") || (ItemNotecard == "") || (ItemLandmark == ""))
{
llInstantMessage(renterkey, "One of each item is required to start renting this board");
return;
}

llListen(50, "", renterkey, "");
llDialog(renterkey, "Are you ready?", ["Yes", "No"], 50);
}

listen(integer channel, string name, key id, string message)
{
if (channel != 50)
{
return;
}
if (message == "Yes")
{
state dispense;
}
}

changed(integer mask)
{
integer i;
for (i=0 ; i<llGetInventoryNumber(INVENTORY_ALL) ; i++)
{
string tstring = llGetInventoryName(INVENTORY_ALL, i);
if ((tstring != rentadtexture) && (tstring != rentinfonotecard) && (tstring != rentscript))
{
if (llGetInventoryPermMask(tstring, MASK_NEXT) & PERM_COPY)
{}
else
{
llInstantMessage(renterkey, "I do not have COPY permission to distribute "+tstring);
llGiveInventory(renterkey, tstring);
return;
}
}
}

if(mask & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY))
{
integer i;
for (i=0 ; i<llGetInventoryNumber(INVENTORY_TEXTURE) ; i++)
{
string tstring = llGetInventoryName(INVENTORY_TEXTURE, i);
if ((tstring != ItemTexture) && (tstring != rentadtexture) && (ItemTexture != ""))
{
llInstantMessage(renterkey, "Replacing "+ItemTexture+" with "+tstring);
llRemoveInventory(ItemTexture);
ItemTexture=tstring;
return;
}
if ((tstring != rentadtexture) && (ItemTexture == ""))
{
llInstantMessage(renterkey, "Recieved Texture: "+tstring);
ItemTexture=tstring;
return;
}
}

for (i=0 ; i<llGetInventoryNumber(INVENTORY_NOTECARD) ; i++)
{
string tstring = llGetInventoryName(INVENTORY_NOTECARD, i);
if ((tstring != ItemNotecard) && (tstring != rentinfonotecard) && (ItemNotecard != ""))
{
llInstantMessage(renterkey, "Replacing "+ItemNotecard+" with "+tstring);
llRemoveInventory(ItemNotecard);
ItemNotecard=tstring;
return;
}
if ((tstring != rentinfonotecard) && (ItemNotecard == ""))
{
llInstantMessage(renterkey, "Recieved Notecard: "+tstring);
ItemNotecard=tstring;
return;
}
}

for (i=0 ; i<llGetInventoryNumber(INVENTORY_OBJECT) ; i++)
{
string tstring = llGetInventoryName(INVENTORY_OBJECT, i);
if ((tstring != ItemObject) && (ItemObject != ""))
{
llInstantMessage(renterkey, "Replacing "+ItemObject+" with "+tstring);
llRemoveInventory(ItemObject);
ItemObject=tstring;
return;
}
if (ItemObject == "")
{
string tstring = llGetInventoryName(INVENTORY_OBJECT, i);
llInstantMessage(renterkey, "Recieved Object: "+tstring);
ItemObject=tstring;
return;
}
}

for (i=0 ; i<llGetInventoryNumber(INVENTORY_LANDMARK) ; i++)
{
string tstring = llGetInventoryName(INVENTORY_LANDMARK, i);
if ((tstring != ItemLandmark) && (ItemLandmark != ""))
{
llInstantMessage(renterkey, "Replacing "+ItemLandmark+" with "+tstring);
llRemoveInventory(ItemLandmark);
ItemLandmark=tstring;
return;
}
if (ItemLandmark == "")
{
string tstring = llGetInventoryName(INVENTORY_LANDMARK, i);
llInstantMessage(renterkey, "Recieved Landmark: "+tstring);
ItemLandmark=tstring;
return;
}
}
}
}

on_rez(integer i) {llResetScript();}
}

state dispense
{ //Also allows lease extension by either renter or owner
state_entry()
{
if (ItemTexture != "")
{
llSetTexture(ItemTexture, 0);
}
llInstantMessage(renterkey, "Your advertisement has now began...");
llSetTimerEvent(60);

llSetPayPrice(PAY_HIDE, [0, 0, 0, 0]);
if (countdown <= (3 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, 0, 0, 0]);
}
if (countdown <= (2 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), 0, 0]);
}
if (countdown <= (1 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), (rentcost*3), 0]);
}
}

link_message(integer sender_num, integer num, string str, key id)
{
if (str == "reset")
{
llInstantMessage(llGetOwner(), "Resetting, please wait...");
llResetScript();
}
}

money(key id, integer amount)
{
if ((amount/rentcost) != (integer)(amount/rentcost))
{
llGiveMoney(id, amount);
llInstantMessage(id, "Refunding, the cost to rent this per week is L$"+(string)rentcost);
return;
}
if ((id != llGetOwner()) && (id != renterkey))
{
llGiveMoney(id, amount);
llInstantMessage(id, "Only the owner or current renter can extend the rental period. Issuing refund");
return;
}
countdown += (amount / rentcost) * 7 * 24 * 60 * 60; //Seven days in a week, 24 hours in a day, 60 mins in an hour, 60 seconds in a min
llInstantMessage(id, "Thank You "+llKey2Name(id)+", you now have "+(string)(countdown/60/60/24)+" days left on your rent");

llSetPayPrice(PAY_HIDE, [0, 0, 0, 0]);
if (countdown <= (3 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, 0, 0, 0]);
}
if (countdown <= (2 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), 0, 0]);
}
if (countdown <= (1 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), (rentcost*3), 0]);
}

}

touch_start(integer num)
{
if (ItemNotecard != "")
{
llGiveInventory(llDetectedKey(0), ItemNotecard);
}
if (ItemObject != "")
{
llGiveInventory(llDetectedKey(0), ItemObject);
}
if (ItemLandmark != "")
{
llGiveInventory(llDetectedKey(0), ItemLandmark);
}
}

timer()
{
countdown -= 60;

llSetPayPrice(PAY_HIDE, [0, 0, 0, 0]);
if (countdown <= (3 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, 0, 0, 0]);
}
if (countdown <= (2 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), 0, 0]);
}
if (countdown <= (1 * 7 * 24 * 60 * 60))
{
llSetPayPrice(PAY_HIDE, [rentcost, (rentcost*2), (rentcost*3), 0]);
}

if ((Day2Left == "No") && (countdown < (3600 * 48)))
{
Day2Left="Yes";
llInstantMessage(renterkey, "You have less than two days left on your rent at "+(string)(llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME])));
return;
}
if ((Day1Left == "No") && (countdown < (3600 * 24)))
{
Day1Left="Yes";
llInstantMessage(renterkey, "You have less than one day left on your rent at "+(string)(llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME])));
return;
}
if (countdown < 0 )
{
llInstantMessage(renterkey, "Your rent at "+(string)(llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME]))+" has expired.");
state init;
}
}

on_rez(integer i) {llResetScript();}
}

[code/]
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
01-20-2008 09:06
Not sure "steal" is quite the word I'd use, but the script will definitely "eat" any inventory that's left in it when the rental period expires, or if they don't finish putting all the required inventory types (texture, notecard, and landmark) into the object within 30 minutes of renting. Or if some other script in some prim of the object tells this one (by a link_message event) to "reset". Could any of those be the problem that was observed?
_____________________
Archived for Your Protection
wholesale Bing
Registered User
Join date: 27 Jun 2007
Posts: 24
hi
01-20-2008 11:26
this is the message i got from the customer via a note card



Here is the experience I had using the ad board:

1. I paid the ad board, the ad board took my $50L just fine.
2. I selected a ad texture from my inventory, held down the Crtl key, and as your ad board instructions stated, I individulally dragged the texture and notecard to, and over, the ad board you placed.

This is what happened next:

[0:38] bing rent board v8 owned by wholesale Bing gave you '_RentInformation_' ( http://slurl.com/secondlife/Nimnam/204/77/604 ).
[0:41] bing rent board v8: Please hold down the CTRL key and drag an image, notecard, and landmark onto me. Click me when finished to begin displaying your advertisement
[0:42] bing rent board v8: I do not have COPY permission to distribute
[0:42] bing rent board v8: I do not have COPY permission to distribute drum set
[0:42] bing rent board v8: I do not have COPY permission to distribute *Pillow talk* animated friends swing 1
[0:42] bing rent board v8: I do not have COPY permission to distribute *Pillow talk* animated friends swing 2
[0:42] bing rent board v8: I do not have COPY permission to distribute *Pillow talk* animated friends swing 3
[0:42] You decline 'TRESSSYWOODEN DONUT TABLE W/CANDLE' ( http://slurl.com/secondlife/Nimnam/204/77/604 ) from bing rent board v8.
[0:42] Inventory creation on in-world object failed.
[0:42] You decline 'drum set' ( http://slurl.com/secondlife/Nimnam/204/77/604 ) from bing rent board v8.
[0:42] You decline '*Pillow talk* animated friends swing 1' ( http://slurl.com/secondlife/Nimnam/204/77/604 ) from bing rent board v8.
[0:42] You decline '*Pillow talk* animated friends swing 2' ( http://slurl.com/secondlife/Nimnam/204/77/604 ) from bing rent board v8.

This then caused me to crash.

I should point out that I never declined anything, this was all a aoutomated process. I should also point out the the materals for ad board rentals are located at the top of my inventory and nowhere near the Objects file so this was not a drag and drop error on my part.

I have no idea what the TRESSSYWOODEN DONUT TABLE W/CANDLE and the drum set cost me to purchace, but I do know that the *Pillow talk* animated friends swings cost me $250L per copy. Here is the LM should you chose to verify that cost:􀀀

In that this was your device and you took money for an offer to render a service to me, here is what I am seeking in reimbursement from you:

$750L for three (3) *Pillow talk* animated friends swings
$ 50L for the advertising rate I paid you through the ad board

The total I am seeking is $800 linden
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-20-2008 12:44
I see a section for proccessing objects which is commented out, and in the instructions there is no mention of adding objects.... so why did the user drop in objects? the declined messages sound like the user was in busy mode, since they don't originate from the board (might want to add an instruction about that) and correctly tried to give back the no copy items (also needs an instructional note)

given the lack of instructions( regarding busy mode and no-copy items), coupled with the users error (busy mode and adding objects?) I'd settle on at least 1/2 their losses of products...

the products weren't exactly deleted, there were sent back, and then autorefused, so lost. your user shares some blame here (and you share some innocence since this is a fault in how SL behaves)

you could probably pop a dialog before you start returning items, warning users to first exit busy mode, and save yourself some future grief
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Starfire Desade
Can I play with YOUR mind
Join date: 10 Jul 2006
Posts: 404
01-20-2008 13:07
One day my partner noticed that about 1/3 of her inventory was gone....

We had some signs in our club that allowed the manager to drop the dancer's pic on them to allow them to be tipped. The process was scripted and used a cntrl-drag option at a point along the way to drop the pic into the inventory.

As I was working on the signs one subsequent day, I noticed that one was taking long to load the listing of the scripts. When they finally loaded, what do you think I found?

Yes, my partner's lost inventory.

I have a feeling she hit the shift key instead of cntrl when she went to select the dancer's pic to drag into the sign. This caused every item between the one she had previously had her highlight on and the dancer's pic to be highlighted and dragged.

I imagine this is what happened to the person who had the issue with the sign.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-20-2008 13:29
The ONLY way those extra items ended up in the adboard was because the disgrunteled customer had them selected along with the item/items they were trying to place.

It isn't even possible to create such a script that can reach into another avatars inventory and pull stuff out of it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
wholesale Bing
Registered User
Join date: 27 Jun 2007
Posts: 24
thanx guys
01-22-2008 16:24
refunded half the amount as someone surgested ,and explained to customer that his fears where unfounded , he was happy with the outcome

so a big thank you for the advice