Jump to content

Need help making a tipjar into a comment box.


BlackHeaven1983
 Share

You are about to reply to a thread that has been inactive for 2696 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm a mesh designer and a scripting noob.  Currently I am trying to take a tipjar script, and allow people to CTRL-drag/drop notecards into it.  I've found the ||AllowInventoryDrop function, but I can't figure out how to impliment it into the tipjar's advanced scripting.  Any help/guidance would be greatly appreciated.  The tipjar script can be found here   http://wiki.secondlife.com/wiki/Tipjar

 

I don't need any other features beyond collecting notecards in the prim, except MAYBE a notification sent to me when a notecard is added.  So I THINK that should be simple, but maybe I'm wrong.  However, what happens if two notecards with the same name get added?  Does one over-write the other?  Or does it store both without an issue?

Link to comment
Share on other sites

The llAllowedInventoryDrop function is quite simple.  All it does is to flip a little logical switch to allow (or disallow) people other than the owner or group members to drag/drop things into the object's inventory.  In your case, all it would take is adding llAllowedInventoryDrop(TRUE); as a new line in the state_entry event in state default.  As long as you don't plan on turning it off again at any point in the script, that's enough.  Almost.

You notice that the particular script you are working with reads a notecard to build an access list (a whitelist) and another one to determine how to divide tips.  Much of the script's logic deals with one or the other of those functions.  The script should ignore any other cards that are dropped into it, as long as they don't have the same name as one of the required cards.  You'll notice, though, that each state in the script includes a changed event that tells the script to restart if there's a change to its inventory. When that happens, the script will re-read the two required notecards, which is fine, but it will also lose its accumulated memory of anything else that has happened since the last restart --- including a tally of all tips. Therefore, you'll probably want to modify that changed event in each state with a more complicated version that only resets the script if one of the two required cards is added or removed.  That's not a hard bit of scripting but it will take some careful thought.

That changed event is also where you'll have to make any modifications to let you know when a visitor has dropped a comment card into the tipjar (and not to do anything when you remove those cards). You'll also need to give some thought to what happens if that visitor drops something other than a notecard into the tipjar. Most other things would be annoying at worst, but you may want to think of ways to delete them automatically. (BTW, don't worry about someone dropping a malicious script in.  The system won't allow that.)  There too, it's not a hard bit of scripting but one that will take some careful thought.  Incidentally, SL's inventory system will not allow there to be two items in inventory with exactly the same name, so that's not a worry. If you drop a second one in, the system changes its name by adding a digit at the end.

Since you are a non-scripter, you won't be able to do most of this, except adding the llAllowedInventoryDrop line, yourself.  Hire a scripter to do that work, by posting in the InWorld Employment forum.  We do not write or modify scripts here in the LSL Scripting forum, except as generic examples.

Link to comment
Share on other sites

Oh you're right!  Thank you Rolig!  I had considered the issue of someone injecting a script, and read that scripts aren't allowed to be dropped in.  HOWEVER, I didn't think about someone dropping in a notecard to change access.

But instead of going through the process you described, couldn't I just hardcode my UUID into the script and ditch the supporting notecards?  How hard would that be?

Link to comment
Share on other sites

The notecards are asking for a lot more than one person's UUID.  If you want a tipjar that without the whitelist and split profit functions, then you really don't need that complicated script in the first place.  If that's all you need, then yes, you can hardcode your UUID into a simpler script and save yourself all that extra baggage..

You'll still need to do some of what I outlined, though, if you want to report when a new comment card is dropped in the tipjar, or if you want to deal with objects, anims, sounds, and other garbage that pranksters drop in.

Link to comment
Share on other sites

No you're right, I don't need alot of that.  It's not for mass use, it's just for me.  I don't need payments split, nor do I need the group info.  But I do like how it keeps track of who made payments, and it lets you customize the amounts that show when they click to pay..

But all I really need, is a way to give a notecard, then recieve a notecard and a payment with a record of it.

If you know of another tipjar script that does just the basics, please point me in the right direction.  

Link to comment
Share on other sites

There are a couple of truly basic examples in the LSL wiki at http://wiki.secondlife.com/wiki/Money#Examples .  You don't need anything that makes change, thankfully, so that's one headache avoided.  Adding llAllowedInventoryDrop to either of the first two examples in the wiki is child's play.  Adding a message capability, as I said earlier, is a bit more complicated because you'll want to only send you a message (probably with llInstantMessage) when someone adds a notecard, but even that is only a matter of adding a carefully crafted changed event.

Link to comment
Share on other sites

Awesome.  Thanks for all the help.  I can somewhat read and understand how functions link up throughout a script, and get a feel for how it works, BUT I can't even begin to write it on my own.  I might end up taking your advice and hiring someone if they don't over charge me.  I know what I want isn't a complex script, but it's still complex for ME, lol.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2696 days.

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
 Share

×
×
  • Create New...