Eraston Posted January 16, 2013 Share Posted January 16, 2013 (edited) First off, i would like to apologize if this has been asked anywhere but i have been messing with this for days and have not found a solution. What i am hoping to achieve is simple, very simple Automated right clicks and 2 key clicks (Right click x4, F2, Right click, F1, repeat) what is making this so difficult is i need to call a DLL and close it after every function, therefor i cant (or i dont know how?) use the simple Send function. With the code bellow, all works except the Key inputs are completely skipped and it just continously right clicks. I am fairly new to this so please bear with me if this looks sloppy or completly wrong. expandcollapse popupWhile 1 Local $dll = DllOpen("EXAMPLEDLL.dll") if $dll <> -1 Then $leftclick=1; $rightclick=0; $mousedown=1; $mouseup=0; $v_key=71; $v_key2=70; $keydown=1; $keyup=0; $result3 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mousedown) Sleep(50); $result4 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mouseup) Sleep(50); DllClose($dll) Sleep(500) $result3 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mousedown) Sleep(50); $result4 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mouseup) Sleep(50); DllClose($dll) Sleep(500) $result3 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mousedown) Sleep(50); $result4 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mouseup) Sleep(50); DllClose($dll) Sleep(500) $result3 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mousedown) Sleep(50); $result4 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mouseup) Sleep(50); DllClose($dll) Sleep(500) sleep(700) $result7 = DllCall($dll, "int", "KeyboardInput", "int", $v_key, "int", $keydown) Sleep(50); $result8 = DllCall($dll, "int", "KeyboardInput", "int", $v_key, "int", $keyup) DllClose($dll) sleep(700) $result3 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mousedown) Sleep(50); $result4 = DllCall($dll, "int", "SendMouseClick", "int", $rightclick, "int", $mouseup) Sleep(50); DllClose($dll) Sleep(500) $result7 = DllCall($dll, "int", "KeyboardInput", "int", $v_key2, "int", $keydown) Sleep(50); $result8 = DllCall($dll, "int", "KeyboardInput", "int", $v_key2, "int", $keyup) DllClose($dll) sleep(500) endif WEnd Edited January 16, 2013 by Eraston Link to comment Share on other sites More sharing options...
water Posted January 16, 2013 Share Posted January 16, 2013 Welcome to AutoIt and the forum! I searched for "GreenMacro" on the web and found it to be game related. Please read our forum rules (link is in the lower right corner of this page) and you will see that game automation isn't allowed here. "Green Macro can bypass x-trap. It's actually a keyboard/mouse driver. You can use your own scripting language such as AUTOIT, AutoHotKey to call Green Macro keyboard/mouse/pixel functions which are blocked by x-trap" My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 16, 2013 Moderators Share Posted January 16, 2013 (edited) Eraston,Welcome to the AutoIt forum. When I Google "GreenMacroDLL" I get lots of hits on gaming sites suggesting that this DLL is an possible way to bypass gamebot protection in some games. If that is indeed the case, please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation and Bypassing of security measures - anti-bot agents - before you post again. If not then please explain exactly what you are trying to do with this DLL. M23 Edited January 16, 2013 by Melba23 Typo 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...
jchd Posted January 16, 2013 Share Posted January 16, 2013 Trying to cover your ass after the fact by masquerading the DLL name instead of answering the question of a moderator was a childish, idiotic move and will certainly speed up closing of this thread. Really bad start here. water 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 16, 2013 Moderators Share Posted January 16, 2013 Eraston, As jchd has pointed out, we are not stupid - thread locked and you are now firmly on my radar. 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