diff --git a/AutismBotIngame/python/rejoinze.py b/AutismBotIngame/python/rejoinze.py new file mode 100644 index 00000000..5c38c37c --- /dev/null +++ b/AutismBotIngame/python/rejoinze.py @@ -0,0 +1,24 @@ +import subprocess +import threading +import time + +def resetCfgInputShortWait(): + str = "wait 1; getpos; wait 1; exec looptest.cfg;" + with open('/home/nonroot/.steam/steam/steamapps/common/Counter-Strike Source/cstrike/cfg/looptest.cfg', 'w') as f: + f.write(str) + +def writeCfgInput(Input): + with open('/home/nonroot/.steam/steam/steamapps/common/Counter-Strike Source/cstrike/cfg/looptest.cfg', 'w') as f: + f.write(Input) + +def rejoinze(): + threading.Timer(60.0 * 20, rejoinze).start() + open('/home/nonroot/.steam/steam/steamapps/common/Counter-Strike Source/cstrike/console.log', 'w').close() + writeCfgInput("connect 151.80.230.149:27015; wait 500; exec looptest.cfg;") + time.sleep(2) + resetCfgInputShortWait() + #server_ip_ze = "151.80.230.149:27015" + #subprocess.Popen(["steam", "steam://connect/" + server_ip_ze]) + +if __name__ == '__main__': + rejoinze() \ No newline at end of file