Berdar7 Posted February 19, 2017 Share Posted February 19, 2017 Hi, I am using autoitx in c#. My project is need to use ControlClik. But sometimes Autoit gives error. This error is Attempt to read or write protected memory. My code : [DllImport("AutoItX3.dll", CharSet = CharSet.Auto)] internal static extern int AU3_ControlClick([MarshalAs(UnmanagedType.LPWStr)] string title, [MarshalAs(UnmanagedType.LPWStr)] string text, [MarshalAs(UnmanagedType.LPWStr)] string control, [MarshalAs(UnmanagedType.LPWStr)] string button, int numClicks, int x, int y); AU3_ControlClick("BerkBot Browser", "", "[CLASS:WebPluginView; INSTANCE:1]", "left", 1, Rec.X, Rec.Y); I used try catch but always give memory exception. Link to comment Share on other sites More sharing options...
JohnOne Posted February 19, 2017 Share Posted February 19, 2017 It's wise to post full code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Berdar7 Posted February 19, 2017 Author Share Posted February 19, 2017 3 hours ago, JohnOne said: It's wise to post full code. public static bool BotSearch3D(Bitmap SmallBitmap, bool Click) { try { berkhandle = (IntPtr)FindWindow(null, "BerkBot Browser"); if (berkhandle == null || berkhandle.ToString() == "0") { GC.Collect(); return false; } else { Rectangle Rec = SearchBitmap(SmallBitmap, PrintWindow(berkhandle)); if (Rec.X > 0 && Rec.Y > 0) { AU3_ControlClick("BerkBot Browser", "", "[CLASS:WebPluginView; INSTANCE:1]", "left", 1, Rec.X, Rec.Y); GC.Collect(); return true; } GC.Collect(); return false; } } catch { GC.Collect(); return false; } } This is working in loop per 300 ms. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 19, 2017 Moderators Share Posted February 19, 2017 Berdar7, When I search for "Berkbot" I get a NY divorce lawyer and various gamebot hits. Have you read our Forum rules and can you assure me that this thread meets those requirements? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Berdar7 Posted February 20, 2017 Author Share Posted February 20, 2017 On 19.02.2017 at 11:04 PM, Melba23 said: Berdar7, When I search for "Berkbot" I get a NY divorce lawyer and various gamebot hits. Have you read our Forum rules and can you assure me that this thread meets those requirements? M23 Berkbot.net is my website and BerkBot is mine. Yes, this is gamebot and i made it. What is the problem ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 20, 2017 Moderators Share Posted February 20, 2017 Berdar7, Quote Yes, this is gamebot and i made it. What is the problem ? The problem is that the Forum rules to which I linked you above include the following: Quote Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: [...] Launching, automation or script interaction with games or game servers, regardless of the game. So this thread falls foul of the rules and has been locked. Please do read and respect our rules in future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts