Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. ;Enter your TXT file path .
  2. filePath = C:\Users\Kevin\Documents\YOUTUBE\PRODUCTION\darksoulsDeathCounter\deaths.txt
  3. FileReadLine, deathVar, %filePath%, 1
  4.  
  5. ;When you press F12 it will increment and update the death counter in the .txt
  6. F12::
  7. ;Creates txt file if it doesn't exist.
  8. IfNotExist, %filePath%
  9. FileAppend,0, %filePath%
  10. ;Created a file.
  11. ;Inputs number of deaths in deathVar variable.
  12. FileReadLine, deathVar, %filePath%, 1
  13. Var := ++deathVar
  14. FileDelete, %filePath%
  15. FileAppend,%deathVar%, %filePath%
  16. return
  17.  
  18. ;When you press F11 it will decrement and update the death counter in the .txt
  19. F11::
  20. ;Creates txt file if it doesn't exist.
  21. IfNotExist, %filePath%
  22. FileAppend,0, %filePath%
  23. ;Created a file.
  24. ;Inputs number of deaths in deathVar variable.
  25. FileReadLine, deathVar, %filePath%, 1
  26.  
  27. if deathVar = 0
  28. return
  29.  
  30. Var := --deathVar
  31. FileDelete, %filePath%
  32. FileAppend,%deathVar%, %filePath%
  33. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement