Davide9 Posted December 28, 2013 Posted December 28, 2013 Hi guys, i have an problem whit controlsend, i don't understand if it is an bug. When i use one my keyboard send on active windows many characters, why? I can resolved this bug? I have Italian keyboard. Sorry for my bad English..
Moderators Melba23 Posted December 28, 2013 Moderators Posted December 28, 2013 Davide9,Welcome to the AutoIt forum. ControlSend is an oft-used function so a bug seems pretty unlikely. Please post the code you are using and we can take a look. When you post code please use Code tags - see here how to do it. 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
Davide9 Posted December 28, 2013 Author Posted December 28, 2013 Hi Melba23 thanks for reply and welcome. this is my code: #RequireAdmin $wintitle = 'My win test' while 1 ControlSend($wintitle,'','','test') Sleep(1) WEnd This code works but my keyboard send many characters on active windows if i use one. Do you thing witch can i use an alternate function?
Moderators Melba23 Posted December 28, 2013 Moderators Posted December 28, 2013 (edited) Davide9,Of course that script will send the "test" string many times - that is what you are asking it to do by putting the ControlSend function inside an infinite loop! What exactly is this "My win test" GUI to which you wish to send strings? That might help us offer you a better solution. By the way, using a Sleep value of less that 10 is pointless - the minimum pause using that function is about 10ms, so you might as well use that. M23 Edited December 28, 2013 by Melba23 Wrong button - too soon 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
Davide9 Posted December 28, 2013 Author Posted December 28, 2013 My win test is the title of Window where i must send the string "test". now i'm trying to use sleep(15)
Inverted Posted December 29, 2013 Posted December 29, 2013 Why are you using an infinite while loop ? It sends keys forever
Davide9 Posted December 30, 2013 Author Posted December 30, 2013 it should send the keys until i stop it..
Moderators JLogan3o13 Posted December 30, 2013 Moderators Posted December 30, 2013 So what is the problem? The script is doing just as you've coded it to do. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Davide9 Posted December 30, 2013 Author Posted December 30, 2013 My keyboard send caps lock when i use this code..
Moderators Melba23 Posted December 30, 2013 Moderators Posted December 30, 2013 Davide9,Do you mean that the "test" string appears in the GUI as "TEST"? What is this GUI and the control within it to which you are trying to write? Perhaps it will only accept upper-case letters and is changing the case automatically. 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
Davide9 Posted December 30, 2013 Author Posted December 30, 2013 #RequireAdmin $wintitle = 'My win test' while 1 ControlSend($wintitle,'','','{left}') Sleep(1) WEnd Now i'm sending left key, but the problem persists. My win thest is a d3d window.
Moderators Melba23 Posted December 30, 2013 Moderators Posted December 30, 2013 Davide9,What problem? If you do not give us any information, you can hardly expect us to help. And as you are being so coy about the title of the GUI I assume that it is a game - in which case it probably has anti-bot protection and that is what is causing the commands to fail. 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
Davide9 Posted December 30, 2013 Author Posted December 30, 2013 Sorry but i don't speak good english.. Yes, is a game's windows, but i do not think it is protected because it is a small game.. The controlsend works but my keyboard if i use it send caps lock or shift or ctrl or any key..
Moderators Melba23 Posted December 30, 2013 Moderators Posted December 30, 2013 Davide9, i don't speak good englishThen I suggest you use Google translate or another translation site to carefully read the Forum rules. Yes, is a game's windowsThen you will understand why this thread is now locked - we do not help people bot games. And my suspicion that the game is blocking your attempts to bot it is almost certainly correct. 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
Recommended Posts