mirror of
https://github.com/ENSL/ensl_hlds.git
synced 2025-01-19 07:01:02 +00:00
Add FPS script
Add some really hacky FPS script for quick testing. Dont use.
This commit is contained in:
parent
2dd674a98f
commit
655e7fbcd6
1 changed files with 20 additions and 0 deletions
20
scripts/fps_data.py
Normal file
20
scripts/fps_data.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import rHLDS, yaml, re, time, os
|
||||||
|
|
||||||
|
# Default port 27015
|
||||||
|
srv = rHLDS.Console(host=os.environ['RCON_HOST'], port=os.environ['RCON_PORT'], password=os.environ['RCON_PASSWORD'])
|
||||||
|
|
||||||
|
# Connect to server
|
||||||
|
srv.connect()
|
||||||
|
|
||||||
|
file1 = open("data.txt", "a+")
|
||||||
|
|
||||||
|
while True:
|
||||||
|
data = srv.execute("stats")
|
||||||
|
fps = re.search('(\d+.?\d*)(\d+.?\d*\s*)(\d+.?\d*\s*)(\d+.?\d*\s*)(\d+.?\d*\s*)(\d+.?\d*\s*)(\d+.?\d*\s*)', data).group(7)
|
||||||
|
if fps:
|
||||||
|
file1.write("%d,%s\n" % (time.time(), fps))
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
|
file1.close()
|
||||||
|
srv.disconnect()
|
||||||
|
|
Loading…
Reference in a new issue