Difference between revisions of "User:Kristy Fanshaw/Shorter Vendor System Script"
Jump to navigation
Jump to search
(8 intermediate revisions by the same user not shown) | |||
Line 94: | Line 94: | ||
{ | { | ||
llResetScript(); | llResetScript(); | ||
} | |||
} | |||
state sens1 | |||
{ | |||
state_entry() | |||
{ | |||
state sens; | |||
} | } | ||
} | } | ||
Line 112: | Line 119: | ||
{ | { | ||
mail = message; | mail = message; | ||
llOwnerSay("updated"); | llOwnerSay("updated"); | ||
llShout(Ch,"updated"); | llShout(Ch,"updated"); | ||
Line 120: | Line 126: | ||
{ | { | ||
llListenRemove(listen_handle); | llListenRemove(listen_handle); | ||
state | state sens1; | ||
} | } | ||
no_sensor () | no_sensor () | ||
Line 146: | Line 152: | ||
} | } | ||
} | } | ||
state Ready1 | |||
{ | |||
state_entry() | |||
{ | |||
state Ready; | |||
} | |||
} | |||
state Ready | state Ready | ||
{ | { | ||
Line 165: | Line 178: | ||
{ | { | ||
mail = message; | mail = message; | ||
llOwnerSay("updated"); | llOwnerSay("updated"); | ||
llShout(Ch,"updated"); | llShout(Ch,"updated"); | ||
Line 201: | Line 213: | ||
llInstantMessage(llDetectedKey(0),"You didn't pay enough, " + llKey2Name(id) + ". Refunding your payment of L$" + (string)amount + "."); | llInstantMessage(llDetectedKey(0),"You didn't pay enough, " + llKey2Name(id) + ". Refunding your payment of L$" + (string)amount + "."); | ||
llGiveMoney(id, amount); | llGiveMoney(id, amount); | ||
state | state Ready1; | ||
} | } | ||
else | else | ||
Line 235: | Line 247: | ||
llSetText("", <1.0, 1.0, 1.0>, 1.0); | llSetText("", <1.0, 1.0, 1.0>, 1.0); | ||
llSetTimerEvent(0); | llSetTimerEvent(0); | ||
state | state Ready1; | ||
} | } | ||
} | } | ||
Line 299: | Line 311: | ||
}</lsl>}} | }</lsl>}} | ||
{{box|Server Script and Mailer Script for "Server Object"| | {{box|Server Script and Mailer Script for "Server Object"| | ||
Place | Place these scripts into a box you've created as a server prim.<br> | ||
Place the object you'd like to sell into this prim - only one object<br><br> | |||
Server Script: | Server Script: | ||
# when rezzed, it will tell you it's email address. | # when rezzed, it will tell you it's email address. | ||
# when this scrpt gets an email from the vendor, it gives the inventory item to buyer and asks mailer script to send a note back to vendor that the delivery is done. | # when this scrpt gets an email from the vendor, it gives the inventory item to buyer and asks mailer script to send a note back to vendor that the delivery is done. | ||
# when touched by the owner, it says totalsold. | |||
<lsl>//////////////////////////////////////////////////////////////////////////////////////////////// | <lsl>//////////////////////////////////////////////////////////////////////////////////////////////// | ||
// Copyright (c) 2008 by Kristy Fanshaw // | // Copyright (c) 2008 by Kristy Fanshaw // | ||
Line 328: | Line 342: | ||
changed(integer change) | changed(integer change) | ||
{ | { | ||
if(change & CHANGED_OWNER) | if(change && CHANGED_OWNER) | ||
{ | { | ||
llSetObjectDesc("0"); | |||
llResetScript(); | llResetScript(); | ||
} | } | ||
Line 341: | Line 356: | ||
state_entry() | state_entry() | ||
{ | { | ||
llSetObjectName(llGetInventoryName(INVENTORY_OBJECT,0)); | |||
llSetText(llGetObjectName(),<1,1,1>,1); | |||
totalsold = (integer)llGetObjectDesc(); | |||
llOwnerSay("new email is: " + (string)llGetKey() + "@lsl.secondlife.com"); | llOwnerSay("new email is: " + (string)llGetKey() + "@lsl.secondlife.com"); | ||
llEmail(my_address,llGetObjectName() , "my new email is: " + (string)llGetKey() + "@lsl.secondlife.com"); | llEmail(my_address,llGetObjectName() , "my new email is: " + (string)llGetKey() + "@lsl.secondlife.com"); | ||
Line 363: | Line 381: | ||
mailer = 1; | mailer = 1; | ||
} | } | ||
totalsold = totalsold + 1; | |||
llSetObjectDesc((string)totalsold); | |||
llGetNextEmail("", ""); | llGetNextEmail("", ""); | ||
} | |||
touch_start(integer total_number) | |||
{ | |||
if (llDetectedOwner(0) == llGetOwner()) | |||
{ | |||
llOwnerSay((string)totalsold +" units have been sold since server update. "); | |||
} | |||
else | |||
{ | |||
llInstantMessage(llDetectedKey(0), "please don't touch"); | |||
} | |||
} | } | ||
}</lsl> | }</lsl> | ||
Mailer script.<br> | Mailer script.<br> | ||
# Make as many sciprts you need and place them into server object.<br> | # Make as many numbers of mailer sciprts you need and place them into server object.<br> | ||
# Name them with numbers starting from number "1".<br> | # Name them with numbers starting from number "1".<br> | ||
# Don't skip any numbers: if you have 5 mailer scripts in | # Don't skip any numbers: if you have 5 mailer scripts in your server object then their names should be 1, 2, 3, 4 and 5. | ||
<lsl>//////////////////////////////////////////////////////////////////////////////////////////////// | <lsl>//////////////////////////////////////////////////////////////////////////////////////////////// | ||
Line 398: | Line 429: | ||
{ | { | ||
llEmail(msg,"delivered", (string)num); | llEmail(msg,"delivered", (string)num); | ||
} | } | ||
} | } | ||
}</lsl>}} | }</lsl>}} |
Latest revision as of 02:51, 8 April 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
- Click Here To see my main page for more scripts, if i'll make any :))
- Vendor System Script :: Same script with HTTP check
Copying Permission
Copyright © 2008 by Kristy Fanshaw
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.