Jump to content

Loop for key+click


Recommended Posts

Hello, I maked a script for another software, I would like to know if something like a "translate" is possible for AutoIt.

Here is the script:

$g::
loop
{
if not getkeystate("g","P")
break
send {g}
sleep 200
Click
}
return

With it, when I press the "g" key, I will spam g+click pause during 200ms g+click etc.... Then when I stop pressing the key, nothing happen.

All of the script I read in this forum are making with a "while 1" so it's not what I want.

I hope I respected the rules of this forum, sorry for my english, I'm french.

Link to comment
Share on other sites

  • Moderators

Quincy,

Welcome to the AutoIt forum. :)

I hope I respected the rules of this forum

That depends on why you want to "spam" the "g" key - you had best you read the Forum Rules and see if you have broken them. ;)

Ca depend - pourquoi veux-tu "spammer" le touche "g" - tu devrais lire les Forum Rules pour voir si tu es en infraction. ;)

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

Thx, I think I respect rules. I would like to alternate a key and one click for go more quickly to a repetitive and boring task on a software which blocks consequently the software which I used habitually. I search an alternative therefore by changing software to make the same task

Link to comment
Share on other sites

  • Moderators

Quincy,

So if I understand correctly:

-1. Your normal scripting language (do I recognise AHK?) does not work for a particular set of "repetitive and boring" keystrokes in a specific (un-named) application and you want to see if AutoIt will work for you instead?

- 2. This "repetitive and boring" task consists of sending a large number of "g" keystrokes followed by mouseclicks?

- 3. And this does not, in your opinion, fall foul of the Forum rules to which I linked - which specifically prohibit discussion of "SPAM tools"?

As the rules are so clear, your assertion that:

I think I respect rules

is completely wrong and this thread will now be locked. I suggest you play the game as it was intended and do not ask us for help to write bots again. :naughty:

M23

P.S. Of course, if I have completely misunderstood, then please PM me explaining what this "software" is and why you need to spam "g" within it. :)

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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