Welcome, Guest.
Username: Password: Remember me

TOPIC: AutoHotKey script for toggling effects

AutoHotKey script for toggling effects 1 year 8 months ago #1

  • jmp909
  • jmp909's Avatar
  • Offline
  • Posts: 135
  • Thank you received: 48
(thanks to Mobeeuz for the heads up on this and the base code)

I have written a small script for AutoHotKey that will let you define keys to swap out the 1s and 0s in MasterEffect.h without having to leave the game
pastebin.com/qfkpQsXn

It's not well tested but seems to work ok.

It relies on ReShade's auto-recompile when it detects a change to the settings file (in this case MasterEffect.h). You need to give it a couple of seconds before switching again, otherwise you're going to end up toggling your values in your file but ReShade won't pick them up, then if you try toggle again you'll be back to your original value obviously

INSTRUCTIONS
* Install AutoHotKey from http://www.autohotkey.com/
* download my script from [b]http://pastebin.com/qfkpQsXn[/b]
* place the file in your game folder as an .ahk file eg ToggleFX.ahk
* doubleclick the .ahk file and it should now run in the background

NOTES
currently I've only included 2 modifiers, but if you look at the bottom of the script you can see where to add more. (note # means Windows Key as Modifier so eg Windows+Numpad 1)
#Numpad1::FXSwitch("USE_DEPTHBUFFER_OUTPUT")
#Numpad2::FXSwitch("USE_TONEMAP")

WARNING: it deletes your MasterEffect.h file before rewriting it so make a backup before trying this out

all it's essentially doing is looking for your string (eg USE_TONEMAP) followed by any number of spaces and then a 0 or 1, up to an end of line which is \r\n here. you may need to adapt the script if your text editor doesn't use \r\n. It then changes that 0 to a 1 and viceversa and rewrites the whole file

There would be better ways to do it with readline probably and my RegEx could be improved, but it'll do for now. Feel free to make a better version!

regards
J
Last Edit: 1 year 8 months ago by jmp909.
The administrator has disabled public write access.
The following user(s) said Thank You: BrandonHortman

AutoHotKey script for toggling effects 1 year 8 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1390
Nice, this is handy! =)
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: jmp909