Jump to content

Mouse Move... I am newer to this than I thought...


Go to solution Solved by Jfish,

Recommended Posts

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

 

 
Posted

I am not doing this for a living right now...

But syntax checking gives me this:

post-24135-0-02311600-1418255492_thumb.p

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.

 

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

 

 
Posted

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

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

 

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...