Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Vendor Sales_Assistant_v1  

Sales_Assistant_v1

Sales Assistant v1.lsl

Category: Vendor
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Sales_Assistant_v1
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Sales_Assistant_v1_1.lsl
1
2 //Sales Assistant v1.1
3 //by Nick Fortune - 09/01/2004
4
5 //This script makes it possible to sell things out of boxes and split the profit with a partner.
6 //The info about the objects price is read from the object's description.
7 //You can set the description on the GENERAL TAB just like the Object Name.
8
9 //Example Description: 100$ Super Mega Awesome Prim Thinger
10
11 //The script reads the price from the description so long as you have it in the format above.
12 //You must put "price$ info". The dollar sign must be in there for the script to work.
13 //-----Do Not Remove Header
14
15
16 //key gPartner = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // ############# PUT YOUR PARTNER'S KEY HERE. #############
17 //where the x's are your partner's key
18
19
20 key gPartner = "6cb1319d-07f7-4aad-96df-03fcd3d33bf6"; // ############# PUT YOUR PARTNER'S KEY HERE. #############
21
22
23 ///----------------Don't need to change anything below this line-------------------
24
25 key gOwner;
26 integer gPrice;
27 integer gCut;
28 integer gPerms = FALSE;
29 string gObject;
30
31
32 default {
33 state_entry() {
34 llWhisper(0, (string)gPartner);
35 gOwner = llGetOwner();
36 list Parsed = llParseString2List(llGetObjectDesc(), ["$"], []);
37 gPrice = llList2Integer(Parsed, 0);
38 if(!gPrice) {
39 llInstantMessage(gOwner, "Error: Please set object description to ''price$ info about object''. Touch to reset when ready.");
40 }
41 else {
42 if(gPartner != "") {
43 gCut = llRound(gPrice / 2);
44 }
47 }
48 }
49
50 on_rez(integer passed) {
51 if(llDetectedKey(0) != llGetOwner()) {
53 }
54 }
55
57 {
59 gPerms = FALSE;
60 llInstantMessage(gOwner, "I require debit permissions to function.");
62 }
63 else {
64 gPerms = TRUE;
65 llInstantMessage(gOwner, "I have aquired debit permissions from "+llKey2Name(gOwner)+".");
66 if((gPrice) && (gObject != "")) {
67 if(gPartner != "") {
68 llInstantMessage(gOwner, "Selling "+gObject+" for "+(string)gPrice+"$L. [Partner receives "+(string)gCut+"$L cut.]");
69 }
70 else {
71 llInstantMessage(gOwner, "Selling "+gObject+" for "+(string)gPrice+"$L. [NO Partner Defined.]");
72 }
73 }
74 else {
75 llInstantMessage(gOwner, "I have permissions, but your box is missing contents or missing a price.");
76 llInstantMessage(gOwner, "Fix error and touch to reset when ready.");
77 }
78 }
79 }
80
81 touch_start(integer total_number) {
82 if(llDetectedKey(0) == llGetOwner()) {
84 }
85 else {
86 llWhisper(0, gObject+" - $"+(string)gPrice+"L. Right click and pay amount to purchase.");
87 }
88 }
89
90 money(key giver, integer amount) {
91 if(gPerms == TRUE) {
92 if(amount < gPrice) {
93 llSay(0, gObject+" costs L$" + (string) gPrice);
94 llSay(0, "You paid $L"+(string)amount+", which is not enough!");
95 llGiveMoney(giver, amount);
96 }
97 else {
98 llSay(0, "Thank you for your purchase!");
99 llGiveInventory(giver, gObject);
100 if(amount > gPrice) {
101 llGiveMoney(giver, amount - gPrice);
102 }
103
104 if(gPartner != "") {
105 llGiveMoney(gPartner, gCut);
106 }
107 }
108 }
109 }
110 }// END //

Back to the Best Free Tools in Second Life and OpenSim.