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 

AutoAccelerator for racing games

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
HuBa



Joined: 24 Feb 2007
Posts: 172
Location: Budapest, Hungary

PostPosted: Tue Dec 18, 2007 1:06 am    Post subject: AutoAccelerator for racing games Reply with quote

By playing car simulators I noticed that I always press the Up arrow to achieve the highest speed. There were only a few times that I had to release the accelerator button (Up arrow) during a game.
And there is another factor that people's mind tend to believe that by pressing the Up button harder, the "faster" the car goes.

So I decided to make an end of this "always accelerating" thing.
Let me introduce you the AutoAccelerator for racing games!

It can be used in any type of simulator or arcade games: car, motor, ship, spaceship, winter-sports, etc.


Code:
; AutoAccelerator.ahk -  Automatic accelerator for arcade and simulator racing games
;
; With this script you are able to go forward without touching the Up arrow button.
; Press the CapsLock to toggle auto-acceleration.
; It simulates pressing Up arrow.
;
; Pressing the Down or Up arrow will stop acceleration.
; You have to press CapsLock again to reenable acceleration.
;
; You have to replace the "GroupAdd RacingGame" window titles with your own games to enable this effect.
;
; Tested with AutoHotkey 1.0.47.04
;
; Created by HuBa
; Contact: http://www.autohotkey.com/forum/profile.php?mode=viewprofile&u=4693
;
; Discussion forum of this script: http://www.autohotkey.com/forum/viewtopic.php?t=26736

Menu Tray, Icon, %A_WinDir%\system32\joy.cpl  ; Joystick tray icon

GroupAdd RacingGame, MotorSport  ; Replace this window title!
GroupAdd RacingGame, Rally
GroupAdd RacingGame, Ski

#IfWinActive ahk_group RacingGame

~CapsLock::
if GetKeyState("CapsLock", "T")
  Send {Up Down}  ; Start accelerating
else
  if GetKeyState("Up")
    Send {Up Up}  ; Terminate acceleration
Return

~Up Up::  ; End of acceleration
if GetKeyState("CapsLock", "T")
  SetCapsLockState Off
Return

~Down::  ; Decelerate
if !GetKeyState("CapsLock", "T")
  Return
SetCapsLockState Off
Send {Up Up}  ; Terminate acceleration
Return

#IfWinActive
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions 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