Jump to content

AutoIt Script works fine 64bit but not 32bit


Recommended Posts

This script is meant to be used on a full screen program. It works fine on 64bit yet it does not work on the 32bit. It will just spam into a window.

#Include <Misc.au3>

While 1
    If _IsPressed(76) then click() ; F7 key
    Sleep (25)
WEnd

Func click()
While 1


Send ("w")
Send ("w")
Send ("e")
Send ("r")
Wend
    EndFunc

What seems to be the problem?

Link to comment
Share on other sites

  • 2 months later...

I'm sorry to up this topic, but i've got the same problem of this guy. AutoIt works good on every 64 pc's of my friends, but, on the 32, when u try to start it, it comes this error:

Posted Image

Thank you for the attention.

Link to comment
Share on other sites

This isn't the complete source code, but the code segment concerning the discussed error (variable declaration and its usage as array):

HotKeySet("{NUMPAD1}", "start")
[...]

Global $O[2]
Global $M_coord[2]
[...]

while (1)
WEnd


Func start()
    calc()
    [...]
EndFunc

Func calc()
    $O=PixelSearch(0,0,100,100,11577778)
    $M_coord[0]=$O[0]+670                    ; <---- Error!
    $M_coord[1]=$O[1]+40
EndFunc

I know the possible runtime error ($O not an array if PixelSearch() doesn't find any corresponding pixel) isn't handled here. But my real problem is that...on a 64bit OS the script works greatly, but the same on 32bit gives me the posted error pressing 'NUMPAD1' when the script's running. Am I using wrong array declaration? Is there a specific 32bit obligation form? (Mmm...I'm not sure that's real English... xD )

Link to comment
Share on other sites

I already knew that:

$O not an array if PixelSearch() doesn't find any corresponding pixel

And I'm quite sure that the error occurs because PixelSearch() doesn't find any matching pixel, and so $O isn't initialized as an array.

But my problem still remains on the different OS...

But you post make me think about this function...and so I wrote a little stupid script:

$O=PixelSearch(0,0,1000,800,2449372)
MouseMove($O[0],$O[1])

And it returns the same kind of error. I'm 100% sure that the decimal color exists on the screen (it's the light blue of Windows XP window title bar, and I get it through PixelGetColor()). And obviously...it works on 64bit!

So now I'm really puzzled about this AutoIT function and its compatibility with x86 System!

Link to comment
Share on other sites

Don't create and then try to use an array without checking to see if an array was created.

$O=PixelSearch(0,0,1000,800,2449372)
If IsArray($O) Then
    MouseMove($O[0],$O[1])
EndIf

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

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