Jump to content

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

semi auto script help? please!



  • Please log in to reply
15 replies to this topic
CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

Can someone help me with my semi auto script? a game i play has weapons that are fully auto, but alot of recoil, so i was struggling for hours trying to make a semi auto script.. with no success on my own, i came here.

 

im wanting something like this

 

hold LButton down = click lbutton once, wait, click lbutton once, wait, (etc...)

also want so i can hold left shift down too without it messing up the script.

 

i made a script like this before on my old pc but it broke so now i need this script again and cant find one or re make it.

 

(if no one can help with the above script a script like this will work too)

 

hold lbutton = click lbutton once. (nothing more, no more rapid fire etc..)

so i can spam click and even if i hold it, it only shoots once. not fully auto)

 

 

Thanks - CaveLion 

 

Ps. if i posted in wrong spot mod pls move?



lilygel
  • Members
  • 249 posts
  • Last active: May 26 2017 04:13 AM
  • Joined: 18 Feb 2015
Here is one way of spamming a button with delay in between.
$LButton::
Loop
{
Click ; or Send {LButton}
Sleep 300 ; amount of delay in milliseconds
}
return

Sometimes, AHK doesn't work well with games so you might want to check out this link http://www.autohotke...mes-the-basics/

CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

This script at first was nice. but i have issues.

once i turn on script/run it  i cant click my game because the script doesnt allow me to open game. is ther anyway that i can use that script BUT add a feature so i hit "X" to suspend hot keys and pause it??  

 

thanks. 

 



lilygel
  • Members
  • 249 posts
  • Last active: May 26 2017 04:13 AM
  • Joined: 18 Feb 2015
Add this line
x::Suspend
EDIT:
$LButton::
while getkeystate("LButton", "P")
{
	Click
	sleep 300
}
return
This might work better than the Loop script.

Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

You might also want to make it specific to your game to avoid causing issues when your game is not running...

#IfWinActive, WindowTitleOfYourGame
$LButton::
while getkeystate("LButton", "P")
{
Click
sleep 300
}
return
#IfWinActive


CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

I now have an interest in another script for counter strike global offensive.

 

i need it to work something like this: 

; right-click -> shift+click, ctrl+right-click -> right-click
RButton::
Send +{LButton}
GetKeyState, LB, LButton, P
if (LB == "D") {
Send {LButton down}
}
Return
^RButton::
Click Right
Return
 
;
how i need it is  when i left click  once it counts as left clicking,     if i hold left button down, i want it to click once, no more
it should be similar to that^^?  
im not sure.. i used that script and when i right click it does what i want, but i need it for left click***
i also still want to be able to use LShift and Lctrl  without it effecting the script. 
can anybody help me please?!!?!?  (i had it at one point like this, but cant find it anywhere.. ;c


CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

edit: i finally got tthe script im wanting :D   the only issue is,     ingame  left shift   and left ctrl are very important and used alot,  and i need to be able to hold left shift,   and left ctrl  while still using my script, is there a way so left shift and left ctrl does not effect the currently running script?  

 

script that works:

 
 
; left-click -> left-click
LButton::
Send +{LButton}
GetKeyState, LB, LButton, P
if (LB == "D") {
Send {LButton }
}
Return
^LButton::
Click Right
Return
 
;


CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

Anyone help me?  i got my script but i need to make it so left shift. and left control dont effect the script (currently if i hold shift or control it stops the script)   



CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

bump  still need help, plss     i cant find it anywhere,  how to    makeleft shift and cntrl not effect the currently running script  



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

 

edit: i finally got tthe script im wanting :D   the only issue is,     ingame  left shift   and left ctrl are very important and used alot,  and i need to be able to hold left shift,   and left ctrl  while still using my script, is there a way so left shift and left ctrl does not effect the currently running script?  

 

script that works:

 
 
; left-click -> left-click
LButton::
Send +{LButton}
GetKeyState, LB, LButton, P
if (LB == "D") {
Send {LButton }
}
Return
^LButton::
Click Right
Return
 
;

 

 

Shift and Ctrl seem to work normally for me while that code is running.  What is the issue you are seeing?



CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

i need to be able to hold  lctrl/lshift and use the script, currently it does not work,   

 

the script turns a fully auto gun to semi auto.  kinda

 

the script seems to disable when holding Lctrl/ Lshift  and using the script.

i dont no how to fix this but need help



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

I do not see that behavior when I test the script (exactly as shown above) on my system.   Do you have ANY other code in your script?  If so, please post your entire script, so that we can see if there may be some other section causing issues.  If you do not have any other code, then I would assume your game is intercepting the keys and not allowing AHK to read them properly.



CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

I do not see that behavior when I test the script (exactly as shown above) on my system.   Do you have ANY other code in your script?  If so, please post your entire script, so that we can see if there may be some other section causing issues.  If you do not have any other code, then I would assume your game is intercepting the keys and not allowing AHK to read them properly.

 

the entire script is    

*Lbutton:: return
 
; left-click -> left-click
 
LButton::
 Send +{LButton}
 GetKeyState, LB, LButton, P
 if (LB == "D") {
  Send {LButton }
 }
Return
^LButton::
 Click Right
Return
 
;
 
 
f12::
suspend
pause
return
 
 
 
 
when  i play i use WASD to move F E left ctrl left shift space bar  Q 12345 G   thats basically all i use, the ctrl and shift are very important for this game.
Im also on windows 10 if that makes a difference. 
(what this script does is makes it so if i were to try and click and hold, it would click once, not hold. Ex  clicking and draging on desktop  highlights a square.   with this script it doesnt do that.  What im going to be using this for is a game where i turn a fully auto gun into a semi auto,  so click holding (fully auto) doesnt work, and it forces me to spam click (turns fully auto to semi auto, which makes the gun more accurate. )
 
Thanks for all the help so far.  it would be great if we can solve this :D


Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014
✓  Best Answer

The *LButton::Return line completely disables the LButton and any keys held down with it (IE: Shift+LButton, Alt+LButton, etcetera).  The LButton:: line re-enables LButton when it is pressed by itself (no other keys allowed).  The ^LButton:: line re-enables Ctrl+LButton, and the following 3 lines of code turn it into a right-click.  In other words, so long as the LButton is held down, SHIFT will do nothing and CTRL will give you a right-click.

 

Try this instead...

~*$LButton::
Send +{LButton}
GetKeyState, LB, LButton, P
if (LB == "D") {
  Send {LButton }
}
Return
 
!LButton::    ; I changed this to Alt+LButton, so that you can use Ctrl normally.
Click Right
Return

;


f12::
suspend
pause
return


CaveLion
  • Members
  • 11 posts
  • Last active: Dec 03 2015 12:03 PM
  • Joined: 07 Aug 2015

works perfectly!! thank you soo much. only one who bothered to help :D