WikiView Posted October 12, 2006 Share Posted October 12, 2006 (edited) so far i got this; AutoItSetOption("TrayIconHide", 1) Sleep(1000) call("mainloop") func mainloop() $var = ping("www.google.dk", 5000) if $var Then sleep(10000) call("mainloop") Else call("loopster") EndIf EndFunc func loopster() $i = 0 $kald = ping("www.google.dk", 1000) Do ToolTip("u got 30 sec or else ur comp is gonna reboot") if $kald then tooltip("") call("mainloop") Else sleep(1000) $i = $i + 1 EndIf until $i = 30 shutdown(5) EndFunc the problem is that it doesnt call the main loop and it just keeps idling untill it reboots.. is it just me or ? Edited October 12, 2006 by WikiView Link to comment Share on other sites More sharing options...
Froed Posted October 12, 2006 Share Posted October 12, 2006 (edited) First problem are the recursive function calls. The program will crash sooner or later due to stack overflow. Here is a script that does the same, but without recursive calls: AutoItSetOption("TrayIconHide", 1) Sleep(1000) While ping("www.google.dk", 5000) Sleep(10000) Wend For $i = 1 to 30 ToolTip("u got 30 sec or else ur comp is gonna reboot") Sleep(1000) Next shutdown(5) Edited October 12, 2006 by Froed Link to comment Share on other sites More sharing options...
jinxter Posted October 12, 2006 Share Posted October 12, 2006 (edited) hmm... so if you're experience a glitch in the network connection your computer is going to be restarted... I guess all companies should have that function Edited October 12, 2006 by jinxter > there are 10 types of people in the world, those who understand binary and those who don't. Link to comment Share on other sites More sharing options...
WikiView Posted October 13, 2006 Author Share Posted October 13, 2006 First problem are the recursive function calls. The program will crash sooner or later due to stack overflow. Here is a script that does the same, but without recursive calls: AutoItSetOption("TrayIconHide", 1) Sleep(1000) While ping("www.google.dk", 5000) Sleep(10000) Wend For $i = 1 to 30 ToolTip("u got 30 sec or else ur comp is gonna reboot") Sleep(1000) Next shutdown(5) well i need to program to call the pinging again when they plug in network cable. so far if it cant ping its just gonna reboot Link to comment Share on other sites More sharing options...
jinxter Posted October 13, 2006 Share Posted October 13, 2006 I should say... using a program with shutdown is a pretty wild idea, I would go for a simple msgbox() stating that the computer will shut down, at least until it works as intended. but... it feels that this program will shutdown after it triggers the for/next statement regardless of the ping status... better glue that rj-45 to the port ,eh ? > there are 10 types of people in the world, those who understand binary and those who don't. Link to comment Share on other sites More sharing options...
WikiView Posted October 13, 2006 Author Share Posted October 13, 2006 I should say... using a program with shutdown is a pretty wild idea, I would go for a simple msgbox() stating that the computer will shut down, at least until it works as intended.but... it feels that this program will shutdown after it triggers the for/next statement regardless of the ping status... better glue that rj-45 to the port ,eh ? hehe ya.thats why i want it so u can plug the RJ-45 again and it goes back to pinging our server (and not google as intended) Link to comment Share on other sites More sharing options...
jinxter Posted October 15, 2006 Share Posted October 15, 2006 just out of curiosity.... what is this program used for ? > there are 10 types of people in the world, those who understand binary and those who don't. Link to comment Share on other sites More sharing options...
WikiView Posted October 23, 2006 Author Share Posted October 23, 2006 just out of curiosity....what is this program used for ?im working as a admin in a technical education center in denmark.we got kids from 8th grade running around here, and they should be learning stuff but are playing instead.the leadership dont want a firewall on, and they want us to monitor the certain students that play flashgames in their spare time.but these kids download the flashgame and pull their network plug (cant say they arent smart) so we cant take screenshots of them playing.so pretty much i want to make a program that pings our server so when they pull the plug they got a timer on setting the plug back in or it reboots. 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