Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedules] Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
peejaygee
Posts: 5
Joined: 07 Dec 2017, 09:37
Facebook: PJGHangouts
Google: PaulG_PJGHangouts
Location: USA
Contact:

Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedules]

07 Dec 2017, 10:24

All,

So I've known about AutoHotkey and it's scripting for a while, I've even got a script working for me that someone else helped me with, but still to this day, it's a programming/script language I've not really looked into. But, as I know there are a lot of talented AHK scripters out there, I figured I'd reach out for some help.

I'm not looking to code this myself, so I basically asking someone else to code its backbone (i.e. can't have a 'maybe you need to use these commands), and I'm a 'pay it forward' type of guy, I'll (like I do anyways) help others, with things I'm confident with, even donating some money to a charity, etc

Here is what I need (if it possible).

First, maybe using a Twitch API (as I know WordPress has plugins that can do it, so I'm assuming it may be possible?) see whether I'm online on twitch. I've searched google and it can also be done in JS, I'm hoping it can be done in AHK Script. ( https://dev.twitch.tv/docs/v5 )

Once the script knows I'm online, check for a certain day of the week, and a certain time of the day, lets say, a Friday at 7.30pm (local time), if those three criteria all match (online, day & time), then send an email to an email distro list (just a list of my friends who want to me notified when I'm online) [I know email account 'check' is possible, that is in a current script I'm using]

Now, I also want to be able to send another email at 8.30pm, but the wording would be different, i.e. I'm already online, so I'm telling them in another block of words something different. Then another at 10pm.

Is this possible in AHK? So I could go in and edit/change if I needed too?

time[1] = 1900; time[2] = 2030; time[3] = 2200, etc

day [1] = "Friday"; day[2] = "Sunday", etc

text[1] = "Hey Guys, I've gone online, come and watch me @ ........" <---this would be the first email, when I go live
text[2] = About to take a break, but I'll be back online shortly, come and hang with me @ ........ " <--- if I'm still live, but about to be afk for a while, etc

Maybe in the email I could attach a random image, etc?

image[1] = "c:\users\[username]\mypictures\randompic\porcher.jpg"
image[2] = c:\users\[username]\mypictures\randompic\[gameimplaying].jpg"

I am OK with generic code reading, tweaking and changing, but if someone could get me going, that I could mess around with it, just emailing myself for the time being, until I have it working exactly how I need it. I've band-aided code together before to get things working, but I always need a backbone of code first.

I hope someone can help with this project/task.
Thanks in advance for any help I'm given.
Regards.
User avatar
peejaygee
Posts: 5
Joined: 07 Dec 2017, 09:37
Facebook: PJGHangouts
Google: PaulG_PJGHangouts
Location: USA
Contact:

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul

07 Dec 2017, 10:55

Thanks for the welcome.

My original post was written in WaterFox (a Firefox variant), but I have a choice of browsers I use, depending on my needs, from Chrome to EDGE.

Curious though, what does a browser have to do with it. (willing to learn)
BoBo
Posts: 2513
Joined: 13 May 2014, 17:15

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul

07 Dec 2017, 10:58

[brainfart]Probably checking existing cookie(s) for any twitch activity?! AFAIK browsers are handling its cookies in different ways[/brainfart]
The "rest of the story" shouldn't be that tough to master. Let's wait for the pro-bro's! Good luck :thumbup:
User avatar
peejaygee
Posts: 5
Joined: 07 Dec 2017, 09:37
Facebook: PJGHangouts
Google: PaulG_PJGHangouts
Location: USA
Contact:

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul

07 Dec 2017, 11:05

lol @ brainfart, I've had many of them over time. :)

Even if the 'twitch' part can't be done, as I can always just run the script when I know I'm online, as it's me putting myself online after all, although, due to said 'brainfarts' there may be a time I forget.. :)
User avatar
peejaygee
Posts: 5
Joined: 07 Dec 2017, 09:37
Facebook: PJGHangouts
Google: PaulG_PJGHangouts
Location: USA
Contact:

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul

12 Dec 2017, 21:06

Nobody able to help me with this? :(
Guest

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul

13 Dec 2017, 10:30

Using outlook basic example https://autohotkey.com/boards/viewtopic.php?t=23610
with that code at hand you'll many more examples I'm sure.

Alternatives to search for 'blat autohotkey' or 'gmail autohotkey' and you'll find working scripts.
FanaticGuru
Posts: 1014
Joined: 30 Sep 2013, 22:25

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul

13 Dec 2017, 13:52

The email part is relatively easy if you have Outlook installed. Outlook is easy to communicate with programmatically to send emails in the background.

Getting the status from Twitch is the harder part. You have to create an OAuth token which requires setting up an account and a bunch of hoops. That will get me an OAuth token that I can use for testing. You would have to create your own OAuth token for your use. This is pretty standard for all API services as the servers want to track what applications are accessing their systems so they can restrict any that are abusive.

I don't use Twitch so I am not inclined to sort out all the Twitch API stuff but if you can figure out how to get your online status, I can help with the email part.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
User avatar
peejaygee
Posts: 5
Joined: 07 Dec 2017, 09:37
Facebook: PJGHangouts
Google: PaulG_PJGHangouts
Location: USA
Contact:

Re: Have a coding challenge. Need help with a particular way I want a script to work, if possible. [twitch/email/schedul  Topic is solved

18 Dec 2017, 09:31

So, with not having Outlook installed, I decided to simplify the approach, using excel, I have some base text excel has an output button, which writes all the text to a file, including a line to call a dos program called sendemail, then the task scheduler at my set time, uses said data to send the email I needed. The task scheduler turns of the handful of tasks in the AM at 7, and I then run a script to turn them on just prior to streaming, partly automated but with a few additional clicks.

Thanks for any ideas and suggestions.

Return to “Ask For Help”

Who is online

Users browsing this forum: Hellbent, Noesis, Rindis and 72 guests