Jump to content

Recommended Posts

Posted

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

Posted

Your Script seems to be incomplete

Please the full Script and Explain the code a little further

My code:

  Reveal hidden contents
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.

Posted

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").

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted
Please the full Script...!

My code:

  Reveal hidden contents
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.

Posted

  On 6/24/2012 at 9:38 AM, 'Melba23 said:

artego,

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

M23

It is for my own applocation/Game, a handy little tool so that players don't need to type by hand when they sell :huh:

Posted

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

  • Moderators
Posted

artego,

  Quote

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:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...