Saving hits directly to a textfile
-
Hi I was wondering how I would go about saving hits directly to a text file rather than to the hits DB. I ask because sometimes the DB file gets too large so just storing it as a readable text file would make everything a lot easier. Many thanks!
-
Hey, if you want you can edit the config and add a UTILITY block (append to file). Otherwise you could just clean your Hits DB by exporting your hits every once in a while. The last option would be to edit the source code, it really takes a couple of lines to get what you want to do.
-
Great thank you managed to get it working. Any ideas what the max text file size OB can handle is?
-
I'm pretty sure it can handle any size since it's just appending stuff, not reading the whole file.
-
@lukesped Can u post a screenshot for the UTILITY block settings?
-
how would I go about doing this also?
-
@NullData said in Saving hits directly to a textfile:
how would I go about doing this also?
@GemreNa said in Saving hits directly to a textfile:
@lukesped Can u post a screenshot for the UTILITY block settings?
VERY basic and quick example in loliscript that will write the captured data (as shown) to a file located in your OB folder. Edit it to your needs. Im sure there is a more efficient way of doing it but this should give you a general idea.
PARSE "<SOURCE>" JSON "TIER" -> CAP "TIER" PARSE "<SOURCE>" JSON "Exp" -> CAP "EXP" PARSE "<SOURCE>" JSON "Rewards" -> CAP "REWARDS" PARSE "<SOURCE>" JSON "Points" -> CAP "POINTS" UTILITY File "NAME OF TXT FILE.txt" Append "<USER>:<PASS> - <TIER> - <EXP> - <REWARDS> - <POINTS> \r\n"