GeoTrail Posted March 19, 2004 Share Posted March 19, 2004 I'm experimenting with some of the functions in the latest version of AutoIt 3 build 101. When I run this code I want the script to end if the value $Loop is NOT numeric and continue on if the value is numeric but all I get is error. I've tried using If IsNumber($Loop) Then too but that didn't work either. Is there something wrong with my code or is there a bug with that function? $Loop = InputBox ( "Enter loop ammount", "Please enter the number of times the mouse should move." & " A too larg ammount is not recommended." & "Click on Cancel to about this option immidiatly." , "10") If @Error = 1 Then Exit EndIf If IsNumber($Loop) = 1 Then $file = FileOpen("movement.log", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $i = 0 Do $i = $i + 1 $Height = round(Random(1,@DesktopHeight), -1) $Width = round(Random(1,@DesktopWidth), -1) MouseMove($Width, $Height) FileWriteLine($file, "Movement number " & $i &". Mouse moved to position " & $Width & "x" & $Height & " at " & @HOUR&":"&@MIN&":"&@SEC) Until $i = 10 FileClose($file) Else MsgBox(0,"Error","The value you entered is NOT a numeric value!") Exit EndIf GeoTrail Corporation Link to comment Share on other sites More sharing options...
GeoTrail Posted March 19, 2004 Author Share Posted March 19, 2004 Aaaaa I see. Didn't even think about that. Thanks Larry. BTW, don't you ever sleep? Everytime I'm in here I see you lurking around GeoTrail Corporation Link to comment Share on other sites More sharing options...
GeoTrail Posted March 19, 2004 Author Share Posted March 19, 2004 (edited) He he he sounds like a versitail guy. I have used computers since C64 was the latest fasion. I used to work at a bus garage before I joined to army. After the army I have concentrated on programming and other computer related fields. Edited March 19, 2004 by GeoTrail GeoTrail Corporation Link to comment Share on other sites More sharing options...
Valik Posted March 19, 2004 Share Posted March 19, 2004 I have 24/7 internet everywhere I am... Central US time you will not see me from 1 am to 8 am. Otherwise, when I am home or at work, I have a computers everywhere...I am hoping to start doing work as a handyman and changing all that. My first love is carpentry, mechanics, and generally fixing things.... I fell into computers cause it's boringly stable...LAr.How long before you fix your "rent-a-boss" by taking your hammer to his head? Link to comment Share on other sites More sharing options...
GeoTrail Posted March 19, 2004 Author Share Posted March 19, 2004 Hmm seems like I'm missing something here GeoTrail Corporation 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