Sign in to follow this  
Followers 0
Davide9

ControlSend() bug?

14 posts in this topic

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

Share this post


Link to post
Share on other sites



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._______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

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#4 ·  Posted (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! :D

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 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._______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

 

Share this post


Link to post
Share on other sites

My win test is the title of Window where i must send the string "test".

now i'm trying to use sleep(15)

Share this post


Link to post
Share on other sites

Why are you using an infinite while loop ? It sends keys forever

Share this post


Link to post
Share on other sites

it should send the keys until i stop it..

Share this post


Link to post
Share on other sites

So what is the problem? The script is doing just as you've coded it to do.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

My keyboard send caps lock when i use this code.. 

Share this post


Link to post
Share on other sites

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

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._______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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Davide9,

 

i don't speak good english

Then I suggest you use Google translate or another translation site to carefully read the Forum rules. ;)

 

Yes, is a game's windows

Then you will understand why this thread is now locked - we do not help people bot games. :naughty:

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._______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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0