mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-06-19 17:45:53 +02:00
Update mesh-bot.py
This commit is contained in:
+10
-10
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user