dont_sleep | R Documentation |
Keeps the computer awake by moving the mouse cursor and clicking periodically with a human-like behavior. It automatically detects the operating system (Windows or macOS) and runs the appropriate underlying logic.
dont_sleep(sec_range = c(20, 60), off_time = 18.5, quiet = FALSE)
dont_sleep_time(quiet = FALSE)
sec_range |
Numeric vector of length 2. Range (in seconds) of
random intervals between mouse movements and clicks. Default is |
off_time |
Numeric. Decimal hour (24h format) to stop the function
automatically, e.g. 18.5 means 18:30 (6:30 PM). Default is |
quiet |
Logical. If |
The cursor initially moves to the upper-left corner (0,0), then performs small random movements and clicks periodically to avoid system sleep. The function exits if the user moves the mouse away from the corner or when the specified off-time is reached.
Requires cliclick
installed on macOS (install via Homebrew:
brew install cliclick
), and the KeyboardSimulator
package on Windows.
Invisibly returns NULL
when the function exits.
Other Tools:
autoline()
,
bind_files()
,
bring_api()
,
chr2num()
,
db_download()
,
db_upload()
,
export_plot()
,
export_results()
,
files_functions()
,
font_exists()
,
formatColoured()
,
formatHTML()
,
glued()
,
grepm()
,
h2o_selectmodel()
,
haveInternet()
,
image_metadata()
,
importxlsx()
,
ip_data()
,
json2vector()
,
list_cats()
,
listfiles()
,
mail_send()
,
markdown2df()
,
move_files()
,
msplit()
,
myip()
,
quiet()
,
read.file()
,
statusbar()
,
tic()
,
try_require()
,
updateLares()
,
warnifnot()
,
what_size()
## Not run:
# Keep the computer awake until 8:00 PM, with mouse actions every 30 to 60 seconds
dont_sleep(sec_range = c(30, 60), off_time = 20)
# Summary of amount of daily time running function
dont_sleep_time()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.