AC130
Active Members-
Posts
86 -
Joined
-
Last visited
AC130's Achievements
Wayfarer (2/7)
0
Reputation
-
What excellent customer service.
-
How do you stop a long period of sleep? For instance: Sleep(5000) What If I want to interrupt that sleep? I tried Sleep(1), but that didn't work. Maybe I can put sleep in a Do/Loop and declare a function that stops the loop? It would work, but I think there maybe other ways to achieve my goal. Any ideas?
-
I don't even care anymore... Just patch it eventually, please. I would like to use it sometime or later.
-
I've made progress... Turns out you don't use the Shade/Step/Handle parameters. It will result in the errors above, so this is the only thing I've gotten to work: Public Declare Function AU3_PixelSearch Lib "AutoItX3" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal Color As Integer) As Integer However, I think there may be a problem with the Color parameter. I've tried normal colors such as &HFDF3C8,&HFFFFFF, &HFFCCCC, and they all resulted in some sort of P/Invoke error. I then tried &H0 and no errors occured - at all. Any ideas?
-
You're right, it isn't, but I've tried every other possible declaration... Public Declare Function AU3_WinGetHandle Lib "AutoItX3" (ByVal Title As String, ByVal Text As String, ByVal szText As String, ByVal BufferSize As Integer) As Integer Public Declare Function AU3_PixelSearch Lib "AutoItX3" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal Color As Integer, ByVal Shade As Integer, ByVal Skip As Integer, ByVal Handle As IntPtr) As Integer Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim szHandle As Char = CChar(CStr(256)) Dim Handle = AU3_WinGetHandle("Untitled - Notepad", "", szHandle, 128) AU3_PixelSearch(1, 1, 1024, 768, &H0, 0, 1,CType(Handle, IntPtr)) End Sub Error: The runtime has encountered a fatal error. The address of the error was at 0x6f063688, on thread 0x1954. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
-
And, I'm not bashing AutoIt. I'm saying I've tried every possible declaration and it still won't work. Public Declare Function AU3_PixelSearch Lib "AutoItX3" (ByVal nLeft As Integer, ByVal nTop As Integer, ByVal nRight As Integer, ByVal nBottom As Integer, ByVal nCol As Integer, Optional ByVal nVar As Integer = 0, Optional ByVal nStep As Integer = 1, Optional ByVal LPPOINT As IntPtr = Nothing) As Integer Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Do AU3_PixelSearch(1, 1, 1024, 768, &H0) Loop End Sub Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. If I'm doing something wrong, then show me. How can you say I don't know what I'm doing if you don't even know me? I sure as hell know how to call a damn function, hince why ALL THE OTHER FUNCTIONS WORK FINE.
-
Is all this necessary? I'm not even the only one having this problem.
-
Thus far, I only can't get PixelSearch working. I have yet to try error, and Send works great. I used to have a problem with MouseClick; it also wouldn't work, but I tried using an older DLL, and it worked. (I was using the latest version). I tried swapping DLL's numerous amounts of times to try PixelSearch, but none worked. I posted the declarations above. Edit: Oh yeah, I gave up on WinGetHandle. So, that too.
-
Yes, PixelSearch just will not work in AutoItX. We've both referenced it correctly. I tried using older/newer DLL's, but still no success.
-
Yes, I know the VB.NET equivalent's for AutoIt; SendWait for Send, GetPixel for PixelSearch, and I don't really need an error return. Just let me know when you get everything setup, please. It just really irritates me that only one function won't work!
-
I only have three functions left that I need to import from AutoItX: AU3_API void WINAPI AU3_PixelSearch(long nLeft, long nTop, long nRight, long nBottom, long nCol, /*default 0*/long nVar, /*default 1*/long nStep, LPPOINT pPointResult); AU3_API void WINAPI AU3_Send(const char *szSendText, /*[in,defaultvalue(0)]*/long nMode); AU3_API long AU3_error(void); I've tried PixelSearch as stated above, and it's not working. I thought I had tried error, but it turns out the reason it wasn't working was because PixelSearch wasn't working, thus the error I was receiving was from PixelSearch, not error. It will probably work once I get PixelSearch working. I haven't tried send yet, because I like to go in order, but I'm fairly sure it will work. I'm starting to think that the problem is in AutoItX itself, and not API/VB.NET. Do you mind posting your declarations in C#, since that what's your familiar with? I'll probably have a better chance that way. Thank you for taking the time to help.
-
The thread is in C# and doesn't have the WinGetHandle declaration. I think that's the thread you're referring to, anyway... Owell, just one last problem then. What's up with pixelsearch? I know this declaration is correct, but results in the same error as what we were experiencing with WinGetHandle: Public Declare Sub AU3_PixelSearch Lib "AutoItX3" (ByVal nLeft As Integer, ByVal nTop As Integer, ByVal nRight As Integer, ByVal nBottom As Integer, ByVal nCol As Integer, Optional ByVal Shade As Integer = 0, Optional ByVal nStep As Integer = 1, Optional ByVal hWnd As String = "") I tried "hWnd" with IntPtr instead of string, but still the same error. It's probably because I may be calling it wrong. AU3_PixelSearch(1,1,1,1,&HFFFFFF) I also tried setting the PixelCoordMode, but no success. My only guess is the color is wrong. AI uses Hex, but VB.NET uses RGB. This should really be the last problem I'm having.
-
Edit: It's a different error now... Actually, two. The runtime has encountered a fatal error. The address of the error was at 0x5e41a520, on thread 0x1518. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack. After I press continue... Exception of type 'System.ExecutionEngineException' was thrown.
-
I copied it exactly as you have posted, and it resulted in error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
-
Public Declare Function AU3_WinGetHandle Lib "AutoItX3" (ByVal Title As String, Optional ByVal Text As String = "", Optional ByVal szText As String = "", Optional ByVal Buffer As Integer = 256) As Char