Ich versuche eine möglichkeit zu finden das ein autoit program sich neustartet sobald er auf einem server eine gewisse datei sieht. versucht habe ich das mit Inetget. aber das stresst den Computer und ist somit nicht effektiv.
ich weiß leider nicht wie ich das angehen soll und da meine Geburtstag heute ist muss ich mich jetzt auf eine Feier vorbereiten. Vielleicht mag hier jemand das denken für mich übernehmen oder mir zumindestend eine idee liefern. ich wäre euch sehr Verbunden.
Das ist das Testscript. Das script darf auch kaum Prozessor Zeit wegnehmen. Stoße ich mit dem Wunsch an autoits grenzen?
Code
#include <INet.au3>
Global $7zurl = "http://127.0.0.1"
While 1
sleep(2)
If NOT(_INetGetSource($7zurl) = "") Then
Local $internet = "1"
Else
Local $internet = "0"
EndIf
$iTime = TimerInit()
if $internet = "1" Then
InetGet($7zurl & "/strings/lappen/1.txt", @ScriptDir & "1.txt")
EndIf
if FileExists(@Scriptdir & "1.txt") Then
Run(@ScriptFullPath)
sleep(1)
Exit
EndIf
$TimeEnd = Round(TimerDiff($iTime) / 1000, 3)
;MsgBox(0, 'Finished ', 'Time: ' & $TimeEnd & ' seconds and Internet Connection is ' & $internet)
WEnd
Alles anzeigen
falls es bei euch vorkommt das das script sich zig mal neustartet hämmert in die CMD "TaskKill /F /IM Autoit.exe /T".