Sign in to follow this  
Followers 0
aydin

Help needed declaring variant

9 posts in this topic

#1 ·  Posted (edited)

Ok, I've only just got AutoIt and have started to create a program.

However, when I try to run the program I get this error:

Line 13:

Dim $a = 0

Error: Unknown commmand.

I can't understand why it brings up an error with this...

Am I missing something that is required when declaring a variable?

All help apppreciated.

Thanks.

Edited by aydin

Share this post


Link to post
Share on other sites



Are you sure you installed AutoIt v3?

Share this post


Link to post
Share on other sites

Are you sure you installed AutoIt v3?

<{POST_SNAPBACK}>

:lmao: Yes..

I've tried running the script through AutoIt and I've compiled it to .exe but I still get the same error.

Share this post


Link to post
Share on other sites

Could you post your script, please. The error maybe being caused by some other line?

:lmao:

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Ok, here's the code for it:

Dim $a = 0


; Running IE

    Run, C:\\Program Files\\Internet Explorer\\iexplore.exe
    Sleep,3000
    LeftClick, 380,100
    Send, www.website.com{ENTER}
    Sleep, 5000
    LeftClick, 200,400
    Sleep, 3000

    
; Open Window

    LeftClick, 800,400
    Sleep, 3000

    
    Do

; 1    

    LeftClick, 74,283
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 2    

    LeftClick, 74,283
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 3    

    LeftClick, 74,258
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,217
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,193
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,210
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,245
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000

    
; 4    

    LeftClick, 74,283
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 5    

    LeftClick, 74,258
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,240
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,170
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 6    

    LeftClick, 74,283
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 7    

    LeftClick, 74,258
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,170
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,218
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,260
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,268
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 8    

    LeftClick, 74,283
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 9    

    LeftClick, 74,258
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,193
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,218
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,190
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000


; 10    

    LeftClick, 74,258
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,267
    Sleep, 500
    LeftClick, 180,315
    Sleep, 500
    LeftClick, 74,170
    Sleep, 500
    LeftClick, 180,315
    Sleep, 5000

    $a = $a + 1


    Until $a = 2

    Exit

Sorry about the messy layout :lmao:

It's just a basic program that navigates through a webpage..

Edited by aydin

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

That is version 2.64 syntax of Autoit. That is why you are getting the error.

Edit: You may need to use Goto, if you are using v2.64. Or convert your script to v3.1, if you have Autoit v3.1.

Edited by MHz

Share this post


Link to post
Share on other sites

That is version 2.64 syntax of Autoit. That is why you are getting the error.

<{POST_SNAPBACK}>

Damn.. what a stupid mistake. lol

Thanks for the help :lmao:

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

After installing AutoIt 3 and changing most of my code it worked fine. Thanks again.

[Edit]

Does anyone know if a program can be left running.. allowing me to use the mouse to do something else? I've got a feeling this is impossible :lmao:

Edited by aydin

Share this post


Link to post
Share on other sites

for website's : i think its impossible (for now)

for the rest: use control click and you don't need ya mouse


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0