Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save Variables in .txt file without tabbing out of actual window
#1
Hey,

i would be happy to get some help to create a Macro for a friend who streams on Twitch and unses OBS for a text overlay. I already got some things up and running. The Macro counts Kills, Chickendinners and other things related to pubg when the player presses the hotkeys.

Code:
Copy      Help
int k ;;killcounter actual match
int c ;; chickendinner counter today
int m ;; match counter
int d ;; death counter
k = 0
c = 0
m = 0
d = 0
 1
rep() 0.05;
    ;; Count Rounds
    if (ifk(CS) and ifk(m)) ;; Add +1 to Rounds if Control Shift and m is pressed
        wait 0.25
        m=m+1
        out F"Rounds: {m}"
        OnScreenDisplay F"Round {m}"
    ;; Count Kills
    if (ifk(CS) and ifk(k))
        wait 0.25
        k=k+1
        out F"Kills: {k}"
        OnScreenDisplay F"Kills {k}"
    ;; Count Chickendinners
    if (ifk(CS) and ifk(c))
        wait 0.25
        c=c+1
        out F"Chickendinners: {c}"
        OnScreenDisplay F"Chickendinners {c}"
    ;; Count Deaths
    if (ifk(CS) and ifk(d))
        wait 0.25
        d=d+1
        out F"Deaths: {d}"
        OnScreenDisplay F"Deaths: {d}"
    ;; Reset all Counters with Concrol Shift r
    if (ifk(CS) and ifk(r))
        k = 0
        c = 0
        m = 0
        d = 0
        OnScreenDisplay "Reset all counters"
    ifk(F12) ret ;;end if F12 is pressed
    goto 1
    break

;; The folder where the txt file should be saved
;; str sData.getfile("$documents$\Kills.txt") ;;get file data
;; .txt file content:
;; Matches: 0
;; Kills: 0
;; Chickendinners: 0
;; Deaths: 0

;; The OnScreenDisplay is just for testing purpose. ;)


Now i want the macro to save the variables into a predefined .txt file when he presses a key. The best solution would be if the txt file gets saved without defocusing the game. But its also important that the macro can be saved as an exe because he doesnt own a QM license. If it is possible to save the variables to .txt without defocusing the game it would be great if it is saved instantly when he uses one of the functions. This would mean his Stream overlay will be updated instantly. If that isnt possible, he would be ok with a save hotkey.

I searched a lot but i have no idea how to write this. It took me two hours to find out how to write this macro.   Blush

Thanks in advance for your help!


Messages In This Thread
Save Variables in .txt file without tabbing out of actual window - by Remotehorst23 - 12-27-2018, 02:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)