Update mesh-bot.py

This commit is contained in:
SpudGunMan
2024-06-19 12:38:33 -07:00
parent a2b97fbb77
commit 082652e458
+10 -10
View File
@@ -115,18 +115,18 @@ def onReceive(packet, interface):
else:
hop_start = 0
if hop_start == hop_limit:
hop = "Direct"
if hop_start == hop_limit:
hop = "Direct"
else:
# set hop to Direct if the message was sent directly otherwise set the hop count
if hop_away > 0:
hop_count = hop_away
print (f"Using hopsAway: {hop_count}")
else:
# set hop to Direct if the message was sent directly otherwise set the hop count
if hop_away > 0:
hop_count = hop_away
print (f"Using hopsAway: {hop_count}")
else:
hop_count = hop_start - hop_limit
print (f"calculated hop count: {hop_start} - {hop_limit} = {hop_count}")
hop_count = hop_start - hop_limit
print (f"calculated hop count: {hop_start} - {hop_limit} = {hop_count}")
hop = f"{hop_count} hops"
hop = f"{hop_count} hops"
# If the packet is a DM (Direct Message) respond to it, otherwise validate its a message for us
if packet['to'] == myNodeNum: