Jump to content

My autotyper


Recommended Posts

Hello everyone,

Im quite new to AutoItscript. I followed a tutorial on how to make an autotyper script and was already able to add enter to it, I would now like the option of having hotkeys too? Any idea how I start on this? This is my code:

Dim $timer, $run = False, $label[2]=['Start','Stop']
$gui = GUICreate("Artego's AutoTyper", 335, 100)
GUISetState()
GUICtrlCreateLabel("Text", 8, 10)
$key1 = GUICtrlCreateInput("", 35, 8, 120)
GUICtrlCreateLabel("Time", 8, 44)
$time1 = GUICtrlCreateInput("(in miliseconds)", 35, 40, 120)
$button = GUICtrlCreateButton($label[$run], 190, 8, 60)
HotKeySet("{F7}", "Start")
HotKeySet("{F8}", "Stop")
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
Case $button
$run = Not $run
GUICtrlSetData($button, $label[$run])
$timer = 0
Case Else
If $run Then
     If TimerDiff($timer) > GUICtrlRead($time1) And Not WinActive($gui) Then
     Send(GUICtrlRead($key1))
     Send ("{ENTER}")
     $timer = TimerInit()
     EndIf
EndIf
EndSwitch
WEnd

I already thried the HotKeySet, but I think it works in a different way. Thanks if you help me, it's really appreciated :D

Link to comment
Share on other sites

Your Script seems to be incomplete

Please the full Script and Explain the code a little further

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.

Link to comment
Share on other sites

It is basically an autotyper application. the start and stop is to stop it. The time is how regularly it should type it. Text is the input of what is being typed. The send enter Does an Enter everytime something is typed.

$button = GUICtrlCreateButton($label[$run], 190, 8, 60) Causes it to run when and stop when the button is clicked.

This is a failed attempt to add hotkeys to start and stop:

HotKeySet("{F7}", "Start") HotKeySet("{F8}", "Stop").

Link to comment
Share on other sites

  • Moderators

artego,

What application are you trying to spam with this "autotyper"? :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Please the full Script...!

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.

Link to comment
Share on other sites

Dim $timer, $run = False, $label[2]=['Start','Stop']

$gui = GUICreate("Artego's AutoTyper", 335, 100)

GUISetState()

GUICtrlCreateLabel("Text", 8, 10)

$key1 = GUICtrlCreateInput("", 35, 8, 120)

GUICtrlCreateLabel("Time", 8, 44)

$time1 = GUICtrlCreateInput("(in miliseconds)", 35, 40, 120)

$button = GUICtrlCreateButton($label[$run], 190, 8, 60)

HotKeySet("{F7}", "Start")

HotKeySet("{F8}", "Stop")

While 1

Switch GUIGetMsg()

Case -3

ExitLoop

Case $button

$run = Not $run

GUICtrlSetData($button, $label[$run])

$timer = 0

Case Else

If $run Then

If TimerDiff($timer) > GUICtrlRead($time1) And Not WinActive($gui) Then

Send(GUICtrlRead($key1))

Send ("{ENTER}")

$timer = TimerInit()

EndIf

EndIf

EndSwitch

WEnd

Link to comment
Share on other sites

  • Moderators

artego,

It is for my own applocation/Game

That is what I feared. Please read the Forum Rules - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...