Jump to content
Sign in to follow this  
lokipoki

Hold 2 Buttons Tomorrow send a key

Recommended Posts

lokipoki

Hi there.

I want to quit pcsx2 by holding 2 Buttons for lets say 5 seconds sending esc. Can you guys help me out with a script?

Cheers.

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

Why do you want to use 2 buttons and wait 5 seconds to quit a program? In 5 seconds you could easily close it yourself.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
PhoenixXL

Somewhat likewise

#include <Misc.au3>

#region - UserVars
Global Const $sKey = "{ESC}"
Global Const $sHexKey = "1B"
Global Const $iTime = 5000 ;milli-secs
#endregion - UserVars


Global $iFlag = False

HotKeySet( $sKey, "Timer_Init" )

Func Timer_Init()
$iFlag = True
EndFunc

Local $iTimer
While 1
If $iFlag Then
$iFlag = False
$iTimer = TimerInit()
While _IsPressed( $sHexKey )
If TimerDiff( $iTimer ) >= $iTime Then
ConsoleWrite("True" & @CR );Execute your function
ExitLoop ;execute only once
EndIf
WEnd
EndIf
WEnd


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
Melba23

lokipoki,

I want to quit pcsx2

Could I suggest that you read the Forum rules (there is also a link at bottom right of each page) in the near future. This is as close to the edge (ahh, what a wonderful album that was/is ) as you want to get. ;)

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
tp9191

May I ask why you referred him to the rules? I assume it's something in R#1 but I don't exactly know. Just curious.

Share this post


Link to post
Share on other sites
Melba23

tp9191,

Google the app from which the OP wants to exit and come back if you stil cannot work it out. ;)

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
water

Melba23 refers to #1, game automation, because pcsx2 is a Playstation 2 Emulator.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
tp9191

Yeah I knew what it was beforehand. But, I was under the impression the rule only applied to games that can possibly have online play, as to not be supporting cheaters here? Hmm I guess not.

Also, Videogame console emulators themself are not illegal in any way, that is as long as you use your own games, and BIOS, which is something most people forget.

Share this post


Link to post
Share on other sites
lokipoki

I want hold 2 Buttons because my HTPC has no keyboard ;)

Sorry, I wasn't aware of the emulation rule. Lets just say I want to send esc after I held 2 Buttons for 5 secs.

Cheers.

Share this post


Link to post
Share on other sites
Melba23

tp9191,

The rules say "regardless of the game" - so automating an emulator is, as I pointed out, about as close as you can get without actually breaking the rules. That is why all I did was gently point the OP at them, rather than lock the thread. ;)

lokipoki,

Your question is fine as it stands - all I wanted to do was make sure you stayed legal in future. :)

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
lokipoki

Sorry again.

I'm using the emulator with copies I own. Which is totally legal. But if that is against the rule it wasn't my intention to make anyone upset here. I should have read the rules before...

Share this post


Link to post
Share on other sites
Melba23

lokipoki,

As I said above you are fine at the moment - just do not ask for help automating the games themselves. :)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×