Jump to content

open executable, press B key will exit B key, but when pressed for 3 seconds, "i" key will exit, closed .exe also close script - (Locked)


Recommended Posts

I'm really in need of a program that will open an executable after the executable opened by pressing the "B" key in the normal way, the B key will exit, but when I press the same key for 3 seconds the "i" key will exit and when the executable exits , the script will close together. I really need this program, I've tried a lot but I couldn't.

Link to comment
Share on other sites

I'm really in need of a program that will open an executable after the executable opened by pressing the "B" key in the normal way, the B key will exit, but when I press the same key for 3 seconds the "i" key will exit and when the executable exits , the script will close together. I really need this program, I've tried a lot but I couldn't.

Link to comment
Share on other sites

Maybe it's just me, but from your description I can't figure out what you're trying to accomplish.

11 minutes ago, Gabriel_JP said:

I really need this program, I've tried a lot but I couldn't.

Post the code you have tried so far.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

33 minutes ago, Gabriel_JP said:

I need a script that works like this: open an executable, if the B key be pressed its works in the normal way, but in the case of be pressed for 3 second its becames the "i" key and when the executable close the script will close together (at the same time). Can someone help me???  I will be forever grateful.

 

Link to comment
Share on other sites

59 minutes ago, Gabriel_JP said:

I need a script that works like this: open an executable, if the B key be pressed its works in the normal way, but in the case of be pressed for 3 second its becames the "i" key and when the executable close the script will close together (at the same time). Can someone help me???  I will be forever grateful.

#include <WinAPI.au3>

Func envia_teclai()
    Local $Tecla, $Key = 42 ; Tecla B
    Local $Tempo = 0
    Local $Segundos = 3000 ;
    HotKeySet("B")

    $Tempo = TimerInit()
    While 1
        $Tecla = _WinAPI_GetAsyncKeyState($Key)
        If Not BitAND($Tecla, 0x8000) Then
            HotKeySet("B", "envia_teclai") ; 
            ExitLoop
        Else
            If TimerDiff($Tempo) >= $Segundos Then
                Send("I")
                HotKeySet("", "envia_teclai") ; 
                ExitLoop
            EndIf
        EndIf
        Sleep(100)
    WEnd
EndFunc   ;==>envia_teclai

 

Edited by Jos
Link to comment
Share on other sites

Can you please provide more information? Which program are we talking about?
And please give some more information what you try to achieve.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.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
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Developers

I tidied your code and it should now be pretty clear that this script does nothing and finishes immediately!

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

This is your last warning: Post another thread and I will ban you from posting in our forums. Simply stick to this thread!!!!!I

Other 2 threads are removed!

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

3 minutes ago, Jos said:

This is your last warning: Post another thread and I will ban you from posting in our forums. Simply stick to this thread!!!!!I

Other 2 threads are removed!

Jos

Forgive me my friend, I'm Brazilian and I'm having a hard time understanding the forum, I'm not able to edit my topics or delete them, I put copies of this topic but I didn't want to.

Link to comment
Share on other sites

4 minutes ago, Jos said:

This is your last warning: Post another thread and I will ban you from posting in our forums. Simply stick to this thread!!!!!I

Other 2 threads are removed!

Jos

Forgive me my friend, I'm Brazilian and I'm having a hard time understanding the forum, I'm not able to edit my topics or delete them, I put copies of this topic but I didn't want to.

Link to comment
Share on other sites

  • Developers

So why are you posting this also 2 times?   Isn't 1 time enough for you?
It is BS when you say you didn't want to create a new topics as you are pressing the buttons yourself to do so.
This has nothing to do with language but everything with impatience it seems!

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

30 minutes ago, water said:

Can you please provide more information? Which program are we talking about?
And please give some more information what you try to achieve.

forgive me for the lack of information, I'm still a layman. The language is Autoit

Link to comment
Share on other sites

Could you please re-read my question and then post the requested information?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.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
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

1. To edit a message, click the three dots at the top right of your post and select the Edit option:

Capture-2.png.b234a76bd5f2fa2f7256530aba0bfaf9.png

2. If you want to edit a post, do NOT just press the back-button in your browser and then press the Submit button again.

3. I suggest to repost your question, but this time, use full sentences, and use fullstops at the ends of sentences.  We're having trouble figuring out where your sentences begin and end.

 

 

 

Link to comment
Share on other sites

  • Developers

@leuce, The OP can't as the status is still New Member. 
I also would appreciate people not posting when I am still asking questions as I get pretty annoyed when people claim not to understand but are capable of creating multiple topics and posts in an effort to seemingly trying to get a answer faster.  

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

2 minutes ago, water said:

Could you please re-read my question and then post the requested information?

I need a script that works like this: open an executable, if the B key be pressed its works in the normal way, but in the case of be pressed for 3 second its becames the "i" key and when the executable close the script will close together (at the same time).

The program that will be opened along with the script is Crysis.exe, I need the B key to have two functions, if pressed normally, it will work properly, but if pressed for 3 seconds, it will behave like the I key, and when exit the executable the script will also close! I need to do this with autoit.

Link to comment
Share on other sites

  • Developers

Ok: @Gabriel_JP: Please answer me only for them moment as I am done cleaning  up your shit!
Anything else will be deleted.

Everybody else stay out for the moment!

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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