AutoHotkey Community

It is currently May 24th, 2012, 1:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: September 7th, 2009, 12:41 am 
Offline

Joined: July 28th, 2009, 6:09 pm
Posts: 69
I'm not 100% sure why you'd need this but it was the first proper script I've ever made so here it is:

Code:
Gui, Add, Text, x52 y52 w220 h50 +Center, Enter the button you wish the script to press and how many times`, then press 1`, if it is a click`, enter a hash in the first box
Gui, Font, S10 CDefault, Verdana
Gui, Add, Hotkey, x12 y122 w130 h70 vHotkey,
Gui, Add, Button, x76 y292 w180 h40 +s +a, 1
Gui, Add, Edit, x182 y122 w130 h70 vNOT, Number of Times
Gui, Add, Edit, x102 y202 w120 h70 vSpeed, Speed - 1000 is a gap of 1 second
Gui, Add, Text, x258 y12 w100 h30 +Center +d, EITHER:
Gui, Add, Text, x372 y52 w210 h50 +Center, Enter the text you wish it to type for you then press 2.
Gui, Add, Edit, x332 y122 w270 h160 vText, Note that '!' is alt`, '#' is windows`, '^' is control and '+' is shift. This means that ^!d is control-alt-d and Hello{Enter}How are you would have an enter pressed at the location.
Gui, Add, Button, x372 y292 w190 h40 , 2
Hello:
Gui, Show, x313 y153 h356 w625, ButtonPresser V1.5
Return

Button1:
Gui, Submit
GuiControlGet, a,, Hotkey
If ErrorLevel
{
MsgBox, 0, ERROR, Could not get information from Hotkey Box - possible coding error?
}
GuiControlGet, b,, NOT
If ErrorLevel
{
MsgBox, 0, ERROR, Could not get information from Number Box - possible coding error?
}
GuiControlGet, c,, Speed
If ErrorLevel
{
MsgBox, 0, ERROR, Could not get information from Speed Box - possible coding error?
}
if Hotkey = #
{
MsgBox, 4, Your Choice, You want it to click for %b% times with a speed of %c% - correct?
IfMsgBox Yes
{
MsgBox, 0, Ready, Press Control-x when you wish to start it
^x::
Loop %b%
{
MouseClick, left
Sleep %c%
}
a =
b =
c = ;resets a,b and c
Goto, Hello
}
}
MsgBox, 4, Your Choice, You want it to press %a% for %b% times at a speed of %c% - correct?
IfMsgBox Yes
{
MsgBox, 0, Ready, Press Control-z when you wish to start it
^z::
Loop %b%
{
Send {%a%}
Sleep %c%
}
a =
b =
c = ;resets a,b and c
Goto, Hello
}
IfMsgBox No
ExitApp

Button2:
Gui, Submit
GuiControlGet, d,, Text
If ErrorLevel
{
MsgBox, 0, ERROR, Could not get information from Text Box
}
MsgBox, 0, Ready, Press Windows-z to type it and press Windows-q when you are finished
Back:
return
#z::
Send %d%
Goto, Back


#q::
a =
b =
c =
d =
Goto, Hello

^q::
ExitApp


It presses buttons repeatedly really fast, or can repeatedly enter blocks of text. If you ever loose the GUI (want it to appear again) press windows-q


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cerberus, cmulcahy, hoppfrosch, MSN [Bot], Yahoo [Bot] and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group