Jump to content

Loop Problem


Recommended Posts

Hi,

This is my first post then before anything else I would like to thank the author of autoit. It's really a great piece of work.

I already made a lot of scripts with previous versions of autoit, now I'm trying to be familiar with autoit3.

I have a problem with loops.

I want to check if a window exists every 10 miliseconds if yes --> kill it and send a {numlock off} and {numlock on} every 14 minutes (the numlock off/on is for the screensaver doesn't activate)

This is the last version of the code I wrote :

$j=0

Do
; KILL WEBSCANX
$i = 0
For $i = 0 to 84500 Step +1
    If WinExists("WebScanX") Then
    WinKill("WebScanX", "")
    sleep(10)
next

; NUMLOCK
    Send("{NUMLOCK off}")
    Send("{NUMLOCK on}")

Until $j = 10

also tried while/wend but always same kind of error message "x statement with no matching y statement" :

Line 12  (File "C:\Documents and Settings\xxx\Desktop\scanxscreen.au3"):

next

Error: "Next" statement with no matching "For" statement.

Thanks in advance

Link to comment
Share on other sites

Local $Numlock = 1
AdlibEnable( "_NumlockFunc" , 14 * 60 *1000 )
Func _NumlockFunc()
Select
Case $Numlock = 1 
Send( "{numlock off}" )
$Numlock = 0
Case $Numlock = 0
Send("{numlock off}" )
$Numlock = 1
Endselect
EndFunc

While 1
   If WinExists("WebScanX") Then WinKill("WebScanX", "")
   If WinExists("Screensaver") Then
    WinKill("Screensaver", "")
    sleep(10)
   EndIf
Wend

Edited by Daniel W.

--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Link to comment
Share on other sites

  • 1 month later...

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...