Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Rapid fire..


  • Please log in to reply
17 replies to this topic
2fast4u
  • Members
  • 5 posts
  • Last active: Aug 14 2007 12:21 PM
  • Joined: 14 Aug 2007
Hi im new to Autohotkey ive already made a rapid fire script which works fine but im trying to be able to have a toggle key for on/off so its not always on.. but im having problems...can anyone assist?

#NoEnv
#SingleInstance force 
SendMode Input

Lbutton::
Loop
{
GetKeyState, state, Lbutton, P
if state=U
break
Sendinput {Click down}
Sleep 35
Sendinput {Click up}
Sleep 35
}
;Pauses AutoHotKey Script.
F6::Pause, Toggle, 1

This is what i have at the moment......... like i says its simple script i press the left mouse button and it fires contstant but id like to be able to disable it so its only active by pressing scroll lock or something. ive currently set it to F6 but it seems to still stay active.

Thanks for any help :D

Rhys
  • Members
  • 761 posts
  • Last active: Aug 09 2013 04:53 PM
  • Joined: 17 Apr 2007
I believe you're looking for suspend, rather than pause.

  • Guests
  • Last active:
  • Joined: --
Ok so ive added -
F6::Suspend  ;

And it has worked a dream, Thanks Rhys

fatray
  • Members
  • 1 posts
  • Last active: Nov 27 2007 11:16 PM
  • Joined: 26 Nov 2007
I've been messing with your script for an hour and can't get it to work. I have no clue what I'm doing wrong.

What I did was replaced
;Pauses AutoHotKey Script.
F6::Pause, Toggle, 1
With This
F6::Suspend  ;
This seems to work on the first mouse press, but when I release my mouse button the script suspends and pressing F6 does nothing and will not re able it. Only right-clicking the AHK try icon and removing the suspend gets it working again until I release the mouse button.

I've been trying for a while with no clue on why I can't do it by myself, I am frustrated. I want an all around script that rapid fires my mouse button in ANY game. I play BF2, BF2142, Crysis, COD4, UT3, ect.... I can't seem to make one, or find one that pauses the script. It seems the ones I find only work with BF2?

I want the pause to be
CTRL+SHIFT+LEFT MOUSE BUTTON

Are there any forums/directions specifically written for gamers, not just BF2?

ConfusedGuest
  • Guests
  • Last active:
  • Joined: --
i have been messing with this script 2 and i am having trouble
i changed the hotkeys to start it
i will try using the left mouse button later but right now i want it to be XButton
but i cannot get this work
i can get it work when i use y though
i think something is messed up in the GetKeyState or the if state line

what am i doing wrong? here is what i have

#NoEnv
#SingleInstance force
SendMode Input

y::
^y::
+y::
Loop
{
GetKeyState, state, y, P
if state=U
break
Sendinput {Click down}
Sleep 35
Sendinput {Click up}
Sleep 35
}

XButton1::
^XButton1::
+XButton1::
Loop
{
GetKeyState, XButton1State, XButton1, P
if XButton1State=U
break
Sendinput {Click down}
Sleep 35
Sendinput {Click up}
Sleep 35
}


hitmanXX
  • Members
  • 1 posts
  • Last active: Jan 03 2008 10:01 PM
  • Joined: 03 Jan 2008
i am using a scrip to throw a bag of medic stuff and reselect main weapon, the script does not select the medic bag in the first place, it mearly throws/fires whatever your holding and switches back to main gun, so i suppose it does work, i just want it to select medic pack automaticly ie (using main gun) press script button > script button selects script, script throws bag> script reselects main weapon.

i want the script to select medic pack in the first place, and activate the script

i think i need to use the script that allows 1 key to activate 2 actions but i dont know how to implement this into this ?

im using this script :
; 
; AutoHotkey      Version: 1.1.2878+ 
; Language:       English 
; Platform:       Win9x/NT 
; 
; 
; Only run this script when bf2.exe is running in the foreground 
; 
#SingleInstance force 
#InstallKeybdHook 
#InstallMouseHook 


SetTimer, KeepRunning 
return 

KeepRunning: 

  ; Get the process name of the active window (i.e. Notepad.exe) 
  WinGet, szProcessName, ProcessName, A 
  if szProcessName = bf2.exe 
  { 
    Suspend, off 
  } 
  else 
  { 
    Suspend, on 
  } 
return 

; 
; Disable the Window's keys so they don't switch to desktop while in-game 
; 
$LWin::   ; Left Windows Button 
$RWin::   ; Right Windows Button 
   ; Do nothing 
return 

$^CapsLock:: 
   ExitApp 
return 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
; 
; Pressing Ctrl+V while BF2 is active 
; 
$^v:: 
   Sleep 200 
   SetKeyDelay, 40 
   Send,  {Space}%clipboard% 
   SetKeyDelay, 0 
return 

ThrowClaymoreOnly() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 950 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Send, {3 down} 
   Sleep 40 
   Send, {3 up} 
} 

ThrowMedicBag() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 100 
   MouseClick, Left, , , , , D 
   sleep 400 
   MouseClick, Left, , , , , U 
   Send, {3 down} 
   Sleep 40 
   Send, {3 up} 
} 

ThrowSupplyOrMedicBagC4() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 600 
   MouseClick, Left, , , , , D 
   sleep 400 
   MouseClick, Left, , , , , U 
   Send, {3 down} 
   Sleep 40 
   Send, {3 up} 
} 

ThrowATMineOrSupplyMedicBagC4() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 999 
   MouseClick, Left, , , , , D 
   sleep 500 
   MouseClick, Left, , , , , U 
   Send, {3 down} 
   Sleep 40 
   Send, {3 up} 
} 

ThrowC4() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 400 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Send, {3 down} 
   Sleep 40 
   Send, {3 up} 
} 

ThrowC4andSwitchToDetinator() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 500 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, right, , , , , D 
   sleep 100 
   MouseClick, right, , , , , U 
} 

Throw2xC4andSwitchToDetinator() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 500 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   sleep 700 
   MouseClick, right, , , , , D 
   sleep 100 
   MouseClick, right, , , , , U 
} 

Throw3xC4andSwitchToDetinator() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 500 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   sleep 700 
   MouseClick, right, , , , , D 
   sleep 100 
   MouseClick, right, , , , , U 
} 

Throw2xC4andExplode() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 500 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   sleep 700 
   MouseClick, right, , , , , D 
   sleep 100 
   MouseClick, right, , , , , U 
   Sleep 200 
   MouseClick, left, , , , , D 
   sleep 100 
   MouseClick, left, , , , , U 
} 

ThrowC4andExplode() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 500 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, right, , , , , D 
   sleep 100 
   MouseClick, right, , , , , U 
   Sleep 200 
   MouseClick, left, , , , , D 
   sleep 100 
   MouseClick, left, , , , , U 
} 

Throw3xC4andExplode() 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 500 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   Sleep 700 
   MouseClick, Left, , , , , D 
   sleep 100 
   MouseClick, Left, , , , , U 
   sleep 700 
   MouseClick, right, , , , , D 
   sleep 100 
   MouseClick, right, , , , , U 
   Sleep 200 
   MouseClick, left, , , , , D 
   sleep 100 
   MouseClick, left, , , , , U 
} 

ThrowAny() ; Slow 
{ 
   Send, {5 down} 
   Sleep 60 
   Send, {5 up} 
   Sleep 1000 
   MouseClick, Left, , , , , D 
   sleep 500 
   MouseClick, Left, , , , , U 
   Send, {3 down} 
   Sleep 40 
   Send, {3 up} 
} 

; 
; Remove Comment ';' to do that function 
; 
$5:: 
$+5:: ; Shift + 5 (must depress Shift briefly - can't use kit while sprinting) 

;ThrowClaymoreOnly() 
ThrowMedicBag() 
;ThrowSupplyOrMedicBagC4() 
;ThrowATMineOrSupplyMedicBagC4() 
;ThrowC4() 
;ThrowC4andSwitchToDetinator() 
;Throw2xC4andSwitchToDetinator() 
;Throw3xC4andSwitchToDetinator() 
;Throw2xC4andExplode() 
;ThrowC4andExplode() 
;Throw3xC4andExplode() 
;ThrowAny() ; Slow 

return


engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
please use code tags for your script in the forum. I added them for you in this case.

Thanks for listening.

Vinc3nt23
  • Guests
  • Last active:
  • Joined: --
Just add

F6::Suspend, toggle


before the whole thing, that way F6 toggles suspend On or Off anytime!

jaja
  • Guests
  • Last active:
  • Joined: --
iv added that but then noting will fork.

i wanna it to only activate when i start bf2 but i must be able turn it on and of ingame thats my problem, it wont do it in game.


;
; AutoHotkey      Version: 1.1.2878+
; Language:       English
; Platform:       Win9x/NT
;
;
; Only run this script when bf2.exe is running in the foreground
;
#SingleInstance force
#InstallKeybdHook
#InstallMouseHook


SetTimer, KeepRunning
return

KeepRunning:

  ; Get the process name of the active window (i.e. Notepad.exe)
  WinGet, szProcessName, ProcessName, A
  if szProcessName = bf2.exe
  {
    Suspend, off
  }
  else
  {
    Suspend, on
  }
return

;
; Disable the Window's keys so they don't switch to desktop while in-game
;
$LWin::   ; Left Windows Button
$RWin::   ; Right Windows Button
   ; Do nothing
return

$^CapsLock::
   ExitApp
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Pressing Ctrl+V while BF2 is active
;
#NoEnv
#SingleInstance force 
SendMode Input

Lbutton::
Loop
{
GetKeyState, state, Lbutton, P
if state=U
break
Sendinput {Click down}
Sleep 35
Sendinput {Click up}
Sleep 35
}


Joker
  • Guests
  • Last active:
  • Joined: --
A little late, but try this:

#NoEnv
#SingleInstance force
SendMode Input

Rbutton::
Loop
{
	GetKeyState, state, Rbutton, P
	if state=U
	break
	Sendinput {Click down}
	Sleep 50
	Sendinput {Click up}
	Sleep 35
}
Return

;Pauses AutoHotKey Script.
F1::Suspend, Toggle

It needs the return command to end the execution, or it will continue until the end of the script.

  • Guests
  • Last active:
  • Joined: --
Is there any way to suspend the section of code without suspending the entire script?

nissen1502
  • Guests
  • Last active:
  • Joined: --
~F9::Suspend, Toggle
*lbutton::
Loop
{
GetKeyState, state, lbutton, P
if State = U
break
; Otherwise:
Send, {lbutton}
Sleep, 0.1
}
return

works like a dream :)

orelz
  • Guests
  • Last active:
  • Joined: --
Sorry to up this topic.
But I recently use this script and it works but is it possible to do the same to work if I click on Lbutton AND/OR if I press Rshift & Lbutton?

If I only do this, it doesn't work: Do I need to duplicate state line for RShift?

RShift & Lbutton::
Loop
{
   GetKeyState, state, Lbutton, P
   if state=U
   break
   Sendinput {Click down}
   Sleep 5
   Sendinput {Click up}
   Sleep 5
}
Return


F1::Suspend, Toggle

Thanks a lot!

codybear
  • Members
  • 600 posts
  • Last active: Feb 09 2015 12:41 PM
  • Joined: 15 Sep 2009
Edit: Wayyyy too late. :D

orelz
  • Guests
  • Last active:
  • Joined: --

Edit: Wayyyy too late. :D

Hum??