Jump to content

Recommended Posts

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
  • Moderators
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

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.

Posted

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)
Posted

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?

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

Posted

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?

Posted

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

Posted

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

  • Moderators
Posted

can anyone help?

Look in the help file under SendKeyDownDelay.

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.

  • Moderators
Posted

Sorry, where is the help file?

Run this script:

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

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.

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

2¢

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

Posted

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

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
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)
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
  • Moderators
Posted

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

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.

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.

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
  • Recently Browsing   0 members

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