Jump to content
UBot Underground

Post comment 30% of time


Recommended Posts

 

Here is a really simple way.

set(#random_number, $rand(1, 100), "Global")
if($comparison(#random_number, "<=", 30)) {
    then {
        comment("post comment")
    }
    else {
    }
}

It doesn't make 30% of a time... what if for 20 times the number is between 1 and 30. I'm saying that because I used that method before

Link to post
Share on other sites

It doesn't make 30% of a time... what if for 20 times the number is between 1 and 30. I'm saying that because I used that method before

 

If you want it to be exactly 30% then you need to keep track of everytime you posted and didn't post, then compare the numbers and get the percentage and once the posted drops below 30% then it posts again. But keep in mind this also forms a pattern. For example first post the posted is at 0% so it posts always on the first post and then always skips the next 3 then the posted is at 25% so it always posts that time and so on.

Link to post
Share on other sites

a list with 9 choices, and 3 of those choices being comment, while the other 6 being no comment, then pick random item will do the trick. You could work through the order sequentially if you'd prefer to get the exact percentage per 9 tries.

  • Like 1
Link to post
Share on other sites
  • 2 weeks later...

Similar to quite_interesting:

 

Have a list numbered 1-10.

 

Randomly take a number between 1 and 10. Add THAT random number to a list.

 

Now, REMOVE that number from the original list. If that number is 1,2 or 3 then post a comment.

 

So let's say the number 3 is randomly selected. It removes that from the original list and adds it to the new list, then goes to post the comment.

 

Next time the random number runs, let's say it's again 3, it checks to see does it exist in the new list. If it does, go again for a random number (in this case it does). So, you will need to check the new list each time to ensure the number hasn't been used already.

 

Ultimately I wouldn't imagine you'd be caught in a loop checking for too long, but hey, what if the random number was 1,2 or 3 a thousand times? ;)

 

Anyhow, that's one way. I'm sure there are easier ways. Just thought of this one now.

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.

Loading...
×
×
  • Create New...