minor updates to print and wait timing
This commit is contained in:
parent
018f5b4d9f
commit
5589a95a8f
@ -15,11 +15,16 @@ looptestPath = '/home/gameservers/.steam/steam/steamapps/common/Counter-Strike S
|
||||
chatmsg = ""
|
||||
ladder_counter = 0
|
||||
|
||||
def writeCfgInput(Input):
|
||||
def colored(r, g, b, text):
|
||||
return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text)
|
||||
|
||||
def writeCfgInput(Input_user):
|
||||
with open(looptestPath, 'w') as f:
|
||||
if input == "wait 5;":
|
||||
time.sleep(1)
|
||||
f.write(Input)
|
||||
colored_text = colored(255, 0, 0, ('Input: ' + Input_user))
|
||||
print(colored_text)
|
||||
f.write(Input_user)
|
||||
|
||||
def exit_handler():
|
||||
print('reached exithandler')
|
||||
@ -29,6 +34,7 @@ def joinTeam():
|
||||
str = "jointeam 2; joinclass 3; zspawn;"
|
||||
writeCfgInput(str)
|
||||
print('jointeam func: ')
|
||||
writeCfgInput('wait 5;')
|
||||
|
||||
def bot_process_surf(input_line):
|
||||
bot_surf_plane = input_line[input_line.index("surfing:") + len("surfing:"):]
|
||||
@ -138,6 +144,7 @@ def bot_connect_ze():
|
||||
strdev = "connect 151.80.230.149:27019/test132;"
|
||||
str1 = "connect 151.80.230.149:27015;"
|
||||
writeCfgInput(str1)
|
||||
writeCfgInput('wait 5;')
|
||||
print('not yet connected')
|
||||
|
||||
if __name__ == '__main__':
|
||||
@ -168,6 +175,7 @@ if __name__ == '__main__':
|
||||
response_msg = f"""say {data}"""
|
||||
print("enabled remote UDP packet response_msg: ", response_msg)
|
||||
writeCfgInput(response_msg)
|
||||
writeCfgInput("wait 5;")
|
||||
if data == "autismo connected":
|
||||
print('Bot connected!')
|
||||
connection_issue_counter = 0
|
||||
|
Loading…
Reference in New Issue
Block a user