robotronick Posted January 2, 2007 Share Posted January 2, 2007 (edited) Hi, Ive been looking around these forums a while now and havent seen anything related to my question. I know how to random choose between two sleep times being : Sleep(random(250,350)) oÝ÷ ØÚ0Z#§µçm¡Ú"²W¶¬r¸©¶¶§v¥ÉÈh¢ÇzÜz}ÚrبÄá¢Ç·iËb¢{æ¥W¶j.±ç%É,¢wb}÷«z{¢ÝvzĨ#§¶+m¡Èh¢Ç¨ê¶,{v§uÚ"¶Øb²+0«Hl¡ö«në]¡ë'· +«¢+ءɹ½´¡5½ÕÍ ±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÌäÀ°ÈäÀ°Ä°Ì¤¤°¡5½ÕÍ ±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°àÜÀ°ÔÌÀ°Ä°Ì¤¤°¡5½ÕÍ ±¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÈÀÔ°ØÐÀ°Ä°Ì¤¤¤ What Am I doing wrong? PLs help me out . Big thx!! Robotronick Edited January 2, 2007 by robotronick Link to comment Share on other sites More sharing options...
tmo Posted January 2, 2007 Share Posted January 2, 2007 use random(1,3) and look for Switch...Case...EndSwitch in the autoit helpfile Link to comment Share on other sites More sharing options...
robotronick Posted January 2, 2007 Author Share Posted January 2, 2007 ok this is what I got so far Switch @random Case 1 MouseClick("left", 390,290, 1, 3) Case 2 MouseClick("left", 870,530, 1, 3) Case 3 MouseClick("left", 205,640, 1, 3) EndSwitch random(1,3) but it still has an error somewhere? I think it has someting to do with the @random. Link to comment Share on other sites More sharing options...
frank10 Posted January 2, 2007 Share Posted January 2, 2007 ok this is what I got so farSwitch @randomCase 1 MouseClick("left", 390,290, 1, 3)you should make:Switch random(1,3)Case ....@random isn't an existing macro. Link to comment Share on other sites More sharing options...
robotronick Posted January 2, 2007 Author Share Posted January 2, 2007 SO now Ive add this and it doesnt give any errors but it doesnt do what I want? It doesnt click anywhere Switch random(1,3) Case 1 MouseClick("left", 390,290, 1, 3) Case 2 MouseClick("left", 870,530, 1, 3) Case 3 MouseClick("left", 205,640, 1, 3) EndSwitch pls help me out Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2007 Share Posted January 2, 2007 Switch random(1,3,1) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jjldj Posted January 2, 2007 Share Posted January 2, 2007 $rand = Random(1, 3, 1) Select Case $rand = 1 MouseClick("left", 390,290, 1, 3) Case $rand = 2 MouseClick("left", 870,530, 1, 3) Case $rand = 3 MouseClick("left", 205,640, 1, 3) EndSelect Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2007 Share Posted January 2, 2007 $rand = Random(1, 3, 1) Select Case $rand = 1 MouseClick("left", 390,290, 1, 3) Case $rand = 2 MouseClick("left", 870,530, 1, 3) Case $rand = 3 MouseClick("left", 205,640, 1, 3) EndSelectSwitch Random(1, 3, 1) Case 1 MouseClick("left", 390, 290, 1, 3) Case 2 MouseClick("left", 870, 530, 1, 3) Case 3 MouseClick("left", 205, 640, 1, 3) EndSwitch...works just fine... The OP only needed to add the flag "1" to have Random return an integer. Your code works as well - but no need for the extra code in the Case expression. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
robotronick Posted January 2, 2007 Author Share Posted January 2, 2007 Thx!! It works now just the way I wanted ! A little question: what does OP mean? :"> Link to comment Share on other sites More sharing options...
jjldj Posted January 2, 2007 Share Posted January 2, 2007 When I copy and run your code, I get the following: "Case" statement with no matching "Select" statement. Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2007 Share Posted January 2, 2007 Thx!! It works now just the way I wanted !A little question: what does OP mean? '>The person that made the Original Post, as in:The OP only needed to add the flag "1" to have Random return an integer-or- the Original Post itself, as in:See the code in the OP.Just forum shorthand. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
tmo Posted January 2, 2007 Share Posted January 2, 2007 Thx!! It works now just the way I wanted !A little question: what does OP mean? :">OP is the one who created the topic, i.e. you Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2007 Share Posted January 2, 2007 (edited) When I copy and run your code, I get the following:"Case" statement with no matching "Select" statement.Run it from within the SciTE editor and copy/paste/post the output:>"C:\Program Files\AutoIt3\SciTe\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "c:\Temp\SciTE-temp.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +> Starting AutoIt3Wrapper v.1.7.4>Running AU3Check (1.54.6.0) params: from:C:\Program Files\AutoIt3+>AU3Check ended.rc:0>Running:(3.2.2.0):C:\Program Files\AutoIt3\autoit3.exe "c:\Temp\SciTE-temp.au3" +>AutoIT3.exe ended.rc:0>Exit code: 0 Time: 1.759 Edited January 2, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jjldj Posted January 2, 2007 Share Posted January 2, 2007 Run it from within the SciTE editor and copy/paste/post the output:>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\.....\Desktop\Test.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams >Running AU3Check params: from:C:\Program Files\AutoIt3\SciTE\au3check\+>AU3Check ended.rc:0>Running:(3.1.1.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\.......\Desktop\Test.au3" C:\Documents and Settings\trsb0277\Desktop\Test.au3 (15) : ==> "Case" statement with no matching "Select" statement.: Case 1 ->AutoIT3.exe ended.rc:1>Exit code: 1 Time: 2.554 Link to comment Share on other sites More sharing options...
herewasplato Posted January 2, 2007 Share Posted January 2, 2007 ...>Running:(3.1.1.0):C:\Program Files\AutoIt3\autoit3.exe \...Consider upgrading to the current "production version"http://www.autoitscript.com/autoit3/downloads.php [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jjldj Posted January 2, 2007 Share Posted January 2, 2007 Consider upgrading to the current "production version"http://www.autoitscript.com/autoit3/downloads.phpAh, that would do it. Thanks. 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