Created
September 6, 2016 17:01
-
-
Save yeahunter/52de109ee559861812f2e07639517e5c to your computer and use it in GitHub Desktop.
DEATHCOUNTER
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;Enter your TXT file path . | |
| filePath = E:\Users\Peti\Stream\AHK\deaths.txt | |
| FileReadLine, deathVar, %filePath%, 1 | |
| ;When you press F12 it will increment and update the death counter in the .txt | |
| F12:: | |
| ;Creates txt file if it doesn't exist. | |
| IfNotExist, %filePath% | |
| FileAppend,0, %filePath% | |
| ;Created a file. | |
| ;Inputs number of deaths in deathVar variable. | |
| FileReadLine, deathVar, %filePath%, 1 | |
| Var := ++deathVar | |
| FileDelete, %filePath% | |
| FileAppend,%deathVar%, %filePath% | |
| return | |
| ;When you press F11 it will decrement and update the death counter in the .txt | |
| F11:: | |
| ;Creates txt file if it doesn't exist. | |
| IfNotExist, %filePath% | |
| FileAppend,0, %filePath% | |
| ;Created a file. | |
| ;Inputs number of deaths in deathVar variable. | |
| FileReadLine, deathVar, %filePath%, 1 | |
| if deathVar = 0 | |
| return | |
| Var := --deathVar | |
| FileDelete, %filePath% | |
| FileAppend,%deathVar%, %filePath% | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment