Jump to content

Program to press a button at a certain time?

I had a good idea the other day.

I have started to listen to Spotify recently and I was thinking of finding a program that would say press play as I wake up for college so it would wake me up as well as being peaceful for getting ready to.

Anyone got any ideas?

Edit: just to clarify, this is for PC.

Link to comment
https://linustechtips.com/topic/445293-program-to-press-a-button-at-a-certain-time/
Share on other sites

Link to post
Share on other sites

Good idea! Totally following this.

Laptop: Thinkpad W520 i7 2720QM 24GB RAM 1920x1080 2x SSDs Main Rig: 4790k 12GB Hyperx Beast Zotac 980ti AMP! Fractal Define S (window) RM850 Noctua NH-D15 EVGA Z97 FTW with 3 1080P 144hz monitors from Asus Secondary: i5 6600K, R9 390 STRIX, 16GB DDR4, Acer Predator 144Hz 1440P

As Centos 7 SU once said: With great power comes great responsibility.

Link to post
Share on other sites

I would love to see a alarm app that would allow spotify integration, we must have developers in the forum to do this

CPU: Xeon 1230v3 - GPU: GTX 770  - SSD: 120GB 840 Evo - HDD: WD Blue 1TB - RAM: Ballistix 8GB - Case: CM N400 - PSU: CX 600M - Cooling: Cooler Master 212 Evo

Update Plans: Mini ITX this bitch

Link to post
Share on other sites

USB Macros.

My rig: Intel Core i7-8700K OC 4.8 | NZXT Kraken X62 | ASUS Z370-F | 16 GB Trident Z RGB 3000 (2x8) | EVGA 1070 SC | EVGA SuperNova NEX650G1 | NZXT H700 | Samsung 250GB 850-EVO | 2x 2TB Seagate Barracuda HDDs 

Link to post
Share on other sites

I would love to see a alarm app that would allow spotify integration, we must have developers in the forum to do this

Except there already is D:

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to post
Share on other sites

Except there already is D:

Why not actually post the name? :P

 

no, use chrontab on the rasberry pi to make a spotify app. i have already done this and trust me its not that great

Sure lemme just spawn a raspberry pi :P

 

I know it's great, I used to do it with the radio.

Link to post
Share on other sites

If there is a Spotify API and I have some time to waste I could think about doing an Android app :)

That would be awesome!

If only spotify mobile didn't suck huge dicks :(

Link to post
Share on other sites

only thing i can think of is an app that will emulate the play key on earphones

This is for the PC

Link to post
Share on other sites

A button that will emulate the play button on a media keyboard

What.

Link to post
Share on other sites

I can help you with Visual Basic 6, I think i still remeber to code in that old timer.

Actually it's really simple app, move mouse to X/Y position, trigger click if interval $yourTime = Time()

 

But that means every time you go to bed you need to keep Spotify in front-view as window or whatever.

And there is not much of use from software like that, better try with some API let's say:

 

Some player API, don't know if they have that but then you can use PHP/HTML for player and with that even move it to a phone.

Link to post
Share on other sites

If there is a Spotify API and I have some time to waste I could think about doing an Android app :)

well android wouldn't help me :P

CPU: Xeon 1230v3 - GPU: GTX 770  - SSD: 120GB 840 Evo - HDD: WD Blue 1TB - RAM: Ballistix 8GB - Case: CM N400 - PSU: CX 600M - Cooling: Cooler Master 212 Evo

Update Plans: Mini ITX this bitch

Link to post
Share on other sites

I can help you with Visual Basic 6, I think i still remeber to code in that old timer.

Actually it's really simple app, move mouse to X/Y position, trigger click if interval $yourTime = Time()

 

But that means every time you go to bed you need to keep Spotify in front-view as window or whatever.

And there is not much of use from software like that, better try with some API let's say:

 

Some player API, don't know if they have that but then you can use PHP/HTML for player and with that even move it to a phone.

That is exactly what I want though.

 

I could just play the playlist I want to wake up to, pause it again then leave the program to press play at say 7am

Link to post
Share on other sites

That is exactly what I want though.

 

I could just play the playlist I want to wake up to, pause it again then leave the program to press play at say 7am

well i think there might be a way to do this without a custom program but im give this a try later anyway. but a little more description of the use case would be great.

 

say if i wrote a windows app that you could enter a time in and at that time it would start playing spotify would that be what you need or do you want specific playlist choice?

 

anyway im gonna take a look and see what i can do. sounds simple enough

 

this would mean you had to leave your pc on at night though

"You know it'll clock down as soon as it hits 40°C, right?" - "Yeah ... but it doesnt hit 40°C ... ever  😄"

 

GPU: MSI GTX1080 Ti Aero @ 2 GHz (watercooled) CPU: Ryzen 5600X (watercooled) RAM: 32GB 3600Mhz Corsair LPX MB: Gigabyte B550i PSU: Corsair SF750 Case: Hyte Revolt 3

 

Link to post
Share on other sites

well i think there might be a way to do this without a custom program but im give this a try later anyway. but a little more description of the use case would be great.

 

say if i wrote a windows app that you could enter a time in and at that time it would start playing spotify would that be what you need or do you want specific playlist choice?

 

anyway im gonna take a look and see what i can do. sounds simple enough

 

this would mean you had to leave your pc on at night though

All I need is a program that presses a key of my choice at a certain time.

 

Also, I am perfectly fine with leaving my PC on overnight.

Link to post
Share on other sites

If you're on Windows and have Python installed here's a script that will open Spotify to whatever playlist you want, find the play button and click it after whatever delay you tell it.

 

 

The delay is in the format hours:minutes and they can be decimals. So if you want to open some playlist in 1 and a half hours you would start it like this:

 

py spotifyplayclicker.py spotify:user:22s42nedyehh4jtph7lryogtq:playlist:3xdVJblwBJ0MpoLHCUY9yd 1:30

 

to get that long spotify string thing open the playlist you want, click the little button next to play and chose copy Spotify URI. If you're using the free Spotify, you should probably close it before going to bed so an ad doesn't get in the way at the wrong time. And of course I wouldn't actually use this as an alarm.

#!/usr/bin/env python3import timeimport ctypesimport sysimport osimport threadingfrom PIL import ImageGrab, Imagefrom datetime import datetime, timedeltaargs = sys.argvif len(args) < 3:    print('Usage: py spotifyplayclicker.py <spotify URI> <time delay H:M>')    sys.exit(1)uri = sys.argv[1]hour, minute = [float(x) for x in sys.argv[2].split(':')]def go():    os.system('start ' + uri)    time.sleep(5)        img = ImageGrab.grab().convert('RGB')    width, height = img.size    pixels = list(img.getdata())    for i, p in enumerate(pixels):        if p == (0x1D, 0xB9, 0x54):            if pixels[i+5] == (0xFF, 0xFF, 0xFF):                x = i % width                y = i // width                print('{} {}'.format(x, y))                ctypes.windll.user32.SetCursorPos(x, y)                time.sleep(.1)                ctypes.windll.user32.mouse_event(0x2,0,0,0,0)                time.sleep(.1)                ctypes.windll.user32.mouse_event(0x4,0,0,0,0)                breaknow = datetime.utcnow()time_to_run = now + timedelta(hours=hour, minutes=minute, seconds=-5)delay = (time_to_run - now).total_seconds()threading.Timer(delay, go).start()

1474412270.2748842

Link to post
Share on other sites

What would help?

iOS would be great, would pay 1,99 if the app is good and has a adjustable snooze option

CPU: Xeon 1230v3 - GPU: GTX 770  - SSD: 120GB 840 Evo - HDD: WD Blue 1TB - RAM: Ballistix 8GB - Case: CM N400 - PSU: CX 600M - Cooling: Cooler Master 212 Evo

Update Plans: Mini ITX this bitch

Link to post
Share on other sites

All I need is a program that presses a key of my choice at a certain time.

 

Also, I am perfectly fine with leaving my PC on overnight.

ok so i threw together a little handy tool that will do the job for you now you just need to give me a way of sending you the setup im creating right now

"You know it'll clock down as soon as it hits 40°C, right?" - "Yeah ... but it doesnt hit 40°C ... ever  😄"

 

GPU: MSI GTX1080 Ti Aero @ 2 GHz (watercooled) CPU: Ryzen 5600X (watercooled) RAM: 32GB 3600Mhz Corsair LPX MB: Gigabyte B550i PSU: Corsair SF750 Case: Hyte Revolt 3

 

Link to post
Share on other sites

I had a good idea the other day.

I have started to listen to Spotify recently and I was thinking of finding a program that would say press play as I wake up for college so it would wake me up as well as being peaceful for getting ready to.

Anyone got any ideas?

Edit: just to clarify, this is for PC.

ok so now its done and im gonna post a dropbox link here for everyone to download if they want.

ive included a little manual and also please not everyone at once ;)

 

http://bit.ly/1LTvTBE

 

feedback is appreciated

"You know it'll clock down as soon as it hits 40°C, right?" - "Yeah ... but it doesnt hit 40°C ... ever  😄"

 

GPU: MSI GTX1080 Ti Aero @ 2 GHz (watercooled) CPU: Ryzen 5600X (watercooled) RAM: 32GB 3600Mhz Corsair LPX MB: Gigabyte B550i PSU: Corsair SF750 Case: Hyte Revolt 3

 

Link to post
Share on other sites

Ok so i made you this software in VB6.

Here is src & exe:

http://www.mediafire.com/download/nrdbcc0e5vel9l4/Alarm.rar

Here is screenshot:

 

nice how long have you been programming?

"You know it'll clock down as soon as it hits 40°C, right?" - "Yeah ... but it doesnt hit 40°C ... ever  😄"

 

GPU: MSI GTX1080 Ti Aero @ 2 GHz (watercooled) CPU: Ryzen 5600X (watercooled) RAM: 32GB 3600Mhz Corsair LPX MB: Gigabyte B550i PSU: Corsair SF750 Case: Hyte Revolt 3

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×