Jump to content

Recommended Posts

Hey everyone! I'm new to these forums and new to scripting. I've been lurking around the site to try and comprehend how to do a simple script. But I've hit somewhat of a roadblock, so I need some help.

Here is what I need my script to do:

If I press the NUMPAD9 button, I want the script to press down and hold NUMPAD4, NUMPAD5 and NUMPAD6 at the same time, and release those three buttons once I release the NUMPAD9 button.

Here's the script that I came up with:

#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")
While 1
Sleep(10)
    If _IsPressed("69", $hDLL) Then
  Send("{NUMPAD4 down}")
  Send("{NUMPAD5 down}")
  Send("{NUMPAD6 down}")
    Else
  Send("{NUMPAD4 up}")
  Send("{NUMPAD5 up}")
  Send("{NUMPAD6 up}")
    EndIf
WEnd
DllClose($hDLL)

Now here's the problem... The script seems to be doing what it's supposed to. But every now and then, the buttons NUMPAD4, 5 and 6 seem to stop working. After pressing them a few times they work again.

I can't figure out why this is happening, and it's not a keyboard (that is, mechanical) problem.

Also... If there is a way for this script to be written to have minimal delay, that would be great.

Thanks for taking your time to help me.

Link to post
Share on other sites

Is this just to excercise or do you need to solve a real problem?

Looks a bit weird to press these 4 keys at the same time.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites

It's for a video game. The video game has a move that can only be performed by pushing three buttons at once.

An earlier version of the game had a built-in macro function, but for some reason, the newer version, doesn't.

That's why I need this.

Link to post
Share on other sites

Yes, I know that. But this game has no rules against using scripting. In fact, like I said, one version of the game has the macro built-in, but the other one doesn't, because it's a compact, stripped-down version, so it has no additional options whatsoever (not even for changing the default controls).

So I'm not breaking any rules.

Link to post
Share on other sites

The rule that doesn't allow to discuss game automation is the forum rule (not the rules of the game).

That's the rule Mods are quite strict here.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites

It's Automation. Call it Macro or whatever.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites

(Nearly) everything game related that automates keystrokes by an AutoIt script (using HotKeys or whatever) is "game automation".

There are very few game related automation topics which didn't get locked by the Mods.

Search the forum for locked topics and you'll see what I'm talking about.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Link to post
Share on other sites

Just because you are stupid and don't understand lingo and terminology does not mean you get to bypass the rules.

Thread locked. Do not argue with me or post on this subject again or you will go away.

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...