Jump to content

Anyone understand this peculiar issue with ControlSend()?


Recommended Posts

I just recently got into AutoIt and this past week I've been working on a project that allows me to use hotkeys and loops to spam certain numbers. I use this with World of Warcraft and custom character macros to help me manage my rotations to a limited degree. This has been a very iterative process where I started with something really nity grity and worked up to something I'm quite happy with. In this process, I discovered the ControlSend() and how to grab the WoW window handle. Now the strange behavior.

For some odd reason, when using ControlSend(), it was extremely difficult to get any other key press to register in game. For example: It's currently spamming {NUMPAD1} and I need to move left or right. It would take quite a few key presses to begin the move, and this happened with any movement keystroke. My assumption is that it's any generic keystroke. After some testing, I noticed that this problem does not happen if I use Send() instead of ControlSend()

While this was an easy work around, I still wanted the functionality of ControlSend() when the rare time comes that I need to read something or manage friends in my teamspeak, without affecting the response in game. I did some sleuthing and found WinActive(), and I used If...Then...Else statements to achieve exactly what I needed/wanted.

The question here is: Why is this happening? Does anyone on this forum have enough experience to know what causes ControlSend() to create these issues where as Send() does not? Knowing why this happens (if possible) can help alleviate further time wasted and frustration and we can write scripts correctly the first time.

For reference, here's my entire script with my current solution:

<snip>

 

Edited by Melba23
Code removed
Link to comment
Share on other sites

  • Moderators

RamboMadCow,

Unfortunately you appear not to have read the Forum rules since you arrived. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

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

  • Jon unfeatured this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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