AmberCutie's Forum
An adult community for cam models and members to discuss all the things!

Only allow certain model(s) to use app/bot

  • ** WARNING - ACF CONTAINS ADULT CONTENT **
    Only persons aged 18 or over may read or post to the forums, without regard to whether an adult actually owns the registration or parental/guardian permission. AmberCutie's Forum (ACF) is for use by adults only and contains adult content. By continuing to use this site you are confirming that you are at least 18 years of age.
Status
Not open for further replies.
Feb 21, 2021
40
9
21
Some apps/bots only allow for certain models to use them. They show a message, instead of the settings, when you launch them. How is this done? WEBMODELS, for example.


It probably falls in the same area, how is the model's name gotten at Launch App time and auto-filled in in some of the option boxes?

Name of your Tip Menu? [mritter0's Tip Menu] <---- text box auto-filled in with your name
 

You only need one value to limit against. The cb.room_slug constant is available on start and will always contain the username of the person who is actively running the app/bot.

Cheers,
Cexmental
 
Upvote 0
Right. But where/when do you check it? cb.onStart() is when the app is actually launched, not when the Launch App tab is pressed.

If your cb.settings_choices = [] is the very first thing in your JavaScript file, can you put code above to check?

Code:
if (cb.room_slug=="mritter0")
{
    normal settings
    
    cb.settings_choices = [all my options]
}
else
{
    show "error" message and don't let launch
}

Or is it done first thing in init() ?
 
Upvote 0
JavaScript can go anywhere in the script and in any order. However, code is executed from top to bottom, regardless of scope. The cb.room_slug constant is always available and you can always always reference it by value. How you structure your limiter and code, is your personal choice.

The init() function is left over from the days of CB opensource. If you see it, you probably have someone elses code. It is simply a container for code that gets executed on the scripts 1st pass. The 2nd pass is when cb.onStart is executed. Anything you have placed inside init() should be moved to cb.onStart.

Cheers,
Cexmental
 
Upvote 0
Yes, I was looking at other people's code for starting points / learn the basics. I will get rid of init(). Your reply in another thread may help, too.


Thanks for the help. I appreciate it.
 
Upvote 0
Status
Not open for further replies.