Jump to content

Auto It screwing keyboard settings


Recommended Posts

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

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

same 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. :blink:

Sorry for being noob but... thanks to you im learned something new.
Link to comment
Share on other sites

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

  • Moderators

tobject,

on related when I click f1 help another copy of app executes

If 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. :blink:

It is most unlikely to be related to any other keyboard problems.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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. :blink:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...