Jump to content


Photo

spam key script request


  • Please log in to reply
6 replies to this topic

#1 kuzyn007

kuzyn007
  • Members
  • 3 posts

Posted 06 May 2011 - 12:07 AM

hi,
My English is not good but I hope it will enough to understand me.

Im looking for script to spam key "1" all the time (ofcourse it will start to spam when I will hit "1" once) and it will break when I will hit any key on keyboard or mouse.

I was trying to find this script on forum ofc and:
~$*1::     ;This makes the hotkey, so 1 triggers the script
Loop                 ;loop the script untill broken
{ ;loop start
    GetKeyState 1, P ;Get the state of 1
    Send {1}  ;It hasnt been released so send another Click
    sleep 675  ; This is the time between presses, after its slept it will return to the top of the loop and start again
} ;loop end
it unfortunately would spam 1 all the time.

I just need one click to start the script and any other key would break it. Usually here i was finding scripts with hold down key script but its not what im looking for.

Thx for help!:)
I was trying to find answer in tutorial and in topics on this forum. Maybe my searching was bad but i was trying to find it few hours.

#2 LazyMan

LazyMan
  • Members
  • 450 posts

Posted 06 May 2011 - 01:01 AM

You might find what you want at The definitive autofire thread!.

#3 kuzyn007

kuzyn007
  • Members
  • 3 posts

Posted 06 May 2011 - 09:29 AM

I was reading this thread and there is not macro what i am looking for. There is macro with hold down key or start/pause click.

I just need to break macro by clicking any key on the keyboard/mouse, is it possible with autohotkey?

#4 LazyMan

LazyMan
  • Members
  • 450 posts

Posted 06 May 2011 - 01:27 PM

;; Hit any key to break



AnyEndKeys =

( LTrim Join

   {LWin}{RWin}{AppsKey}

   {LShift}{RShift}{LControl}{RControl}{LAlt}{RAlt}

   {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}

   {Left}{Right}{Up}{Down}

   {Insert}{Delete}{Home}{End}{PgUp}{PgDn}

   {Space}{Tab}{Enter}{Escape}{Backspace}

   {CapsLock}{NumLock}{ScrollLock}

   {PrintScreen}{Pause}

   {Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}

   {Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}

   {NumpadIns}{NumpadEnd}{NumpadDown}{NumpadPgDn}{NumpadLeft}

   {NumpadClear}{NumpadRight}{NumpadHome}{NumpadUp}{NumpadPgUp}

   {NumpadDot}{NumpadDel}

   {NumpadDiv}{NumpadMult}{NumpadSub}{NumpadAdd}{NumpadEnter}

)



1::

   SendPlay 1

   SetTimer Spam1, 30

   Input AnyKey, L1, %AnyEndKeys%

   SetTimer Spam1, Off

Return



Spam1:

   SendPlay 1

Return



#5 kuzyn007

kuzyn007
  • Members
  • 3 posts

Posted 06 May 2011 - 04:40 PM

Big thanks!!! this is what i was looking for:)

Again thanks

#6 jcheung

jcheung
  • Members
  • 1 posts

Posted 10 September 2011 - 02:10 AM

feel kind of stupid, but what about a-z and the rest?

#7 LazyMan

LazyMan
  • Members
  • 450 posts

Posted 10 September 2011 - 03:49 AM

what about a-z and the rest?

The rest are handled by the Input command.