Auto Resume Livestreams


Aug 11, 2013
Hi all!

I have figured out how to auto-resume livestreams that can cut-off from time to time.
It's a simple Autohotkey script that i compiled into an exe.
So what does it do?
It checks the colour on 2 different coordinates every 2 seconds on the screen,
therefore i choose 2 spots at the bottom of my Confluence skin,
that look the same on all the add-ons when idle.
As soon as a video or stream cuts of or ends it hits p, (Play) resuming whatever you are watching,
as the colour of your 2 skin coordinates will match.
I compiled it into an exe with user input boxes for friendly use for those who don't like scripting.
The filename is Replay.exe.
When executed the first time the user can input what command to send to kodi,(p = play)
and an appropriate shortcut key to toggle the function on and off.
After that you get prompted to click twice on 2 different coordinates in the skin,
when the player is idle.
When setup is finished you hear 2 short beeps.
In the Confluence skin i click somewhere at the bottom, as that area is consistent among
the different addons.
All settings get saved in the file 2-Coordinates.ini that gets created in the same
folder as the exe.
To re-run the setup, simply delete the ini file.
Below is the script for those who want to compile it for themselves:
(Could perhaps be done more neat,but i was to lazy to create a custom gui)
#SingleInstance ignore
CoordMode, Pixel, Screen
Coordmode, Mouse, Screen

keybutton = Space
IniName = 2-Coordinates.ini
IfNotExist, %IniName%
InputBox, Command , Command To Send To Kodi, p = Play`n{DOWN}p = Play Next`nSee Keyboard Controls For Kodi.`nF4 To Exit, , , , , , , , p
if ErrorLevel
IniWrite, %Command%, %IniName%, Init, Command
InputBox, Shortcut , Keyboard Shortcut To Toggle Switch, Keyboard Shortcut To Toggle Switch.`nSee Hotkey Documentation For Autohotkey.`nDo Not Use F4, , , , , , , , 1
if ErrorLevel
FileDelete, %IniName%
IniWrite, %Shortcut%, %IniName%, Init, Shortcut
MsgBox,, Create 2 Coordinates, Place Cursor And Click Space on 2 Mouse Coordinates.`nDelete 2-Coordinates.ini To Start Over.

KeyWait, %keybutton%, D
KeyWait, %keybutton%, U
MouseGetPos, LocX, LocY
IniWrite, %LocX%, %IniName%, Init, Cord1X
IniWrite, %LocY%, %IniName%, Init, Cord1Y
PixelGetColor, LocColor, %LocX%, %LocY%
IniWrite, %LocColor%, %IniName%, Init, FirstColor
SoundBeep, 1000, 500
KeyWait, %keybutton%, D
KeyWait, %keybutton%, U
MouseGetPos, LocX, LocY
IniWrite, %LocX%, %IniName%, Init, Cord2X
IniWrite, %LocY%, %IniName%, Init, Cord2Y
PixelGetColor, LocColor, %LocX%, %LocY%
IniWrite, %LocColor%, %IniName%, Init, SecondColor
SoundBeep, 1200, 300
SoundBeep, 1200, 300

IniRead, Command, 2-Coordinates.ini, Init, Command
IniRead, Shortcut, 2-Coordinates.ini, Init, Shortcut
IniRead, Cord1X, 2-Coordinates.ini, Init, Cord1X
IniRead, Cord1Y, 2-Coordinates.ini, Init, Cord1Y
IniRead, FirstColor, 2-Coordinates.ini, Init, FirstColor
IniRead, Cord2X, 2-Coordinates.ini, Init, Cord2X
IniRead, Cord2Y, 2-Coordinates.ini, Init, Cord2Y
IniRead, SecondColor, 2-Coordinates.ini, Init, SecondColor
Hotkey1 = %Shortcut%

Hotkey %Hotkey1%, Shortcut

RepeatKey := !RepeatKey
If RepeatKey
SetTimer, CheckColor, 2000
SetTimer, CheckColor, Off

PixelGetColor, color1, %Cord1X%, %Cord1Y%
PixelGetColor, color2, %Cord2X%, %Cord2Y%
If ( color1 = FirstColor && Color2 = SecondColor )
send %Command%

Have fun with it 😁