Sign in to follow this  
Followers 0
Redundant

AutoIt Script works fine 64bit but not 32bit

11 posts in this topic

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?

Share this post


Link to post
Share on other sites



Share this post


Link to post
Share on other sites

I compiled and ran this code on a 32bit machine. It does not send these letters to the full screen application. On a 64bit machine, it works. I even forced the program into windowed mode. That didn't change a thing.

Share this post


Link to post
Share on other sites

How do you know the difference between 32 and 64 bit is the problem? I assume you tested your program on two machines. I bet it is the fact that they are two completely different machines that causes the bug.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Do you have the source code?

It looks like a bad programming array error.

Share this post


Link to post
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 )

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I'm putting all my money on that PixelSearch doesn't return an array when an error occurs.

Edited by Kip

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Are you sure both computers have the same style applied? You might want to increase the shade variation.

Share this post


Link to post
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!"

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