What does "Sleep schedule" task actually do?
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" }
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
"""
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 ?
Please take configuration discussion to slack