badboy2k Posted April 26, 2006 Share Posted April 26, 2006 hi, For $i=1 to 18 Step +1 blabla() next that does work but if i take variables, instead of numbers, it does not uses the for count, while compiling there is no error. for example: that does not work dim $test1, $test2 $test1=3 $test2=15 For $i= $test1 to $test2 Step +1 blabla() next does anyone know what is wrong? or is it a bug? thanks Link to comment Share on other sites More sharing options...
Simucal Posted April 26, 2006 Share Posted April 26, 2006 (edited) First... You can get rid of the Step part of your for loop. The default is to step by positive 1. Secondly, AutoIt allows variables to be created on the fly, so you dont need to Dim those variables unless you want to. This works for me: $Var1 = 10 $Var2 = 15 For $i = $Var1 to $Var2 MsgBox(0,"For Test","Current $i value is: "&$i) Next Edited April 26, 2006 by Simucal AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
Simucal Posted April 26, 2006 Share Posted April 26, 2006 Just to completely answer you question: dim $test1, $test2 $test1=3 $test2=15 For $i= $test1 to $test2 Step +1 MsgBox(0,"For Test","Current $i value is: "&$i) next Works for me also. It looks like the problem might lie in the function you are calling with the For loop. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
badboy2k Posted April 26, 2006 Author Share Posted April 26, 2006 lol, it works. thank u. i changed nothing but made 2 variables global wich i read out from an .ini file. autoit is pretty cool! 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