From 7b1441814d9fa36866c8f4073416303390bb356c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 19 Sep 2024 16:45:04 -0700 Subject: [PATCH] Update simulator.py --- etc/simulator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/simulator.py b/etc/simulator.py index f603551..dafa65e 100644 --- a/etc/simulator.py +++ b/etc/simulator.py @@ -36,10 +36,11 @@ if __name__ == '__main__': # represents the bot's main loop packet = "" nodeInt = 1 # represents the device/node number logger.info(f"System: Meshing-Around Simulator Starting for {projectName}") + nodeID = get_NodeID() # assign a nodeID while True: # represents the onReceive() loop in the bot.py - nodeID = get_NodeID() # assign a nodeID for this iteration projectResponse = "" responseLength = 0 + packet = input(f"CLIENT {nodeID} INPUT: " ) # Emulate the client input if packet != "": #try: projectResponse = globals()[projectName](nodeID, packet) # Call the project handler under test @@ -50,6 +51,6 @@ if __name__ == '__main__': # represents the bot's main loop responseLength = len(projectResponse) # Evaluate the response length logger.info(f"Device:{nodeInt} " + CustomFormatter.red + f"Sending {responseLength} long DM: " +\ CustomFormatter.white + projectResponse + CustomFormatter.purple + " To: " + CustomFormatter.white + str(nodeID)) - packet = input("CLIENT INPUT: " ) # Emulate the client input time.sleep(0.5) + nodeID = get_NodeID() # assign a nodeID # # End of launcher