[Solved]Autohotkey to toggle ADS for Rage

The place for all kinds of software for all kinds of operating systems.

Moderator: Dposcorp

[Solved]Autohotkey to toggle ADS for Rage

Postposted on Thu Dec 27, 2012 4:01 am

Hi guys,


So i've been looking all over the interwebs to find a workaround on how to toggle ADS (aim down the sight) and i found a few suggestions regarding autohotkey.


According to wikipedia autohotkey is described as follows:

Quote

AutoHotkey is a free, open-source macro-creation and automation software utility that allows users to automate repetitive tasks in Microsoft Windows. Any application user interface can be modified by AutoHotkey (for example, overriding the default Windows control key commands with their Emacs equivalents).[2] It is driven by a custom scripting language that is aimed specifically at providing keyboard shortcuts or hotkeys.

Unquote

<<<<<click me>>>>>> - the official site

According to Steam, autohotkey is A-OK if used to remap key and mouse clicks but it has been known to cause issues with some versions of punkbuster (beats me why).


Anyways since i felt like this was a solution to make ADS toggled i tried a few script codes but none worked in Rage, but worked fine in windows explorer.....


Here is the code i tryed:

Code: Select all
$RButton::

If NotPushed := Not NotPushed

Send {RButton Down}

Else

Send {RButton Up}

Return



Code: Select all
$RButton:: Send, % "{RButton " ( (Toggle:=!Toggle) ? "Down" : "Up" ) "}"



and


Code: Select all
$RButton::

Send, {RButton Down}

KeyWait, RButton ; see KeyWait

KeyWait, RButton, D

KeyWait, RButton

Send, {RButton Up}

Return



I tried them one after another and none worked within Rage. So i came here to ask for help if anyone knows how to make it work i'd be really greatful.


Regards,

Arc.

Disclaimer i have a very small knowledge of this script program, i just found out yesterday that it exists so go easy on me. The code above i found posted by others, i wasn't able to create it myself.
Last edited by Arclight on Sun Dec 30, 2012 6:06 am, edited 1 time in total.
nVidia video drivers FAIL, click for more info
Disclaimer: All answers and suggestions are provided by an enthusiastic amateur and are therefore without warranty either explicit or implicit. Basically you use my suggestions at your own risk.
Arclight
Gerbil Elite
 
Posts: 705
Joined: Tue Feb 01, 2011 3:50 am

Re: [Help]Autohotkey to toggle ADS for Rage

Postposted on Fri Dec 28, 2012 10:15 am

Arclight wrote:to Steam, autohotkey is A-OK if used to remap key and mouse clicks but it has been known to cause issues with some versions of punkbuster (beats me why).

Anyways since i felt like this was a solution to make ADS toggled i tried a few script codes but none worked in Rage, but worked fine in windows explorer.....

First off, you might want a line looking at the active window so it only applies its modification within rage. Second, yeah, it should be possible to use AHK to to a makeshift toogle. Havent used it in a while but I have a few scripts from others that they use to toogle things in diablo3 that I can look at when I get home, although those toogle a repeating pattern and not a hold-down.

As for why punkbuster has issues with it. AHK is powerful enough so some people actually created games within it. Sidescrolling spaceshooter. And with that power, you can do a whole lot of stuff. And the problem punkbuster has is that some people has created alot of different recoil compensating and rapid fire scripts for various games/weapons. In BF3 for instance you can go from having recoil to having every bullet land in the same area except for the pure bullet spread. And although I havent played CoD lately, IIRC the the rapid fire scripts in CoD will make you fire any semi-auto weapon almost as fast as a full auto, but with higher damage and probably better accurucy, etc. So do beware on which games you are playing when it is running.

I think it's a useful app with lots of real world usage, especially all the bad console ports with non workable key-bindings, etc. I remember before I found how to edit the configs for mirrors edge properly, that I used AHK to remap the numpad enter to jump.
Aphasia
Grand Gerbil Poohbah
 
Posts: 3468
Joined: Tue Jan 01, 2002 7:00 pm
Location: Solna/Sweden

Re: [Help]Autohotkey to toggle ADS for Rage

Postposted on Fri Dec 28, 2012 10:38 am

Aphasia wrote:First off, you might want a line looking at the active window so it only applies its modification within rage. Second, yeah, it should be possible to use AHK to to a makeshift toogle. Havent used it in a while but I have a few scripts from others that they use to toogle things in diablo3 that I can look at when I get home, although those toogle a repeating pattern and not a hold-down.[...]


I tried with
Code: Select all
#IfWinActive, Rage
but it still didn't work ingame....

If it's of any help, i installed the game on Steam so naturally it launches from there. Idk if that has any significance when making the script, that's why initially i didn't put any "#If" or "#IfWinActive" condition.
nVidia video drivers FAIL, click for more info
Disclaimer: All answers and suggestions are provided by an enthusiastic amateur and are therefore without warranty either explicit or implicit. Basically you use my suggestions at your own risk.
Arclight
Gerbil Elite
 
Posts: 705
Joined: Tue Feb 01, 2011 3:50 am

Re: [Help]Autohotkey to toggle ADS for Rage

Postposted on Sun Dec 30, 2012 1:46 am

Just a small question, have you tried starting and running the autohotkey as administrator so it has a higher security context then rage. Just for the purpose of troubleshooting.
Otherwise there is also a sleep mbuttonsleep that is included in some scripts I've seen due to some mouse click bug. Have you also tried rebinding ads to a keyboard key and just sending that one instead of mouse. Then bind mouse to send the toogle macro. Or if your mouse software can be set to activate the keyboard key.

Although since it worked fine in explorer, it might just be that once you get it to register in rage it'll work.
Aphasia
Grand Gerbil Poohbah
 
Posts: 3468
Joined: Tue Jan 01, 2002 7:00 pm
Location: Solna/Sweden

Re: [Help]Autohotkey to toggle ADS for Rage

Postposted on Sun Dec 30, 2012 3:16 am

Aphasia wrote:1. Just a small question, have you tried starting and running the autohotkey as administrator so it has a higher security context then rage. Just for the purpose of troubleshooting.

2. Otherwise there is also a sleep mbuttonsleep that is included in some scripts I've seen due to some mouse click bug.

3. Have you also tried rebinding ads to a keyboard key and just sending that one instead of mouse. Then bind mouse to send the toogle macro.

4. Or if your mouse software can be set to activate the keyboard key.

Although since it worked fine in explorer, it might just be that once you get it to register in rage it'll work.


1. I haven't yet, gonna try it out.
Edit: No change, it doesn't work ingame but works fine in explorer...
2. Like mentioned i have limited knowledge of this coding language, i will look into the mbuttonsleep thingy, hope i can find something.

3. That's an interesting idea, i would try it if you could help me with the code a bit. I doubt i can find it on my own but i will try.

4. I uninstalled the Microsoft specific driver (it's Microsoft comfort 6000). Will try to reinstall and see.
nVidia video drivers FAIL, click for more info
Disclaimer: All answers and suggestions are provided by an enthusiastic amateur and are therefore without warranty either explicit or implicit. Basically you use my suggestions at your own risk.
Arclight
Gerbil Elite
 
Posts: 705
Joined: Tue Feb 01, 2011 3:50 am

Re: [Help]Autohotkey to toggle ADS for Rage

Postposted on Sun Dec 30, 2012 5:58 am

Ok, i found a solution. It's a bit complicated but i couldn't have managed without your suggestions.

So i reinstalled the Micrsoft Mouse and Keyboard Center which has some pretty neat functions among which is app specific macro. Basically it let's you assign a key or key combinations (up to 64 i read) when you press a specific mouse button (the comfort 6000 has 5 mouse buttons: Left click, right click, scroll click when you press down the scroll button, a large and a small thumb buttons).

Firstly i rebinded zoom from Settings>Keyboard/Mouse>Controls within Rage. I binded zoom to Delete keyboard button and Mouse 4 (which for me is large thumb button). Then i went to the Mouse and Keyboard Center and in the macro options for Right mouse button (app specific "Rage") i put Delete (with a 10ms delay, which is the lowest).

Then i run the following code with authotkey:
Code: Select all
Del::
If NotPushed := Not NotPushed
Send {Del Down}
Else
Send {Del Up}
Return


I presume it could be done with the script alone, as it worked when i binded to Del and used Del to activate, it's just a matter of putting a few lines that makes Del press when you push the RButton. Should be easy, but since i'm a newby i made it more complicated.

Also i did notice a problem with this. When ADS works in this way and you fire a few bullits, then reload and want to walk or run while reloading the weapon, the game acts as if you are still zoomed in and you walk really slowly and can't run until you press zoom again to disable it.

I imagine a condition could be put to disable zoom when you press R and/or Left Shift, though i have no idea how to do it.

Anyways so far i'm satified with the results. ADS works again toggled, TAKE THAT id.

Edit: the fact that right mouse button activates Delete only within Rage, thanks to the macro, is also a big plus since i don't have to worry of deleting stuff when i Alt+Tab. In retrospect i should have probably used another button.
nVidia video drivers FAIL, click for more info
Disclaimer: All answers and suggestions are provided by an enthusiastic amateur and are therefore without warranty either explicit or implicit. Basically you use my suggestions at your own risk.
Arclight
Gerbil Elite
 
Posts: 705
Joined: Tue Feb 01, 2011 3:50 am

Re: [Solved]Autohotkey to toggle ADS for Rage

Postposted on Sun Dec 30, 2012 9:05 am

Nice that you got it working.

But the biggest problem here is.... no toogle/hold setting within the game settings, thats sheer stupidness on a modern game.
Aphasia
Grand Gerbil Poohbah
 
Posts: 3468
Joined: Tue Jan 01, 2002 7:00 pm
Location: Solna/Sweden


Return to General Software

Who is online

Users browsing this forum: No registered users and 5 guests