Sign in to follow this  
Followers 0
bobby177

Need a simple program

28 posts in this topic

#1 ·  Posted (edited)

Hello, I need someone to make a simple script for me, shouldnt take long.

Could you make a script that when Q is pressed, autoit "holds" enter down for 2 seconds and then releases it?

EDIT---- Sorry for begging for a program, scroll down to my post to see what i have so far

Edited by bobby177

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello, I need someone to make a simple script for me, shouldnt take long.

Could you make a script that when Q is pressed, autoit "holds" enter down for 2 seconds and then releases it?

You'll find exactly what your looking for: Click Here, otherwise you can Start Here or Here. Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hello, I need someone to make a simple script for me, shouldnt take long.

Could you make a script that when Q is pressed, autoit "holds" enter down for 2 seconds and then releases it?

In general.. it is bad manners to ask for scripts to be made for you. Instead, you get much better results if you show what you have tried on your own and we can help correct your mistakes.

Look into _Ispressed, Send(), TimerInit(), TimerDiff(), etc, in the help file.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

In general.. it is bad manners to ask for scripts to be made for you. Instead, you get much better results if you show what you have tried on your own and we can help correct your mistakes.

Look into _Ispressed, Send(), TimerInit(), TimerDiff(), etc, in the help file.

As you can probably tell, I am horrible with autoit so i am stuck on something very simple. So far I have

Send("{a down}")
Sleep(2000)
Send("{a up}")

Now how would I make it so if Q is pressed then the script would run?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Look at HotKeySet in the help file:

HotKeySet( "q", "runThis" )

While 1
     Sleep(100)  ;wait for the user to press 'q'
WEnd

Func runThis()
      ;put ur script here
EndFunc

EDIT: left code piece

Edited by Don N

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

Ok so now i have

HotKeySet( "{f1}", "runThis" )

While 1
     Sleep(100) ;wait for the user to press 'q'
WEnd

Func runThis()
      Send("{a down}")
Sleep(4000)
Send("{a up}")
EndFunc

It doesn't seem like it is "holding" A down, is there a way to do that?

Share this post


Link to post
Share on other sites

Global $Paused


HotKeySet( "{f1}", "runThis" )
HotKeySet("{ESC}", "Terminate")

While 1
     Sleep(100);wait for the user to press 'q'
WEnd

Func runThis()
    $Paused = NOT $Paused
    While $Paused
        sleep(10)
        Send("a")
        ToolTip('Script is "Running"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Global $Paused
HotKeySet( "{f1}", "runThis" )
HotKeySet("{ESC}", "Terminate")

While 1
     Sleep(100);wait for the user to press 'q'
WEnd

Func runThis()
    $Paused = NOT $Paused
    While $Paused
        sleep(10)
        Send("a")
        ToolTip('Script is "Running"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

8)

Thanks but I need it to hold A for a set amount of time... say 2 seconds

Share this post


Link to post
Share on other sites

Thanks but I need it to hold A for a set amount of time... say 2 seconds

can anyone help?

Share this post


Link to post
Share on other sites

can anyone help?

Look in the help file under SendKeyDownDelay.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Look in the help file under SendKeyDownDelay.

Sorry, where is the help file?

Share this post


Link to post
Share on other sites

Sorry, where is the help file?

Run this script:

Run(@ProgramFilesDir & '\AutoIt3\AutoIt3Help.exe')

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Run this script:

Run(@ProgramFilesDir & '\AutoIt3\AutoIt3Help.exe')
What is the syntax of that command?

SendKeyDownDelay("A",2000) is what i tried and it wont work

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

What is the syntax of that command?

SendKeyDownDelay("A",2000) is what i tried and it wont work

put this at the top of your code

Opt("SendKeyDownDelay", 2000) ;1 millisecond (default)

edit

also look at the bottom of the page for other syntax

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

Description:

Alters the length of time a key is held down before released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default.

Time in milliseconds to pause (default=5).

Syntax:

Opt("SendKeyDownDelay", 1) ;1 millisecond

Both are straight from the helpfile :D


_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Ohhh i never saw the syntax table thing below

Now I have

Opt("SendKeyDownDelay", 5);1 millisecond (default)
Global $Paused


HotKeySet( "{q}", "runThis" )
HotKeySet("{ESC}", "Terminate")

While 1
     Sleep(100);wait for the user to press 'q'
WEnd


Func runThis()
    $Paused = NOT $Paused
    While $Paused
        sleep(10)
        Send("a")
        ToolTip('Script is "Running"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

But it still isnt doing what I need it to do, Have me push a key (Q) and then have the script "hold" down a key (A) for a set amount of time (2000)

Edited by bobby177

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Because your damn sendkeydowndelay is only for 5 miliseconds. Look at what other people have said in your thread (nitekram).

Opt("SendKeyDownDelay", 2000)

Try:

Opt("SendKeyDownDelay", 2000);1 millisecond (default)
HotKeySet( "{q}", "runThis" )
HotKeySet("{ESC}", "Terminate")

While 1
     Sleep(100);wait for the user to press 'q'
WEnd

Func runThis()
    Send("a")
EndFunc
Func Terminate()
    Exit
EndFunc
Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

OK I tried that script, but I hit "Q" and it waits 2 seconds, and then sends A, not "hold" A down, which is what I need it to do :D

Is this hard to do or am I not being descriptive enough?

Edited by bobby177

Share this post


Link to post
Share on other sites

OK I tried that script, but I hit "Q" and it waits 2 seconds, and then sends A, not "hold" A down, which is what I need it to do :D

Is this hard to do or am I not being descriptive enough?

Is this the affect your looking for?
_MySend('a', 2000, 0)

Func _MySend($sCharacters, $iRepeatTime, $iSendDelay = 5)
    $OptSKD = Opt('SendKeyDelay', $iSendDelay)
    Local $iSendTimer = TimerInit()
    While TimerDiff($iSendTimer) <= $iRepeatTime
        Send($sCharacters)
        Sleep(10)
    WEnd
    Opt('SendKeyDelay', $OptSKD)
EndFunc

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

OK I tried that script, but I hit "Q" and it waits 2 seconds, and then sends A, not "hold" A down, which is what I need it to do :D

Is this hard to do or am I not being descriptive enough?

I don't understand you. Maybe you want to script stay in backgrouding, and when you press 'q', script send enter for 2 secs? :D

i542

P.S. My english is very bad because i'm from Croatia...

Edited by i542

I can do signature me.

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  
Followers 0