Difference between revisions of "User:Damian Darkwyr"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
[https://wiki.secondlife.com/wiki/Client_Specific_Contents_Giver|Client Specific Contents Giver] | [https://wiki.secondlife.com/wiki/Client_Specific_Contents_Giver|Client Specific Contents Giver] | ||
[https://wiki.secondlife.com/wiki/Random_Giver_Prim|VERY random giver script] | [https://wiki.secondlife.com/wiki/Random_Giver_Prim|VERY random giver script] | ||
<lsl> | |||
/*Hippo Vendor Crowd Discount Plugin by Damian Darkwyr | |||
* | |||
*Create prim. | |||
*Place this script inside prim. | |||
*Link this prim to your Hippo Vendor | |||
*DONE | |||
*/ | |||
float setting = 0.5;//change this to effect the amount of discount. it will be 0.5*0.numberofscanned avatars | |||
integer i; | |||
integer fil; | |||
list keys; | |||
key buyer; | |||
default | |||
{ | |||
state_entry() | |||
{ | |||
llSetText("Earn a (0.5*x) discount for each person you get within 25m of this vendor when you make your purchase.",<1,1,1>,1); | |||
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT); | |||
} | |||
run_time_permissions(integer p) | |||
{ | |||
if(p & PERMISSION_DEBIT) | |||
{ | |||
}else | |||
{ | |||
llResetScript(); | |||
} | |||
} | |||
link_message(integer s,integer r,string str,key id) | |||
{ | |||
if(r == -147900) | |||
{ | |||
list d = llParseString2List(str,["^"],[]); | |||
buyer = (key)llList2String(d,0); | |||
llSetObjectDesc(llList2String(d,2)); | |||
llSensor("","",AGENT,25,PI); | |||
} | |||
} | |||
sensor(integer x) | |||
{ | |||
keys = []; | |||
i = 0; | |||
do | |||
{ | |||
fil = llListFindList(keys,[(string)llDetectedKey(i)]); | |||
if(fil == -1) | |||
{ | |||
keys += [(string)llDetectedKey(i)]; | |||
} | |||
i++; | |||
}while(i < x); | |||
string avcount = "0."+(string)llGetListLength(keys); | |||
float pS = setting * (float)avcount; | |||
if(pS >= 0.86)pS = 0.85; | |||
integer pricepaid = (integer)llGetObjectDesc(); | |||
float client_rake = (float)pricepaid * pS; | |||
integer owner_rake = pricepaid - (integer)client_rake; | |||
pricepaid = pricepaid - owner_rake; | |||
//llOwnerSay((string)pricepaid); | |||
llInstantMessage(buyer,"thank you for bringing a crowd. Here is you discount."); | |||
llGiveMoney(buyer,pricepaid); | |||
} | |||
no_sensor() | |||
{ | |||
} | |||
} | |||
</lsl> |
Revision as of 07:37, 20 January 2011
I made these contributions.... lol
Specific Contents Giver
random giver script
<lsl> /*Hippo Vendor Crowd Discount Plugin by Damian Darkwyr
* *Create prim. *Place this script inside prim. *Link this prim to your Hippo Vendor *DONE */
float setting = 0.5;//change this to effect the amount of discount. it will be 0.5*0.numberofscanned avatars integer i; integer fil; list keys; key buyer; default {
state_entry() { llSetText("Earn a (0.5*x) discount for each person you get within 25m of this vendor when you make your purchase.",<1,1,1>,1); llRequestPermissions(llGetOwner(),PERMISSION_DEBIT); } run_time_permissions(integer p) { if(p & PERMISSION_DEBIT) { }else { llResetScript(); } } link_message(integer s,integer r,string str,key id) { if(r == -147900) { list d = llParseString2List(str,["^"],[]); buyer = (key)llList2String(d,0); llSetObjectDesc(llList2String(d,2)); llSensor("","",AGENT,25,PI); } } sensor(integer x) { keys = []; i = 0; do { fil = llListFindList(keys,[(string)llDetectedKey(i)]); if(fil == -1) { keys += [(string)llDetectedKey(i)]; } i++; }while(i < x); string avcount = "0."+(string)llGetListLength(keys); float pS = setting * (float)avcount; if(pS >= 0.86)pS = 0.85; integer pricepaid = (integer)llGetObjectDesc(); float client_rake = (float)pricepaid * pS; integer owner_rake = pricepaid - (integer)client_rake; pricepaid = pricepaid - owner_rake; //llOwnerSay((string)pricepaid); llInstantMessage(buyer,"thank you for bringing a crowd. Here is you discount."); llGiveMoney(buyer,pricepaid); } no_sensor() { }
} </lsl>