Shymus Roffo Posted January 11, 2012 Share Posted January 11, 2012 i have been trying to find a way to keep track of objects handed out by a locker and i have'nt been able to do that.... I already have the locker so its handing out stuff i am just working on the database script wich keeps all i am hoping to use link message and keep it in a differant script so i can turn off the database when needed Link to comment Share on other sites More sharing options...
Dora Gustafson Posted January 11, 2012 Share Posted January 11, 2012 Take a look in the library to see how others have done that. Go to Library and search for vendor. Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted January 11, 2012 Share Posted January 11, 2012 what exactly do you mean by 'database'? Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 keeps track of how much object have been given Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted January 11, 2012 Share Posted January 11, 2012 I meant: What are you usuing to store the data. Well, never mind. Are you selling the item or just giving it away on a touch? Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 giving it away Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 And i'm not good with dataserver so i don't use it Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted January 11, 2012 Share Posted January 11, 2012 ok - in the touch event, after the llGiveInventory you use llMessageLinked(-4, 0, "", llDetectedKey(0)); - this sends a message with the key to scripts in the same prim. In the other script you use the link_message event: link_message(integer sender_num, integer num, string msg, key id) { if (sender_num == 0) { key receiver = id; //save id in some way } } Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 i know how to use the link message i i'm not really trying to save the keys i'm more like trying to save the stuff they take lets say if they take a helmet that is what gets saved i wanna know how much stuff is taken. Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted January 11, 2012 Share Posted January 11, 2012 ok - if you have like 3 items, just keep 3 counters like item1, item2 and item3 as global variables. use the string variable to send which items has been taken and increment the according counter: link_message(integer sender_num, integer num, string msg, key id) { if (sender_num == 0) { if(msg == "item1) { ++item1 } else if (msg == "item2) { ++item2; } ... } } there are more elegant ways, but that would do. Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 Ok is there also a way of checking the data or having it tell you how much has been taken? Link to comment Share on other sites More sharing options...
Dora Gustafson Posted January 11, 2012 Share Posted January 11, 2012 You can see all that in the transaction history on your Dashboard. It tells you what have been given to who by what and where. It gives the price too:smileyvery-happy: (but it is more fun to make your own script) Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 People don't pay for the stuff its all free but its for group only gear Link to comment Share on other sites More sharing options...
Dora Gustafson Posted January 11, 2012 Share Posted January 11, 2012 shymus Roffo wrote: People don't pay for the stuff its all free but its for group only gear In that case the price will read L$0 in the Transaction History Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 Does that way show transaction history for objects? Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 11, 2012 Share Posted January 11, 2012 If I were writing this script, I wouldn't write a separate script to keep track of something simple like that. It just adds to the sim's server load unnecessarily. All you're talking about is counting, so take Darkie's example and bury it in your main script. When you give away something, increment its counter. You can ask the script to dump the saved values of the counters to you, the owner, when you send it an appropriate trigger mssage. if ((id == llGetOwner()) && (msg == "report")){ llRegionSayTo(llGetOwner(),0,"Item 1 = " + (strng)val1 + " \nItem 2 = " + (string)val2 + " \nItem 3 = " + (string)val3); //And so forth} Link to comment Share on other sites More sharing options...
Shymus Roffo Posted January 11, 2012 Author Share Posted January 11, 2012 Ok i just got it Thanks and i put it in the main script Link to comment Share on other sites More sharing options...
Recommended Posts
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