Jump to content
Sign in to follow this  
Jamiee Daines

I need a voting script

Recommended Posts

I tried doing this myself but I am not capable.

I need a script that can be placed in an object that is attached to an avatar and will;

Allow avatars to click and get a message to vote for vote of yes or no

Avatars can only vote once a day (or at least after a few hours)

The vote will incrementally add or subtract from a running total.

I would like the ability to change the dialogue either by changing the text within the script or by using a note card

A notecard or chat interchange with the scripter would be good to solidify what I need as i am sure there are other things that would be good to add

Thank you in advance

 

Share this post


Link to post
Share on other sites
Posted (edited)

If you are looking to hire someone to write the script for you, head over to the Inworld Employment forum. The LSL Scripting forum is more geared towards scripting discussions and providing assistance to those trying to write their own scripts. If you'd like to take another try at writing it yourself, we can give you some pointers - but we won't write the whole thing for you here.

Your project can be made simpler by breaking it down into smaller parts and focusing on each one at a time. Then, as you get more familiar with it, you can combine the different parts into a single script to achieve your overall goal. The LSL wiki has lots of documentation you can read to help you along:

  • The touch_start event is typically used to make scripted objects respond to being clicked on.
  • The script can contain a variable (integer) that holds the total score value - which can be incremented/decremented depending on the result from the voting interaction.
  • The llDialog() function is typically used to create a pop-up window with a message and clickable buttons. This can be used to send a voting prompt to target avatars. It must be used in conjunction with a listen event in order for the script to actually get the response.
  • There are multiple ways you can alter the text used for the voting prompt. As before, the script would have a variable (string) that holds the text. You could use the llListen() function to setup a listener which will make the script react when it hears chat spoken (you can set up filters to make it only listen to the owner of the object). Or you could use the llGetNotecardLine() function to read text from notecards stored within the object's inventory. Though it's an indirect get, as this queues a dataserver event - in which the actual data will be retrieved.
  • The script can also have another variable (list) which stores the keys/UUIDs of any avatar that has voted and check against that to see if they try to vote again before the cool down period elapses. Depending on how many people are likely to vote during a given period, you may need to implement a form of compression on the stored keys, otherwise your script may run out of memory and crash. This page lists some user created functions that can be used to compress/decompress keys.

I've listed the major goals of your project in order of complexity: The first two are fairly straightforward. The next two start getting more complex quickly and depend on other concepts and functions - but the examples on their respective wiki pages should give you a good starting point. The last part may be the most tricky, as it involves more complex logic. But as you'll come to see, there are many, many ways to approach and solve a problem when it comes to programming.

You mention you tried doing this yourself, but were unsuccessful. What did you try? How familiar with programming in general are you? If this is you first go at at it, it can seem daunting. But breaking things down into smaller pieces and definitely help with that. Start out small and build up from there.

Edited by Fenix Eldritch
typos
  • Like 1

Share this post


Link to post
Share on other sites

Thank you Fenix.

I will take a look at that other forum place later.  I do have someone taking a look at what i need right now, but this is in very early stages.

As far as me, I started out doing programming in Fortran,   Shows just how long ago that was.

At this point I know enough to be dangerous but don't have the time to learn what i need to know to make this work.  Yes that is a feeble excuse I know.

If this doesn't pan out i might experiment around and see what i can do myself.

 

 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...