Konzine Posted October 4, 2011 Posted October 4, 2011 Hello, I am attempting to write a script that looks at a webpage for a value (in example "shutdown" would display as simple text), and then uses that to shutdown a process. I had one before years ago, unfortunately I have completely forgotten how I came about it. Something very basic I've been trying.. If InetRead("http://konzine.com/lol" ="shutdown") Then ProcessClose("notepad.exe") EndIf Any ideas?
Konzine Posted October 4, 2011 Author Posted October 4, 2011 Brain fart. If InetRead("http://konzine.com/lol")="shutdown" Then ProcessClose("notepad.exe") EndIf Works fine. Another question, though; Is there a way I can set the script to be running constantly, and check the webpage every say 60 seconds?
Konzine Posted October 4, 2011 Author Posted October 4, 2011 Seems this is coming back to me faster than I expected, so I'll just keep documenting it until I run into another problem; For keeping the script looping I am using While 1 WEnd, and using sleep to rerun the script every 60 seconds or so. Right now I have it set to 3 seconds for testing purposes; While 1 If InetRead("http://konzine.com/")="shutdown" Then ProcessClose("notepad.exe") Else MsgBox( 4096, "Test", "This box will time out in 3 seconds", 3) EndIf Sleep(3000) WEnd
Konzine Posted October 4, 2011 Author Posted October 4, 2011 Seems to be working ok. Since I have basically completed the fundamentals of the script I am now working on features here. This little update checks to see if notepad is running and if not Produces a MessageBox (this could easily be substituted with a sleep.) While 1 If ProcessExists ("notepad.exe") Then If InetRead("http://konzine.com/lol")="shutdown" Then ProcessClose("notepad.exe") EndIf Else MsgBox( 4096, "Test", "This box will time out in 3 seconds", 3) EndIf Sleep(3000) WEnd
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now