Draygoes Posted December 10, 2014 Share Posted December 10, 2014 (edited) I have been trying to get back into Autoit, so I decided to try somthing simple. #include <MsgBoxConstants.au3> HotKeySet( "{ESC}", "out") Func out() Exit EndFunc While 1 x = Random( 0,30000,1) y = Random ( 0,30000,1) MouseMove( x, y, 1) WEnd I know that it looks like somthing for play, and that is because it is. Where did I go wrong? Thank you all for your time. Again, this is just a test. Edited December 10, 2014 by Draygoes Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
lorenkinzel Posted December 10, 2014 Share Posted December 10, 2014 "Where did I go wrong?" You didn't do a syntax check. Hint: If you were doing this for a living, that would cost you $ Link to comment Share on other sites More sharing options...
Draygoes Posted December 10, 2014 Author Share Posted December 10, 2014 I am not doing this for a living right now... But syntax checking gives me this: The debugger gives this >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:UsersAdminDesktopMouse.au3" /UserParams +>17:53:10 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:Program Files (x86)AutoIt3SciTE UserDir => C:UsersAdminAppDataLocalAutoIt v3SciTEAutoIt3Wrapper SCITE_USERHOME => C:UsersAdminAppDataLocalAutoIt v3SciTE >Running AU3Check (3.3.12.0) from:C:Program Files (x86)AutoIt3 input:C:UsersAdminDesktopMouse.au3 "C:UsersAdminDesktopMouse.au3"(7,24) : error: Statement cannot be just an expression. x = Random( 0,30000,1) ~~~~~~~~~~~~~~~~~~~~~~^ "C:UsersAdminDesktopMouse.au3"(8,25) : error: Statement cannot be just an expression. y = Random ( 0,30000,1) ~~~~~~~~~~~~~~~~~~~~~~~^ "C:UsersAdminDesktopMouse.au3"(7,4) : error: x(): undefined function. x = ~~^ "C:UsersAdminDesktopMouse.au3"(8,4) : error: y(): undefined function. y = ~~^ C:UsersAdminDesktopMouse.au3 - 4 error(s), 0 warning(s) !>17:53:10 AU3Check ended. Press F4 to jump to next error.rc:2 +>17:53:11 AutoIt3Wrapper Finished. >Exit code: 2 Time: 0.5284 I wish to learn, not to have a simple script like this written for me. But this used to work. Now, other scripts do not work, so I tried with the basic stuff that I had learned. It does not work. The help file doesnt help much, and I am not sure why... ; Flip a coin. Example() Func Example() If Random(0, 1, 1) Then ; Return an integer between 0 and 1. MsgBox($MB_SYSTEMMODAL, "", "The side of the coin was: Heads") ; If the random integer was 1 then heads was thrown. Else MsgBox($MB_SYSTEMMODAL, "", "The side of the coin was: Tails") ; If the random integer was 0 then tails was thrown. EndIf EndFunc ;==>Example I know that is a lot different from what I am asking for, but the function is written out similer enough that I thought that I understood. Again, thank you for your time, and thank you for the quick response. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
lorenkinzel Posted December 11, 2014 Share Posted December 11, 2014 The helpfile can help. Declaring variables. Variable$ Link to comment Share on other sites More sharing options...
Solution Jfish Posted December 11, 2014 Solution Share Posted December 11, 2014 #include <MsgBoxConstants.au3> HotKeySet( "{ESC}", "out") Func out() Exit EndFunc While 1 $x = Random( 0,30000,1) $y = Random ( 0,30000,1) MouseMove( $x, $y, 1) WEnd Draygoes 1 Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
lorenkinzel Posted December 11, 2014 Share Posted December 11, 2014 I was certain that the OP was going to get it on this round. My intent was not to toy with Draygoes & I realized the first hint was a bit subtle. Link to comment Share on other sites More sharing options...
Draygoes Posted December 11, 2014 Author Share Posted December 11, 2014 (edited) #include <MsgBoxConstants.au3> HotKeySet( "{ESC}", "out") Func out() Exit EndFunc While 1 $x = Random( 0,30000,1) $y = Random ( 0,30000,1) MouseMove( $x, $y, 1) WEnd Even that shows errors. I am not sure why. Thank you for your help. >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:UsersAdminDesktopNew AutoIt v3 Script.au3" /UserParams +>22:56:03 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:Program Files (x86)AutoIt3SciTE UserDir => C:UsersAdminAppDataLocalAutoIt v3SciTEAutoIt3Wrapper SCITE_USERHOME => C:UsersAdminAppDataLocalAutoIt v3SciTE >Running AU3Check (3.3.12.0) from:C:Program Files (x86)AutoIt3 input:C:UsersAdminDesktopNew AutoIt v3 Script.au3 "C:UsersAdminDesktopNew AutoIt v3 Script.au3"(4,7) : error: syntax error Exit EndFunc ~~~~~^ "C:UsersAdminDesktopNew AutoIt v3 Script.au3"(9,2) : error: syntax error WEnd ^ "C:UsersAdminDesktopNew AutoIt v3 Script.au3"(9,2) : error: Statement cannot be just an expression. WEnd ^ C:UsersAdminDesktopNew AutoIt v3 Script.au3 - 3 error(s), 0 warning(s) !>22:56:04 AU3Check ended. Press F4 to jump to next error.rc:2 +>22:56:04 AutoIt3Wrapper Finished. >Exit code: 2 Time: 1.464 I fixed the problem, it was a copy issue, and I now remember a lot. Thanks guys! Edited December 11, 2014 by Draygoes Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
lorenkinzel Posted December 11, 2014 Share Posted December 11, 2014 The script does work IF the lines are as posted by Jfish. for example, your error readout has ExitEndFunc when you should have Exit EndFunc I never thought or said that you are simple. If my statements portrayed that I apologize. I've been told that I can come off as an A-hole at times, but what does my wife know? So let's get this working. The code in your first post works if you only add the "$" before each case of the variable "x" & "y". Draygoes 1 Link to comment Share on other sites More sharing options...
Draygoes Posted December 11, 2014 Author Share Posted December 11, 2014 (edited) The script does work IF the lines are as posted by Jfish. for example, your error readout has ExitEndFunc when you should have Exit EndFunc I never thought or said that you are simple. If my statements portrayed that I apologize. I've been told that I can come off as an A-hole at times, but what does my wife know? So let's get this working. The code in your first post works if you only add the "$" before each case of the variable "x" & "y". When I went back over the code, I noticed the mestake in copying it wrong. Sorry I misunderstood you, and thank you very much for your help. I totally forgot the "$" sign was a thing in autoit lol Edited December 11, 2014 by Draygoes Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. 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