Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does "Sleep schedule" task actually do? #4012

Closed
imvikash00 opened this issue Aug 15, 2016 · 3 comments
Closed

What does "Sleep schedule" task actually do? #4012

imvikash00 opened this issue Aug 15, 2016 · 3 comments

Comments

@imvikash00
Copy link

There is no info in the wiki as to what Sleep Schedule does, so I thought I would ask.

What is the purpose of Sleep Schedule? Does it stop the bot completely or does it stop any interaction with the server mimicking as if the app is in background. Does the bot keep walking during this sleep period?

Here's a sample task.
{
"type": "SleepSchedule",
"config": {
"enabled": false,
"time": "22:54",
"duration":"7:46",
"time_random_offset": "00:24",
"duration_random_offset": "00:43"
}

@smfbrooks
Copy link

smfbrooks commented Aug 15, 2016

Pauses the bot for a time. In this case 27.960 plus or minus 2,580 seconds at 22:54 plus or minus 1,440 seconds.

sleep_schedule.py

class SleepSchedule(BaseTask):
    """Pauses the execution of the bot every day for some time
    Simulates the user going to sleep every day for some time, the sleep time
    and the duration is changed every day by a random offset defined in the
    config file
    Example Config:
    {
        "type": "SleepSchedule",
        "config": {
          "time": "12:00",
          "duration":"5:30",
          "time_random_offset": "00:30",
          "duration_random_offset": "00:30"
        }
    }
    time: (HH:MM) local time that the bot should sleep
    duration: (HH:MM) the duration of sleep
    time_random_offset: (HH:MM) random offset of time that the sleep will start
                        for this example the possible start time is 11:30-12:30
    duration_random_offset: (HH:MM) random offset of duration of sleep
                        for this example the possible duration is 5:00-6:00
    """

@MasterCATZ
Copy link

still needs a bit of a tune , for me it keeps setting its next sleep time 24 hr later

ie) if you start bot about an hr before when you want its first sleep , it will not do it until the following day

here i set the config to start sleep Today 13:18
but it did tomorrow
date
Mon 15 Aug 13:14:01 CEST 2016
Next sleep at 2016-08-16 13:18:59.964978
tried again 13:33
date
Mon 15 Aug 13:33:33 CEST 2016
Next sleep at 2016-08-16 13:33:43.749257
so I came to the conclusion it will not do same day unless the full duration can be acomplished before the sleep time started
which would mean for this to activate on the same day it would have to be at least 13:55
{
"type": "SleepSchedule",
"config": {
"enabled": true,
"time": "15:55",
"duration":"1:00",
"time_random_offset": "00:10",
"duration_random_offset": "00:30"
}
},
the problem being how do you get the bot to shutdown after running 1 hr on first run ? if it will keep making the next day the time ?

@k4n30
Copy link
Contributor

k4n30 commented Aug 16, 2016

Please take configuration discussion to slack

@k4n30 k4n30 closed this as completed Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants