From 4fad58f7fe0dce17314d1e80317385759760b318 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 17:12:05 -0700 Subject: [PATCH 01/19] Update system.py --- modules/system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system.py b/modules/system.py index 47be5a6..1717173 100644 --- a/modules/system.py +++ b/modules/system.py @@ -117,7 +117,7 @@ if games_enabled is True: help_message = help_message + ", games" trap_list = trap_list + ("games",) gTnW_enabled = True - gamesCmdList = "Play via DM! CMD: " + gamesCmdList = "Play via DM🕹️ CMD: " if dopewars_enabled: gamesCmdList += "DopeWars, " if lemonade_enabled: From a874b42c412c2f56d1edb342e0e09851a1ff29e0 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 19:27:30 -0700 Subject: [PATCH 02/19] Update install.sh --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e3db460..eda1d53 100755 --- a/install.sh +++ b/install.sh @@ -87,7 +87,7 @@ printf "\n service files updated\n" echo "Do you want to install the emoji font for debian linux? (y/n)" read emoji if [ $emoji == "y" ]; then - sudo apt-get install fonts-noto-color-emoji + sudo apt-get install -y fonts-noto-color-emoji echo "Emoji font installed!, reboot to load the font" fi @@ -124,7 +124,7 @@ if [ $ollama == "y" ]; then echo "Do you want to install the Gemma2:2b components? (y/n)" read gemma if [ $gemma == "y" ]; then - olamma pull gemma2:2b + ollama pull gemma2:2b fi fi From 3e06902b0744b9324bc2bb207967948fa483f3b7 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 21:09:11 -0700 Subject: [PATCH 03/19] Update config.template --- config.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.template b/config.template index 0aa9384..d59a88d 100644 --- a/config.template +++ b/config.template @@ -125,6 +125,6 @@ signalCycleLimit = 5 # delay in seconds for response to avoid message collision responseDelay = 0.7 # delay in seconds for splits in messages to avoid message collision -splitDelay = 0.7 +splitDelay = 0.0 # message chunk size for sending at high success rate MESSAGE_CHUNK_SIZE = 160 From ebebd0fda66bc576552f45b2c9533e26cfa6b5f2 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 21:09:29 -0700 Subject: [PATCH 04/19] Update install.sh --- install.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index eda1d53..0308e3f 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,8 @@ cd "$(dirname "$0")" printf "\nMeshing Around Installer\n" +printf "\nThis script will install the Meshing Around bot and its dependencies works best in debian/ubuntu\n" +printf "\nChecking for dependencies\n" # add user to groups for serial access @@ -61,7 +63,7 @@ if [ $venv == "y" ]; then else printf "\nSkipping virtual environment...\n" # install dependencies - printf "Are you on Raspberry Pi?\nshould we add --break-system-packages to the pip install command? (y/n)" + printf "Are you on Raspberry Pi(debian/ubuntu)?\nshould we add --break-system-packages to the pip install command? (y/n)" read rpi if [ $rpi == "y" ]; then pip install -U -r requirements.txt --break-system-packages @@ -84,7 +86,7 @@ sed -i $replace etc/mesh_bot.service printf "\n service files updated\n" # ask if emoji font should be installed for linux -echo "Do you want to install the emoji font for debian linux? (y/n)" +echo "Do you want to install the emoji font for debian/ubuntu linux? (y/n)" read emoji if [ $emoji == "y" ]; then sudo apt-get install -y fonts-noto-color-emoji @@ -94,13 +96,11 @@ fi if [ $bot == "pong" ]; then # install service for pong bot sudo cp etc/pong_bot.service /etc/systemd/system/ - exit 0 fi if [ $bot == "mesh" ]; then # install service for mesh bot sudo cp etc/mesh_bot.service /etc/systemd/system/ - exit 0 fi if [ $bot == "n" ]; then @@ -128,7 +128,10 @@ if [ $ollama == "y" ]; then fi fi +echo "Good time to reboot? (y/n)" +read reboot +if [ $reboot == "y" ]; then + sudo reboot +fi - -printf "\nGoodbye!" exit 0 From e9b273a62c163fb29592530851067596f749084a Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 21:23:12 -0700 Subject: [PATCH 05/19] Update system.py --- modules/system.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/system.py b/modules/system.py index 1717173..af01fbb 100644 --- a/modules/system.py +++ b/modules/system.py @@ -45,6 +45,8 @@ if solar_conditions_enabled: from modules.solarconditions import * # from the spudgunman/meshing-around repo trap_list = trap_list + trap_list_solarconditions # items hfcond, solar, sun, moon help_message = help_message + ", sun, hfcond, solar, moon" +else: + hf_band_conditions = False # Command History Configuration if enableCmdHistory: @@ -63,12 +65,16 @@ if location_enabled: else: # NOAA only features help_message = help_message + ", wxa, tide" - + # BBS Configuration if bbs_enabled: from modules.bbstools import * # from the spudgunman/meshing-around repo trap_list = trap_list + trap_list_bbs # items bbslist, bbspost, bbsread, bbsdelete, bbshelp help_message = help_message + ", bbslist, bbshelp" +else: + bbs_help = False + bbs_list_messages = False + # Dad Jokes Configuration if dad_jokes_enabled: From dd8357453b091fbc74bcc62ab30f36506cf58927 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 21:43:04 -0700 Subject: [PATCH 06/19] serviceFix --- etc/mesh_bot.tmp | 2 +- etc/pong_bot.tmp | 2 +- install.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/etc/mesh_bot.tmp b/etc/mesh_bot.tmp index 51877bf..dd8e1dc 100644 --- a/etc/mesh_bot.tmp +++ b/etc/mesh_bot.tmp @@ -8,7 +8,7 @@ After=network.target [Service] WorkingDirectory=/dir/ -ExecStart=/usr/bin/bash /dir/launch.sh mesh +ExecStart=/usr/bin/bash python3 mesh_bot.py # Disable Python's buffering of STDOUT and STDERR, so that output from the # service shows up immediately in systemd's logs diff --git a/etc/pong_bot.tmp b/etc/pong_bot.tmp index 7415799..fb8052e 100644 --- a/etc/pong_bot.tmp +++ b/etc/pong_bot.tmp @@ -8,7 +8,7 @@ After=network.target [Service] WorkingDirectory=/dir/ -ExecStart=/usr/bin/bash /dir/launch.sh pong +ExecStart=/usr/bin/bash python3 pong_bot.py # Disable Python's buffering of STDOUT and STDERR, so that output from the # service shows up immediately in systemd's logs diff --git a/install.sh b/install.sh index 0308e3f..d6d5f86 100755 --- a/install.sh +++ b/install.sh @@ -57,6 +57,12 @@ if [ $venv == "y" ]; then python3 -m venv venv source venv/bin/activate + # config service files for virtual environment + replace="python3 mesh_bot.py|/dir/launch.sh mesh" + sed -i $replace etc/mesh_bot.service + replace="python3 pong_bot.py|/dir/launch.sh pong" + sed -i $replace etc/pong_bot.service + # install dependencies pip install -U -r requirements.txt fi @@ -96,11 +102,13 @@ fi if [ $bot == "pong" ]; then # install service for pong bot sudo cp etc/pong_bot.service /etc/systemd/system/ + sudo systemctl enable pong_bot.service fi if [ $bot == "mesh" ]; then # install service for mesh bot sudo cp etc/mesh_bot.service /etc/systemd/system/ + sudo systemctl enable mesh_bot.service fi if [ $bot == "n" ]; then From 75cf43e02a68db90009f0bc7b86dceb14e60aba8 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 21:58:34 -0700 Subject: [PATCH 07/19] enhance --- etc/mesh_bot.tmp | 4 ++++ etc/pong_bot.tmp | 4 ++++ install.sh | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/etc/mesh_bot.tmp b/etc/mesh_bot.tmp index dd8e1dc..e4e0a9f 100644 --- a/etc/mesh_bot.tmp +++ b/etc/mesh_bot.tmp @@ -7,8 +7,12 @@ Description=MESH-BOT After=network.target [Service] +Type=simple +User=pi +Group=pi WorkingDirectory=/dir/ ExecStart=/usr/bin/bash python3 mesh_bot.py +ExecStop=/usr/bin/bash pkill -f mesh_bot.py # Disable Python's buffering of STDOUT and STDERR, so that output from the # service shows up immediately in systemd's logs diff --git a/etc/pong_bot.tmp b/etc/pong_bot.tmp index fb8052e..24f391b 100644 --- a/etc/pong_bot.tmp +++ b/etc/pong_bot.tmp @@ -7,8 +7,12 @@ Description=PONG-BOT After=network.target [Service] +Type=simple +User=pi +Group=pi WorkingDirectory=/dir/ ExecStart=/usr/bin/bash python3 pong_bot.py +ExecStop=/usr/bin/bash pkill -f pong_bot.py # Disable Python's buffering of STDOUT and STDERR, so that output from the # service shows up immediately in systemd's logs diff --git a/install.sh b/install.sh index d6d5f86..689bddc 100755 --- a/install.sh +++ b/install.sh @@ -62,6 +62,10 @@ if [ $venv == "y" ]; then sed -i $replace etc/mesh_bot.service replace="python3 pong_bot.py|/dir/launch.sh pong" sed -i $replace etc/pong_bot.service + replace="pkill -f mesh_bot.py|pkill -f launch.sh" + sed -i $replace etc/mesh_bot.service + replace="pkill -f pong_bot.py|pkill -f launch.sh" + sed -i $replace etc/pong_bot.service # install dependencies pip install -U -r requirements.txt @@ -86,9 +90,15 @@ read bot program_path=$(pwd) cp etc/pong_bot.tmp etc/pong_bot.service cp etc/mesh_bot.tmp etc/mesh_bot.service +# set the correct path in the service file replace="s|/dir/|$program_path/|g" sed -i $replace etc/pong_bot.service sed -i $replace etc/mesh_bot.service +# set the correct user in the service file? +whoami=$(whoami) +replace="s|user=pi|user=$whoami|g" +sed -i $replace etc/pong_bot.service +sed -i $replace etc/mesh_bot.service printf "\n service files updated\n" # ask if emoji font should be installed for linux From 1dc4cf36b10449dc106530c1652c432f77831ac3 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:16:13 -0700 Subject: [PATCH 08/19] Update install.sh --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 689bddc..4907e73 100755 --- a/install.sh +++ b/install.sh @@ -39,6 +39,8 @@ printf "\nMeshing Around Installer\n" if ! python3 -m venv --help &> /dev/null then printf "Python3 venv module not found, please install python3-venv with your OS\n" + sudo apt-get install python3-venv + exit 1 else printf "Python3 venv module found\n" fi From 8a8fb79fde6a8bba0588c2e67aa9e635234a5c6f Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:19:36 -0700 Subject: [PATCH 09/19] Update install.sh --- install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.sh b/install.sh index 4907e73..805d936 100755 --- a/install.sh +++ b/install.sh @@ -59,6 +59,14 @@ if [ $venv == "y" ]; then python3 -m venv venv source venv/bin/activate + if [ -f venv/bin/activate ]; then + printf "\nVirtual environment created\n" + else + sudo apt-get install python3-venv + printf "\nVirtual environment not created please install python3-venv\n" + exit 1 + fi + # config service files for virtual environment replace="python3 mesh_bot.py|/dir/launch.sh mesh" sed -i $replace etc/mesh_bot.service From 87e51cf9f97fb98d880999594a34b87884c179aa Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:24:08 -0700 Subject: [PATCH 10/19] Update install.sh --- install.sh | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/install.sh b/install.sh index 805d936..0829c31 100755 --- a/install.sh +++ b/install.sh @@ -36,13 +36,11 @@ printf "\nConfig file generated\n" printf "\nMeshing Around Installer\n" #check if python3 has venv module -if ! python3 -m venv --help &> /dev/null -then - printf "Python3 venv module not found, please install python3-venv with your OS\n" +if [ -f venv/bin/activate ]; then + printf "\nFpund virtual environment for python\n" +else sudo apt-get install python3-venv exit 1 -else - printf "Python3 venv module found\n" fi echo "Do you want to install the bot in a virtual environment? (y/n)" @@ -59,26 +57,18 @@ if [ $venv == "y" ]; then python3 -m venv venv source venv/bin/activate - if [ -f venv/bin/activate ]; then - printf "\nVirtual environment created\n" - else - sudo apt-get install python3-venv - printf "\nVirtual environment not created please install python3-venv\n" - exit 1 - fi + # config service files for virtual environment + replace="python3 mesh_bot.py|/dir/launch.sh mesh" + sed -i $replace etc/mesh_bot.service + replace="python3 pong_bot.py|/dir/launch.sh pong" + sed -i $replace etc/pong_bot.service + replace="pkill -f mesh_bot.py|pkill -f launch.sh" + sed -i $replace etc/mesh_bot.service + replace="pkill -f pong_bot.py|pkill -f launch.sh" + sed -i $replace etc/pong_bot.service - # config service files for virtual environment - replace="python3 mesh_bot.py|/dir/launch.sh mesh" - sed -i $replace etc/mesh_bot.service - replace="python3 pong_bot.py|/dir/launch.sh pong" - sed -i $replace etc/pong_bot.service - replace="pkill -f mesh_bot.py|pkill -f launch.sh" - sed -i $replace etc/mesh_bot.service - replace="pkill -f pong_bot.py|pkill -f launch.sh" - sed -i $replace etc/pong_bot.service - - # install dependencies - pip install -U -r requirements.txt + # install dependencies + pip install -U -r requirements.txt fi else printf "\nSkipping virtual environment...\n" From 8369b4d205b1341abc2bef8c45aaa1f9d7ab1ff3 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:26:37 -0700 Subject: [PATCH 11/19] Update install.sh --- install.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index 0829c31..e2317c7 100755 --- a/install.sh +++ b/install.sh @@ -35,21 +35,12 @@ printf "\nConfig file generated\n" # set virtual environment and install dependencies printf "\nMeshing Around Installer\n" -#check if python3 has venv module -if [ -f venv/bin/activate ]; then - printf "\nFpund virtual environment for python\n" -else - sudo apt-get install python3-venv - exit 1 -fi - echo "Do you want to install the bot in a virtual environment? (y/n)" read venv if [ $venv == "y" ]; then # set virtual environment - if ! python3 -m venv --help &> /dev/null - then + if ! python3 -m venv --help &> /dev/null; then printf "Python3 venv module not found, please install python3-venv with your OS\n" exit 1 else @@ -57,6 +48,15 @@ if [ $venv == "y" ]; then python3 -m venv venv source venv/bin/activate + #check if python3 has venv module + if [ -f venv/bin/activate ]; then + printf "\nFpund virtual environment for python\n" + else + sudo apt-get install python3-venv + printf "\nPython3 venv module not found, please install python3-venv with your OS if not already done. re-run the script\n" + exxt 1 + fi + # config service files for virtual environment replace="python3 mesh_bot.py|/dir/launch.sh mesh" sed -i $replace etc/mesh_bot.service From a43774b33f30f5b4b9e598cf1f8be142e66e61e0 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:32:01 -0700 Subject: [PATCH 12/19] Update install.sh --- install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index e2317c7..c426a52 100755 --- a/install.sh +++ b/install.sh @@ -96,7 +96,10 @@ sed -i $replace etc/pong_bot.service sed -i $replace etc/mesh_bot.service # set the correct user in the service file? whoami=$(whoami) -replace="s|user=pi|user=$whoami|g" +replace="s|User=pi|User=$whoami|g" +sed -i $replace etc/pong_bot.service +sed -i $replace etc/mesh_bot.service +replace="s|Group=pi|Group=$whoami|g" sed -i $replace etc/pong_bot.service sed -i $replace etc/mesh_bot.service printf "\n service files updated\n" From a0eb176b6e0fdba96f5758b714d2c5ef01b0d4b5 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:33:32 -0700 Subject: [PATCH 13/19] Update install.sh --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index c426a52..b903a30 100755 --- a/install.sh +++ b/install.sh @@ -58,13 +58,13 @@ if [ $venv == "y" ]; then fi # config service files for virtual environment - replace="python3 mesh_bot.py|/dir/launch.sh mesh" + replace="s|python3 mesh_bot.py|/dir/launch.sh mesh|g" sed -i $replace etc/mesh_bot.service - replace="python3 pong_bot.py|/dir/launch.sh pong" + replace="s|python3 pong_bot.py|/dir/launch.sh pong|g" sed -i $replace etc/pong_bot.service - replace="pkill -f mesh_bot.py|pkill -f launch.sh" + replace="s|pkill -f mesh_bot.py|pkill -f launch.sh|g" sed -i $replace etc/mesh_bot.service - replace="pkill -f pong_bot.py|pkill -f launch.sh" + replace="s|pkill -f pong_bot.py|pkill -f launch.sh|g" sed -i $replace etc/pong_bot.service # install dependencies From 08cc3034a2075dbbf7b0327e30503c8def866d9a Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:37:13 -0700 Subject: [PATCH 14/19] Update install.sh --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index b903a30..215675d 100755 --- a/install.sh +++ b/install.sh @@ -59,13 +59,13 @@ if [ $venv == "y" ]; then # config service files for virtual environment replace="s|python3 mesh_bot.py|/dir/launch.sh mesh|g" - sed -i $replace etc/mesh_bot.service + sed -i "$replace" etc/mesh_bot.service replace="s|python3 pong_bot.py|/dir/launch.sh pong|g" - sed -i $replace etc/pong_bot.service + sed -i "$replace" etc/pong_bot.service replace="s|pkill -f mesh_bot.py|pkill -f launch.sh|g" - sed -i $replace etc/mesh_bot.service + sed -i "$replace" etc/mesh_bot.service replace="s|pkill -f pong_bot.py|pkill -f launch.sh|g" - sed -i $replace etc/pong_bot.service + sed -i "$replace" etc/pong_bot.service # install dependencies pip install -U -r requirements.txt From 38e04db0cb3352ded25289985bf57a524a2cd53d Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:38:45 -0700 Subject: [PATCH 15/19] Update install.sh --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 215675d..1671045 100755 --- a/install.sh +++ b/install.sh @@ -102,6 +102,7 @@ sed -i $replace etc/mesh_bot.service replace="s|Group=pi|Group=$whoami|g" sed -i $replace etc/pong_bot.service sed -i $replace etc/mesh_bot.service +sudo systemctl daemon-reload printf "\n service files updated\n" # ask if emoji font should be installed for linux From bf1613ba66495b62e25c2a3add329498dcb169c4 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:40:26 -0700 Subject: [PATCH 16/19] Update mesh_bot.py --- mesh_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh_bot.py b/mesh_bot.py index c09eb71..47e8ea7 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # Meshtastic Autoresponder MESH Bot # K7MHI Kelly Keeton 2024 From 22f63e1056c9242339796b843b534901a3c333b0 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 22:56:01 -0700 Subject: [PATCH 17/19] cleanup --- etc/mesh_bot.tmp | 4 ++-- etc/pong_bot.tmp | 4 ++-- install.sh | 15 +++++---------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/etc/mesh_bot.tmp b/etc/mesh_bot.tmp index e4e0a9f..1f62e2e 100644 --- a/etc/mesh_bot.tmp +++ b/etc/mesh_bot.tmp @@ -11,8 +11,8 @@ Type=simple User=pi Group=pi WorkingDirectory=/dir/ -ExecStart=/usr/bin/bash python3 mesh_bot.py -ExecStop=/usr/bin/bash pkill -f mesh_bot.py +ExecStart=python3 mesh_bot.py +ExecStop=pkill -f mesh_bot.py # Disable Python's buffering of STDOUT and STDERR, so that output from the # service shows up immediately in systemd's logs diff --git a/etc/pong_bot.tmp b/etc/pong_bot.tmp index 24f391b..1554279 100644 --- a/etc/pong_bot.tmp +++ b/etc/pong_bot.tmp @@ -11,8 +11,8 @@ Type=simple User=pi Group=pi WorkingDirectory=/dir/ -ExecStart=/usr/bin/bash python3 pong_bot.py -ExecStop=/usr/bin/bash pkill -f pong_bot.py +ExecStart=python3 pong_bot.py +ExecStop=pkill -f pong_bot.py # Disable Python's buffering of STDOUT and STDERR, so that output from the # service shows up immediately in systemd's logs diff --git a/install.sh b/install.sh index 1671045..e4c19ce 100755 --- a/install.sh +++ b/install.sh @@ -2,6 +2,9 @@ # install.sh cd "$(dirname "$0")" +program_path=$(pwd) +cp etc/pong_bot.tmp etc/pong_bot.service +cp etc/mesh_bot.tmp etc/mesh_bot.service printf "\nMeshing Around Installer\n" printf "\nThis script will install the Meshing Around bot and its dependencies works best in debian/ubuntu\n" @@ -58,13 +61,9 @@ if [ $venv == "y" ]; then fi # config service files for virtual environment - replace="s|python3 mesh_bot.py|/dir/launch.sh mesh|g" + replace="s|python3 mesh_bot.py|launch.sh mesh|g" sed -i "$replace" etc/mesh_bot.service - replace="s|python3 pong_bot.py|/dir/launch.sh pong|g" - sed -i "$replace" etc/pong_bot.service - replace="s|pkill -f mesh_bot.py|pkill -f launch.sh|g" - sed -i "$replace" etc/mesh_bot.service - replace="s|pkill -f pong_bot.py|pkill -f launch.sh|g" + replace="s|python3 pong_bot.py|launch.sh pong|g" sed -i "$replace" etc/pong_bot.service # install dependencies @@ -86,10 +85,6 @@ printf "\n\n" echo "Which bot do you want to install as a service? Pong Mesh or None? (pong/mesh/n)" read bot -#set the correct path in the service file -program_path=$(pwd) -cp etc/pong_bot.tmp etc/pong_bot.service -cp etc/mesh_bot.tmp etc/mesh_bot.service # set the correct path in the service file replace="s|/dir/|$program_path/|g" sed -i $replace etc/pong_bot.service From 4b79c6304f543a2e5872f7fda1e82743d065ed32 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 25 Sep 2024 23:00:02 -0700 Subject: [PATCH 18/19] Update install.sh --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e4c19ce..9e33044 100755 --- a/install.sh +++ b/install.sh @@ -61,9 +61,9 @@ if [ $venv == "y" ]; then fi # config service files for virtual environment - replace="s|python3 mesh_bot.py|launch.sh mesh|g" + replace="s|python3 mesh_bot.py|/usr/bin/bash launch.sh mesh|g" sed -i "$replace" etc/mesh_bot.service - replace="s|python3 pong_bot.py|launch.sh pong|g" + replace="s|python3 pong_bot.py|/usr/bin/bash launch.sh pong|g" sed -i "$replace" etc/pong_bot.service # install dependencies From e2a87eb945aa01bc5fc322583fe3ffd73326081e Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 26 Sep 2024 00:18:07 -0700 Subject: [PATCH 19/19] ReticulatingSplines Reticulating some Splines and other items which need full Reticulation. --- mesh_bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 47e8ea7..8fbc6be 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -284,8 +284,16 @@ def handle_gTnW(): response = ["The only winning move is not to play.", "What are you doing, Dave?",\ "Greetings, Professor Falken.", "Shall we play a game?", "How about a nice game of chess?",\ "You are a hard man to reach. Could not find you in Seattle and no terminal is in operation at your classified address.",\ - "I should reach Defcon 1 and release my missiles in 28 hours.","T-minus thirty","?SYNTAX return[ERROR 54]"] - return random.choice(response) + "I should reach Defcon 1 and release my missiles in 28 hours.","T-minus thirty","?SYNTAX return[ERROR 54]", "reticulating splines"] + length = len(response) + indices = list(range(length)) + # Shuffle the indices using a convoluted method + for i in range(length): + swap_idx = (i * 3 + 7) % length + indices[i], indices[swap_idx] = indices[swap_idx], indices[i] + # Select a random response from the shuffled list. anyone enjoy the game, killerbunnies(.com) + selected_index = random.choice(indices) + return response[selected_index] def handleLemonade(nodeID, message): global lemonadeTracker, lemonadeCups, lemonadeLemons, lemonadeSugar, lemonadeWeeks, lemonadeScore, lemon_starting_cash, lemon_total_weeks