Jaman Posted July 26, 2010 Share Posted July 26, 2010 Hey, I am using Auto It script and for some reason (after an hour or two) it's changing keyboard buttons. Keyboard buttons doesnt work properly and when I click with left mouse on desktop icons it marks them like I wanna copy something. Is it because I don't use English keyboard in windows? Pls help Link to comment Share on other sites More sharing options...
Xtian Posted July 26, 2010 Share Posted July 26, 2010 Hey, I am using Auto It script and for some reason (after an hour or two) it's changing keyboard buttons. Keyboard buttons doesnt work properly and when I click with left mouse on desktop icons it marks them like I wanna copy something. Is it because I don't use English keyboard in windows? Pls helpsame thing happen to me..happens every time i used "ControlSend" code. The code will run perfectly but later my keyboard will end up same as yours. btw i tried to run the code on winxp and win7. same results. Sorry for being noob but... thanks to you im learned something new. Link to comment Share on other sites More sharing options...
Jaman Posted July 26, 2010 Author Share Posted July 26, 2010 Any solutions? Link to comment Share on other sites More sharing options...
tobject Posted July 26, 2010 Share Posted July 26, 2010 (edited) I had same problem. no, don't know about solution on related when I click f1 help another copy of app executes Edited July 26, 2010 by tobject Link to comment Share on other sites More sharing options...
Bert Posted July 26, 2010 Share Posted July 26, 2010 lets see your script and we can see what is happening. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Jaman Posted July 26, 2010 Author Share Posted July 26, 2010 Here is a script: $Key_PvPWindow = "h" $Key_joinQueue = "{F11}" ; /script JoinBattlefield(0); $Key_Confirm = "{F12}" ; /script AcceptBattlefieldPort(1,1); $Key_Idle = "w" $Key_autorun = "r" SetPrivilege("SeDebugPrivilege", 1) $Process = WinGetProcess("World of Warcraft") $hWnd = WinGetHandle("[CLASS:GxWindowClassD3d]") $WoWProcess = mem_open($Process) While True $status = mem_read(0x00B6DFD8, $WoWProcess, "int") switch $status Case 0 joinQueue() Case 1 idle() Case 2 confirm() case 3 idle() EndSwitch WEnd Func joinQueue() Sleep(500) ControlSend($hWnd, "", "", $Key_PvPWindow) ControlSend($hWnd, "", "", $Key_Idle) Sleep(500) ControlSend($hWnd, "", "", $Key_joinQueue) Sleep(500) ControlSend($hWnd, "", "", $Key_Confirm) EndFunc Func idle() Sleep(600) ControlSend($hWnd, "", "", $Key_Idle) EndFunc Func confirm() ControlSend($hWnd, "", "", $Key_Confirm) Sleep(500) EndFunc Func mem_open($iv_Pid) Local $ah_Handle[2] = [DllOpen('kernel32.dll')] Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', 0x0bea4c8, 'int', 1, 'int', $iv_Pid) $ah_Handle[1] = $av_OpenProcess[0] Return $ah_Handle EndFunc Func mem_read($iv_Address, $ah_Handle, $sv_Type = 'dword') Local $v_Buffer = DllStructCreate($sv_Type) DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') Local $v_Value = DllStructGetData($v_Buffer, 1) Return $v_Value EndFunc Func mem_close($ah_Handle) DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1]) DllClose($ah_Handle[0]) Return 1 EndFunc Func SetPrivilege($privilege, $bEnable) Const $MY_TOKEN_ADJUST_PRIVILEGES = 0x0020 Const $MY_TOKEN_QUERY = 0x0008 Const $MY_SE_PRIVILEGE_ENABLED = 0x0002 Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv $nTokens = 1 $LUID = DLLStructCreate("dword;int") If IsArray($privilege) Then $nTokens = UBound($privilege) $TOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]") $NEWTOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]") $hCurrProcess = DLLCall("kernel32.dll","hwnd","GetCurrentProcess") $SP_auxret = DLLCall("advapi32.dll","int","OpenProcessToken","hwnd",$hCurrProcess[0], _ "int",BitOR($MY_TOKEN_ADJUST_PRIVILEGES,$MY_TOKEN_QUERY),"int*",0) If $SP_auxret[0] Then $hToken = $SP_auxret[3] DLLStructSetData($TOKEN_PRIVILEGES,1,1) $nTokenIndex = 1 While $nTokenIndex <= $nTokens If IsArray($privilege) Then $priv = $privilege[$nTokenIndex-1] Else $priv = $privilege EndIf $ret = DLLCall("advapi32.dll","int","LookupPrivilegeValue","str","","str",$priv, _ "ptr",DLLStructGetPtr($LUID)) If $ret[0] Then If $bEnable Then DLLStructSetData($TOKEN_PRIVILEGES,2,$MY_SE_PRIVILEGE_ENABLED,(3 * $nTokenIndex)) Else DLLStructSetData($TOKEN_PRIVILEGES,2,0,(3 * $nTokenIndex)) EndIf DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,1),(3 * ($nTokenIndex-1)) + 1) DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,2),(3 * ($nTokenIndex-1)) + 2) DLLStructSetData($LUID,1,0) DLLStructSetData($LUID,2,0) EndIf $nTokenIndex += 1 WEnd $ret = DLLCall("advapi32.dll","int","AdjustTokenPrivileges","hwnd",$hToken,"int",0, _ "ptr",DllStructGetPtr($TOKEN_PRIVILEGES),"int",DllStructGetSize($NEWTOKEN_PRIVILEGES), _ "ptr",DllStructGetPtr($NEWTOKEN_PRIVILEGES),"int*",0) $f = DLLCall("kernel32.dll","int","GetLastError") EndIf $NEWTOKEN_PRIVILEGES=0 $TOKEN_PRIVILEGES=0 $LUID=0 If $SP_auxret[0] = 0 Then Return 0 $SP_auxret = DLLCall("kernel32.dll","int","CloseHandle","hwnd",$hToken) If Not $ret[0] And Not $SP_auxret[0] Then Return 0 return $ret[0] EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 26, 2010 Moderators Share Posted July 26, 2010 tobject,on related when I click f1 help another copy of app executesIf you are talking about pressing F1 in SciTE opening help and running another instance of the code, that is a well-known bug within SciTE and nothing to do with AutoIt itself. It is most unlikely to be related to any other keyboard problems.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...
Moderators Melba23 Posted July 26, 2010 Moderators Share Posted July 26, 2010 Jaman,From your code it looks like you are trying to bot "World of Warcraft". Have you read this?Do not expect too much help here. 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
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 accountSign in
Already have an account? Sign in here.
Sign In Now