From 22ec62a2f2d43aac14285d89abf2b8a3284dafdf Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 2 Nov 2025 20:32:49 -0800 Subject: [PATCH] importHelp --- script/game_serve.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/script/game_serve.py b/script/game_serve.py index bfbeab7..c29b2a7 100644 --- a/script/game_serve.py +++ b/script/game_serve.py @@ -3,14 +3,24 @@ # UDP Interface game server for Meshtastic Meshing-Around Mesh Bot # depends on: pip install meshtastic protobuf zeroconf pubsub # 2025 Kelly Keeton K7MHI -from pubsub import pub -from meshtastic.protobuf import mesh_pb2, portnums_pb2 -from mudp import UDPPacketStream, node, conn, send_text_message, send_nodeinfo, send_device_telemetry, send_position, send_environment_metrics, send_power_metrics, send_waypoint, send_data -from mudp.encryption import generate_hash -from collections import OrderedDict -import time -import sys import os +import sys +import time +from collections import OrderedDict + +try: + from pubsub import pub + from meshtastic.protobuf import mesh_pb2, portnums_pb2 +except ImportError: + print("meshtastic API not found. pip install -U meshtastic") + exit(1) + +try: + from mudp import UDPPacketStream, node, conn, send_text_message, send_nodeinfo, send_device_telemetry, send_position, send_environment_metrics, send_power_metrics, send_waypoint, send_data + from mudp.encryption import generate_hash +except ImportError: + print("mUDP module not found. pip install -U mudp") + exit(1) # import logging # import sys