AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with Bhop script :/

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Dryvnt
Guest





PostPosted: Mon Apr 21, 2008 2:09 pm    Post subject: Help with Bhop script :/ Reply with quote

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? :/
Back to top
HugoV



Joined: 27 May 2007
Posts: 499

PostPosted: Mon Apr 21, 2008 2:27 pm    Post subject: Reply with quote

That would be D:
Code:
if State = D
Back to top
View user's profile Send private message
orbik



Joined: 09 Apr 2008
Posts: 25
Location: Espoo, Finland

PostPosted: Mon Apr 21, 2008 2:37 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Dryvnt
Guest





PostPosted: Mon Apr 21, 2008 3:08 pm    Post subject: Reply with quote

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.. :/
Back to top
orbik



Joined: 09 Apr 2008
Posts: 25
Location: Espoo, Finland

PostPosted: Mon Apr 21, 2008 4:05 pm    Post subject: Reply with quote

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 ~
Back to top
View user's profile Send private message
Dryvnt
Guest





PostPosted: Mon Apr 21, 2008 4:21 pm    Post subject: Reply with quote

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 :/
Back to top
orbik



Joined: 09 Apr 2008
Posts: 25
Location: Espoo, Finland

PostPosted: Mon Apr 21, 2008 5:20 pm    Post subject: Reply with quote

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}
Back to top
View user's profile Send private message
Dryvnt
Guest





PostPosted: Mon Apr 21, 2008 5:55 pm    Post subject: Reply with quote

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 Sad...
Back to top
Dryvnt
Guest





PostPosted: Mon Apr 21, 2008 6:07 pm    Post subject: Reply with quote

Hey! wait a sec!
Code:
*LAlt::
Loop
{
  If (!GetKeyState("LAlt" "p"))
    break
 
  If (!GetKeyState("LControl"))
    Send, {Space}

  Sleep, 10
}
return   
This code works perfect Very Happy

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

  Sleep, 10
}
return   


Thanks for your help dewd!
Back to top
Dryvnt
Guest





PostPosted: Wed Apr 30, 2008 7:13 pm    Post subject: :(((( Reply with quote

It somehow doesent work anymore, when i press another button it stops working...
Help please Sad
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group