CTRL+Z counter, that writes counted number into a .txt file Topic is solved

Ask gaming related questions
User avatar
pixelhans
Posts: 3
Joined: 23 Jul 2020, 01:14

CTRL+Z counter, that writes counted number into a .txt file

23 Jul 2020, 01:21

hey guys!

I'm new to autohotkey and I try to make a script, that counts the number of CTRL+Z uses and writes that number into a new text file. The part that is counting the ctrl+z uses is done, but I don't know how to export that specific outcome into a textfile. Also I want to user ctrl+z normally, even with the script running.

The idea is, that I can put a ctrl+z counter on my stream layout :D

I hope you guys can help!!
Last edited by BoBo on 23 Jul 2020, 01:25, edited 1 time in total.
Reason: Moved to Gaming section.
User avatar
pixelhans
Posts: 3
Joined: 23 Jul 2020, 01:14

Re: CTRL+Z counter, that writes counted number into a .txt file

23 Jul 2020, 01:43

Code: Select all

Count := 0

^z::   
Count := Count + 1
FileAppend, %Count% `n, C:\**\**\Desktop\ctrlz.txt

return
something like this? it isnt creating a new file though AND i can't use ctrl+z normally with that
BoBo
Posts: 3647
Joined: 13 May 2014, 17:15

Re: CTRL+Z counter, that writes counted number into a .txt file  Topic is solved

23 Jul 2020, 05:58

Code: Select all

If !FileExist("keys.ini")    ; inifile exists?
	IniWrite, 0, keys.ini, CtrlZ, no   ; ok, let's create it
IniRead, cnt, keys.ini, CtrlZ, no   ; get current no of ctrl+z attempts
MsgBox % "No of Ctrl+z attempts:`t" . cnt 

~^z::    ; press Ctrl+z 
    ++cnt    ; increase no
    IniWrite,% cnt, keys.ini, CtrlZ, no     ; save that number for the next start
    Return
User avatar
pixelhans
Posts: 3
Joined: 23 Jul 2020, 01:14

Re: CTRL+Z counter, that writes counted number into a .txt file

23 Jul 2020, 11:35

oh that works like a charme!! thank you

I tried another version, too.. this is better for using OBS/Streamlabs, since those cant read ini files

Code: Select all

~^z::    ;
FileDelete, ctrlz.txt
++cnt    ;
FileAppend, %cnt%`n, ctrlz.txt
Return

Return to “Gaming”

Who is online

Users browsing this forum: royaldv8 and 18 guests