Jump to content

ChkIE


Recommended Posts

Hi, My brothers are spending an unearthly amount of time on games, etc..

So i decided to make a program to block them, well redirect them to a page. I've used this script

CODE
#include <Date.au3>

#include <IE.au3>

#NoTrayIcon ;Hide the tray icon on startup

While 1

ChkIE("Military Mayhem")

ChkIE("Military Mayhem - Landing Zone and Deployment")

ChkIE("InfamousGangsters.com")

Sleep(5000)

WEnd

Func ChkIE($WhichIE)

_IEErrorHandlerRegister("MyErrFunc")

$oIE = _IEAttach($WhichIE, "text")

$LogWriteTemp = _Now() & " - " & @ComputerName & " - RedirectingFrom: " & _IEPropertyGet($oIE, "locationurl")

If StringRight($LogWriteTemp, 3) <> ": 0" Then

FileWriteLine(@ScriptDir & "\chkwnd.dat", $LogWriteTemp)

_IEBodyWriteHTML($oIE, '<h1 align="center">Military Mayhem is offline at the moment, due to server issues.<b> Sorry for any inconvience.</h1>')

EndIf

EndFunc ;==>ChkIE

Func MyErrFunc()

; Do nothing on an error and keep going.

EndFunc ;==>MyErrFunc

What I dont get is

CODE

While 1

ChkIE("Military Mayhem")

ChkIE("Military Mayhem - Landing Zone and Deployment")

ChkIE("InfamousGangsters.com")

Sleep(5000)

WEnd

The first two are blocked, whereas the third one doesn't get blocked and allows you to play the game. Does anyone know where I'm going wrong?

Edited by N340
Link to comment
Share on other sites

OK, for whatever reason I think you need to have the full url as it is the name "http://infamousgangsters.com/"

I like what you have but this is what I used to check it

_WINCHECK()

Func _WINCHECK()
While(1)
If WinExists("Military Mayhem", "") Then
    WinKill("Military Mayhem", "")
ElseIf WinExists("Military Mayhem - Landing Zone and Deployment", "") Then
    WinKill ("Military Mayhem - Landing Zone and Deployment", "")
ElseIf WinExists("http://infamousgangsters.com/", "") Then
    WinKill("http://infamousgangsters.com/", "")
EndIf
WEnd
EndFunc
Link to comment
Share on other sites

Hi, Thanks for replying, I don't want to so much kill the process because then the ranting starts from my brothers ( they'll know its me) But my script searches for those in the IE title name the third is the title name. Even though it looks like a web address. Like say Google's title name may be Google.com at the top of the screen.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...