AutoHotkey Community

It is currently May 26th, 2012, 3:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Help with Bhop script :/
PostPosted: April 21st, 2008, 2:09 pm 
I play half life 1 alot and find it very funny to bunnyhop but heres my problem

Code:
*Lalt::
Loop
{
GetKeyState, state, LAlt, P
if State = U
break
; Otherwise:
Send, {Space}
Sleep, 1
return
}


This is my current script... It works as a charm... But when i duck while jumping, my screen kindda "Spass" while i hold Ctrl... Because it want to duck but the spamming of space makes it go up again... But i found, if i put
Code:
*Lalt::
Send, {Ctrldown}
Loop
{
GetKeyState, state, LAlt, P
if State = U
break
; Otherwise:
Send, {Space}
Sleep, 1
Send, {Ctrldown}
return
}


It does not spam... But i dont wanna be ducked while bunnyhopping... Sooooo here comes my question

Code:
*Lalt::
Loop
{
GetKeyState, state, LAlt, P
if State = U
break
; Otherwise:
Send, {Space}
Sleep, 1
GetKeyState, state, Ctrl, P
if State = (Help needed here)
Send {Ctrldown}
; Otherwise:
Send, {Ctrlup}
}
return


So all i need to know is... Whats the opposite of the U? :/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 2:27 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
That would be D:
Code:
if State = D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 2:37 pm 
Offline

Joined: April 9th, 2008, 8:46 am
Posts: 35
Location: Espoo, Finland
As much as I think you need to be told to rtfm, why don't you just do it like this:
Code:
*LAlt::
Loop
{
  If (!GetKeyState("LAlt"))
    break
 
  If (!GetKeyState("LControl"))
    Send, {Space}

  Sleep, 10
}
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 3:08 pm 
orbik wrote:
As much as I think you need to be told to rtfm, why don't you just do it like this:
Code:
*LAlt::
Loop
{
  If (!GetKeyState("LAlt"))
    break
 
  If (!GetKeyState("LControl"))
    Send, {Space}

  Sleep, 10
}
return


Nop doesent work
It says:
"Error at line 4.

Line Text: If(!GetKeyState("LAlt"))
Error: When used this way, the symbol must be "!=" not "!".

The script was not reloaded; the old version will remain in effect"

And i tryed to change the ! to != but then it says another error.. :/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 4:05 pm 
Offline

Joined: April 9th, 2008, 8:46 am
Posts: 35
Location: Espoo, Finland
Do you have the latest version installed?
Anyway, I made a mistake: You must use either
Code:
*~LAlt::
or
Code:
If (!GetKeyState("LAlt", "p"))

Apparently the logical key state doesn't get updated without the ~


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 4:21 pm 
Nop doesent work... My sensivity gets alot lower when i bhop and when i duck my senstivity goes to 0... Nothing to do with game, its all in script :/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 5:20 pm 
Offline

Joined: April 9th, 2008, 8:46 am
Posts: 35
Location: Espoo, Finland
I did dome testing in Q3A and at least the following works perfectly. I never got the hang of SetKeyDelay so I just send up and down events explicitly. Also, the game seems to mess with logical key states so getting the "physical" state is safer.
Code:
SendMode, Input
*LAlt::
   Loop
   {
      If (!GetKeyState("LAlt", "p"))                                                             
         break

      If (!GetKeyState("LControl"))
      {
         Send, {Space down}
         Sleep, 10
         Send, {Space up}
      }
      Else
         Sleep, 10
   }
return


EDIT:
I guess this would work just as well:
Code:
...
      If (!GetKeyState("LControl"))
         Send, {Space down}

      Sleep, 10
   }
return

*LAlt up::Send, {Space up}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 5:55 pm 
DANG! You are so close to a breakthrough :/... But when i jump, i sometimes land and stand still for like .5 sec making my bunnyhop fail :(...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2008, 6:07 pm 
Hey! wait a sec!
Code:
*LAlt::
Loop
{
  If (!GetKeyState("LAlt" "p"))
    break
 
  If (!GetKeyState("LControl"))
    Send, {Space}

  Sleep, 10
}
return   
This code works perfect :D

The bugged code was
Code:
*~LAlt::
Loop
{
  If (!GetKeyState("LAlt"))
    break
 
  If (!GetKeyState("LControl"))
    Send, {Space}

  Sleep, 10
}
return   


Thanks for your help dewd!


Report this post
Top
  
Reply with quote  
 Post subject: :((((
PostPosted: April 30th, 2008, 7:13 pm 
It somehow doesent work anymore, when i press another button it stops working...
Help please :(


Report this post
Top
  
Reply with quote  
 Post subject: having the same problem
PostPosted: August 19th, 2009, 5:10 pm 
Dryvnt wrote:
DANG! You are so close to a breakthrough :/... But when i jump, i sometimes land and stand still for like .5 sec making my bunnyhop fail :(...


this delay of half a second after the first jump is what ruins it all. I just can't get around what I am doing wrong. Is this caused by my PC or by Counterstrike?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2009, 5:22 pm 
what I've tried out now is that I increased the 10ms to 37ms and this has now solved the problem of the lag after the first jump. but doing the bunnyhops with 37ms has now become impossible because thats just too slow. What I'm thinking is that one maybe just can't send keystrokes to CS:S in such a high frequency.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Bing [Bot], Exabot [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group