'Master Control Program (MCP)
'2019/01/06
'Monitor for and Shut down Youtube access
DIM Rec
AS Rectangle
, Mp
AS LPpoint
_SCREENHIDE 'makes the program invisible to the user. Escape key displays log! DECLARE LIBRARY 'function is already used by QB64 so "User32" is not required
RF.top = Shift_UP(RF.top) 'correct start search pos
RF.left = Shift_LEFT(RF.left)
Tube_Found% = Check_Tube(Test&)
IF Tube_Found%
> 80 AND Tube_Found%
< 95 THEN IF Tube_Found%
= 92 THEN Exact%%
= TRUE
ELSE Exact%%
= FALSE
IF GetCursorPos
(Mp
) THEN 'get current mouse Position to restore when finished tempX% = Mp.Mx: tempY% = Mp.My
' _MOUSEMOVE temp_X%, temp_Y%
exitflag%% = TRUE
IF GetAsyncKeyState
(&H1B) THEN theitem$(a) = theitem$(a) + "{ESC}"
exitflag%% = TRUE 'ESC key exits loop
'SYSTEM
'SCREEN temp&
'_PUTIMAGE (0, 0)-(320, 200), Test&, _DISPLAY, (0, 0)-(320, 200)
'LINE (RF.left, RF.top)-(RF.left + 10, RF.top + 10), _RGB32(255, 255, 0), B
PRINT Tube_Found%
, Exact%%; tempX%
, tempX%
Result%% = FALSE
Result%% = TRUE: RF.top = y%: RF.left = x% 'store where the red was found
x% = Dx& + 1: y% = Dy& + 1 'exit loops upon a find
Find_Red = Result%%
FOR adj%
= RF.top
TO RF.top
- 3 STEP -1 'make sure we find top of YouTube Icon Colr~&
= POINT(RF.left
, adj%
) Result% = start% - shftY%%
Shift_UP = Result%
FOR adj%
= RF.left
TO RF.left
- 3 STEP -1 'make sure we shift left some, get better centering match Colr~&
= POINT(adj%
, RF.top
) Result% = start% - shftX%%
Shift_LEFT = Result%
FOR y%
= RF.top
TO RF.top
+ 10 'adjust Y to top of icon FOR x%
= RF.left
TO RF.left
+ 10 checking~&
= POINT(x%
, y%
) Result% = hit%
Check_Tube = Result%