Tiger Posted January 27, 2008 Share Posted January 27, 2008 I have wrote a script, that runs always. then the internet connection is active then show the trayicon. but the script start and close. #NoTrayIcon Opt("TrayIconDebug", 0) Opt("TrayMenuMode", 1) AdlibEnable("internet", 500) Func internet() If (Ping("www.google.de", 500) <> 0) And (Ping("www.yahoo.de", 750) <> 0) Then ; Show TrayIcon Opt("TrayIconHide", 0) Else ; Hide TrayIcon Opt("TrayIconHide", 1) EndIf EndFunc ;==>_internet My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
xzaz Posted January 27, 2008 Share Posted January 27, 2008 add it in a while? Small Color Picker v0.2 | Travian bot Link to comment Share on other sites More sharing options...
Tiger Posted January 27, 2008 Author Share Posted January 27, 2008 OK thanks. But i would like to stop the function then the internet connection is active an then is not active then i would licke to run the function My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
Squirrely1 Posted January 27, 2008 Share Posted January 27, 2008 (edited) You need an infinite loop: #NoTrayIcon Opt("TrayIconDebug", 0) Opt("TrayMenuMode", 1) HotKeySet("{F9}", "ExitModule") internet() AdlibEnable("internet", 10000) Func internet() If Ping("www.google.de") Or Ping("www.yahoo.de") Then Opt("TrayIconHide", 0) Else Opt("TrayIconHide", 1) EndIf EndFunc;==>internet While 1 Sleep(60) WEnd Func ExitModule() Exit EndFunc;==>ExitModule The above code works on my machine. Once program execution reached the end of the original version, it correctly exited. But with this line in your script: Opt("TrayMenuMode", 1) you needed a way to stop the program, and that is why you should have that ExitModule and the HotKeySet. Edited January 27, 2008 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Tiger Posted January 27, 2008 Author Share Posted January 27, 2008 Thanks Squirrely1. The script runs very good My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
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