25 KiB
Meshtastic Mesh-Bot Games
Game Index
- Blackjack
- DopeWars
- GolfSim
- Lemonade Stand
- Tic-Tac-Toe (2D/3D)
- MasterMind
- Video Poker
- Hangman
- Quiz
- Survey
- Word of the Day Game
- Game Server Configuration (
game.ini) - PyGame Help
Blackjack Game Module
This module implements a classic game of Blackjack (Casino 21) for the Meshtastic mesh-bot.
How to Play
-
Start the Game:
Send the commandblackjackvia DM to the bot to start a new game session. -
Place a Bet:
When prompted, enter the amount you wish to wager (e.g.,5). Minimum bet is 1 chip, maximum is your current chip total. -
Gameplay Commands:
After betting, you will be dealt two cards. The dealer will also have two cards (one face up).horhit— Draw another card.sorstand— End your turn and let the dealer play.dordouble— Double your bet and draw one more card (if you have enough chips).forforfit— Forfeit half your bet and end the round.rorresend— Resend your current hand status.lorleave— Leave the table and end your session.
-
Winning:
- Get as close to 21 as possible without going over.
- If your hand exceeds 21, you bust and lose your bet.
- If you beat the dealer without busting, you win your bet.
- If you get a Blackjack (21 with two cards), you win 1.5x your bet.
- If you tie the dealer, it's a push (no win/loss).
-
High Scores:
The module tracks the highest chip total achieved. If you beat the high score, you'll be notified!
Notes
- Each player starts with 100 chips.
- If you run out of chips, your balance will reset to 100.
- The game state is tracked per player using your node ID.
- Game progress and high scores are saved in
data/blackjack_hs.pkl. - Only one game session per player is supported at a time.
- For best results, play via DM to avoid interfering with other users' sessions.
Example Session
You have 100 chips. Whats your bet?
> 10
Player[14] 8♠️, 6♥️
Dealer[10] 10♦️
🧠Hit: 38% 👎, 62% 👍
(H)it,(S)tand,(F)orfit,(D)ouble,(R)esend,(L)eave table
> h
Player[18] 8♠️, 6♥️, 4♣️
Dealer[10] 10♦️
🧠Hit: 77% 👎, 23% 👍
[H,S,F,D]
> s
Player[18] 8♠️, 6♥️, 4♣️
Dealer[20] 10♦️, Q♠️
👎DEALER WINS
📊🏆P:0,D:1,T:0
💰You have 90 chips
Bet or Leave?
Credits
- Ported from Himan10/BlackJack
- Adapted for Meshtastic mesh-bot by K7MHI Kelly Keeton 2024
DopeWars Game Module
A text-based trading game inspired by the classic DopeWars/DrugWars, adapted for the Meshtastic mesh-bot.
How to Play
-
Start the Game:
Send the commanddopewarsvia DM to the bot to begin a new session. -
Objective:
Travel between cities, buy and sell drugs, and try to maximize your cash in 7 days. -
Game Flow:
- Pick a Starting City:
You’ll be shown a list of cities. Enter the number to choose your starting location. - Each Day:
- You’ll see drug prices, your inventory, and your cash.
- You can buy, sell, or fly to a new city.
- Random events may occur (police, market changes, or finding cash/drugs).
- Commands:
- Buy:
b,drug#,qty#(e.g.,b,1,10buys 10 of drug 1) - Sell:
s,drug#,qty#(e.g.,s,2,5sells 5 of drug 2) - Max: Use
mfor max quantity (e.g.,b,1,m) - Sell All: Just
sto sell everything you have. - Fly:
fto move to a new city (ends the day). - Price List:
pto view current prices and inventory. - End Game:
eto end your run early.
- Buy:
- Repeat:
Each time you fly, a day passes. After 7 days, your final cash is your score.
- Pick a Starting City:
-
Winning:
- Try to finish with as much cash as possible.
- Beat the high score to be crowned the top dealer!
Example Session
1. Red Deer 2. Edmonton 3. Calgary 4. Toronto 5. Vancouver 6. St. Johns Where do you want to 🛫?#
> 2
🗺️Edmonton 📆1/7 🎒0/100 💵5,000
#1.Cocaine$15,000(0) #2.Heroin$2,500(0) #3.Weed$800(0) ...
Buy💸, Sell💰, (F)ly🛫? (P)riceList?
> b,2,10
Heroin: you have🎒 0 The going price is: $2,500
You bought 10 Heroin. Remaining cash: $47,500
Buy💸, Sell💰, Fly🛫?
> f
🗺️Toronto 📆2/7 🎒10/100 💵47,500
...
Notes
- You start with $5,000 and a 100-slot backpack.
- Each drug has a random price per city and day.
- Special events can spike or crash prices, or cause you to lose/gain cash or inventory.
- Police may confiscate your drugs or cash.
- High scores are saved in
data/dopewar_hs.pkl. - Only one game session per player at a time.
- Play via DM for best experience.
Credits
- Ported from Reconfirefly/drugwars
- Adapted for Meshtastic mesh-bot by K7MHI Kelly Keeton 2024
GolfSim Game Module
A text-based golf simulator for the Meshtastic mesh-bot. Play a full 9-hole round, choose your clubs, and try to set a new course record!
How to Play
-
Start the Game:
Send the commandgolfvia DM to the bot to begin a new round. -
Objective:
Complete 9 holes in as few strokes as possible. -
Game Flow:
- Each Hole:
- The bot tells you the hole number, length, par, and any hazards or weather.
- Choose your club for each shot by typing its name or initial:
dordriver— Longest clublorlow— Low ironmormid— Mid ironhorhigh— High irongorgap— Gap wedgeworwedge— Lob wedgecorcaddy— Get a caddy guess for club distances
- The bot will tell you how far you hit and how far remains.
- When you’re within 20 yards, you’ll automatically putt to finish the hole.
- Scoring:
- The bot tracks your strokes and score relative to par.
- After each hole, you’ll see your score for the hole and your running total.
- Hazards & Surprises:
- Hazards (sand, water, trees, etc.) and random events may affect your shots.
- Critters or weather can cause unexpected results!
- End of Round:
- After 9 holes, your total strokes and score to par are shown.
- If you set a new low score, you’ll be notified as the new club record holder!
- Each Hole:
Example Session
⛳️#1 is a 410-yard Par 4.☀️
Choose your club.
> d
🏌️Hit D 260yd.
You have 150yd. ⛳️
Club?[D, L, M, H, G, W]🏌️
> m
🏌️Hit M Iron 170yd. Overshot the green!🚀
You have 20yd. ⛳️
Club?[D, L, M, H, G, W]🏌️
> w
🏌️Hit L Wedge 30yd. You're on the green! After 2 putt(s), you're in for 5 strokes. +Bogey
You've hit a total of 5 strokes today, for +Bogey
...
🎉Finished 9-hole round⛳️ 🏆New Club Record🏆
Notes
- Play via DM for best experience.
- Hazards and weather are randomized for each hole.
- High scores are saved in
data/golfsim_hs.pkl. - Only one game session per player at a time.
- Commands are not case-sensitive; you can use full club names or initials.
Credits
- Ported from danfriedman30/pythongame
- Adapted for Meshtastic mesh-bot by K7MHI Kelly Keeton 2024
Lemonade Stand Game Module
A text-based business simulation where you run your own lemonade stand! Buy supplies, set prices, and try to maximize your profits over a summer season.
How to Play
-
Start the Game:
Send the commandlemonadevia DM to the bot to begin a new game. -
Objective:
Make as much money as possible in 7 weeks by managing your lemonade stand. -
Game Flow:
- Each Week:
- The bot will show you the weather, temperature, and sales potential.
- Buy supplies: cups, lemons, and sugar. Enter the number of each to purchase, or
nfor none. - Set your selling price per cup.
- The bot will simulate sales and show your results, profits, and remaining inventory.
- Repeat for each week.
- Commands:
- Enter a number to buy supplies or set price.
- Use
nto skip buying an item. - Enter
gduring pricing to go back and buy more supplies. - At the end of each week, choose to continue or end the game.
- Scoring:
- Your score is based on your net profit and efficiency (profit vs. possible profit).
- High scores are tracked and displayed at the end of the game.
- Each Week:
Example Session
LemonStand🍋Week #1 of 7. 85ºF Sunny ☀️
SupplyCost $0.45 a cup.
Sales Potential: 60 cups.
Inventory: 🥤:0 🍋:0 🍚:0
Prices:
🥤:$2.50 📦 of 25.
🍋:$4.00 🧺 of 8.
🍚:$3.00 bag for 15🥤.
💵:$30.00
🥤 to buy?
Have 0 Cost $2.50 a 📦 of 25
> 2
Purchased 2 📦 50 🥤 in inventory. $25.00 remaining
🍋 to buy?
Have 0🥤 of 🍋 Cost $4.00 a 🧺 for 8🥤
> 1
Purchased 1 🧺 8 🍋 in inventory. $21.00 remaining
🍚 to buy?
You have 0🥤 of 🍚, Cost $3.00 a bag for 15🥤
> 1
Purchased 1 bag(s) of 🍚 for $3.00. 15🥤🍚 in inventory.
Cost of goods is $0.45 per 🥤 $18.00 💵 remaining.
Price to Sell? or (G)rocery to buy more 🥤🍋🍚
> 1.25
Results Week📊#1 of 7 Cost/Price:$0.45/$1.25 P.Margin:$0.80 T.Sales:16@$1.25 G.Profit: $20.00 N.Profit:$12.80
Remaining 🥤:34 🍋:0 🍚:0 💵:$38.00📊P&L📈$8.00
Weekly📊#1. 16 sold x $1.25ea.
Play another week🥤? or (E)nd Game
Notes
- You start with $30.00 and must buy supplies each week.
- Weather and temperature affect sales potential.
- If you run out of any supply, you can't sell more lemonade that week.
- High scores are saved in
data/lemonstand.pkl. - Only one game session per player at a time.
- Play via DM for best experience.
Credits
- Ported from tigerpointe/Lemonade-Stand
- Adapted for Meshtastic mesh-bot by K7MHI Kelly Keeton 2024
Tic-Tac-Toe Game Module
A classic Tic-Tac-Toe game for the Meshtastic mesh-bot. Play against the bot, track your stats, and see if you can beat the AI!
How to Play
-
Start the Game:
Send the commandtictactoevia DM to the bot to begin a new game. -
3D Mode:
You can play in 3D mode by sendingnew 3dduring a game session. The board expands to 27 positions (1-27) and supports 3D win lines. -
Run as a Game Server (Optional):
For UDP/visual/remote play, you can run the dedicated game server:python3 script/game_serve.pyThis enables networked play and visual board updates if supported. PyGame Help
-
Objective:
Get three of your marks in a row (horizontally, vertically, or diagonally) before the bot does. -
Game Flow:
- Board Layout:
- The board is numbered 1-9 (2D) or 1-27 (3D), left to right, top to bottom.
- Example (2D):
1 | 2 | 3 4 | 5 | 6 7 | 8 | 9
- Making Moves:
- On your turn, type the number (1-9 or 1-27) where you want to place your mark.
- The bot will respond with the updated board and make its move.
- Commands:
n— Start a new game.new 2dornew 3d— Start a new game in 2D or 3D mode.eorq— End the current game.b— Show the current board.- Enter a number (1-9 or 1-27) to make a move.
- Winning:
- The first to get three in a row wins.
- If the board fills with no winner, it’s a tie.
- Board Layout:
Example Session
❌ | 2 | 3
4 | ⭕️ | 6
7 | 8 | 9
Your turn! Pick 1-9:
> 3
❌ | 2 | ❌
4 | ⭕️ | 6
7 | 8 | 9
🤖Bot wins! (n)ew (e)nd
Notes
- Emojis are used for X and O unless disabled in settings.
- Your win/loss stats are tracked across games.
- The bot will try to win, block you, or pick a random move.
- Play via DM for best experience, or run the game server for network/visual play.
- Only one game session per player at a time.
Credits
- Written for Meshtastic mesh-bot by Martin, refactored by K7MHI
MasterMind Game Module
A text-based version of the classic code-breaking game MasterMind for the Meshtastic mesh-bot. Try to guess the secret color code in as few turns as possible!
How to Play
-
Start the Game:
Send the commandmmindvia DM to the bot to begin a new game. -
Objective:
Guess the secret 4-color code in 10 turns or less. -
Game Flow:
- Choose Difficulty:
- (N)ormal: 4 colors (R🔴, Y🟡, G🟢, B🔵)
- (H)ard: 6 colors (R🔴, Y🟡, G🟢, B🔵, O🟠, P🟣)
- e(X)pert: 8 colors (R🔴, Y🟡, G🟢, B🔵, O🟠, P🟣, W⚪, K⚫)
- Type
n,h, orxto select.
- Guessing:
- Enter a 4-letter code using the color initials (e.g.,
RGBY). - The bot will respond with feedback:
- ✅ color ✅ position: correct color in the correct spot
- ✅ color 🚫 position: correct color, wrong spot
- 🚫No pins: none of your colors are in the code
- You have 10 turns to guess the code.
- Enter a 4-letter code using the color initials (e.g.,
- Winning:
- Guess the code exactly to win!
- Your number of turns is tracked for high scores.
- After a win or loss, you can play again by choosing a difficulty.
- Choose Difficulty:
Example Session
The colors to choose from are:
R🔴, Y🟡, G🟢, B🔵
Enter your guess (e.g., RGBY):
> RGYB
Turn 1:
Guess🔴🟢🟡🔵
✅ color ✅ position: 2
✅ color 🚫 position: 1
> RYGB
Turn 2:
🏆Correct🔴🟡🟢🔵
You are the master mind!🤯
🏆 High Score:2 turns, Difficulty:n
Would you like to play again? (N)ormal, (H)ard, or e(X)pert?
Notes
- Only one game session per player at a time.
- High scores are saved in
data/mmind_hs.pkl. - Play via DM for best experience.
- Input is not case-sensitive, but guesses must be exactly 4 letters.
Credits
- Ported from pwdkramer/pythonMastermind
- Adapted for Meshtastic mesh-bot by K7MHI Kelly Keeton 2024
Video Poker Game Module
A text-based Video Poker game for the Meshtastic mesh-bot. Play classic five-card draw poker, place your bets, and try to build your bankroll!
How to Play
-
Start the Game:
Send the commandvideopokervia DM to the bot to begin a new session. -
Objective:
Win as many coins as possible by making the best poker hands. -
Game Flow:
- Place Your Bet:
- You start with 20 coins.
- Enter your bet (1-5 coins) to begin each hand.
- Draw Cards:
- You are dealt 5 cards.
- The bot will show your hand and a hint about its strength.
- Redraw:
- Choose which cards to replace:
- Enter numbers (e.g.,
1,3,4) to redraw those cards. - Enter
ato redraw all cards. - Enter
nto keep your current hand. - Enter
hto show your hand again.
- Enter numbers (e.g.,
- You can only redraw once per hand.
- Choose which cards to replace:
- Scoring:
- After the redraw, your hand is scored and winnings are paid out based on the hand type.
- If you run out of coins, your balance resets to 20.
- High scores are tracked and announced.
- Continue:
- Place another bet to play again, or enter
lto leave the table.
- Place another bet to play again, or enter
- Place Your Bet:
Example Session
You have 20 coins,
Whats your bet?
> 5
K♠️ 7♦️ 7♣️ 2♥️ 9♠️
Showing:Pair👯
Deal new card?
ex: 1,3,4 or (N)o,(A)ll (H)and
> 1,4
7♦️ 7♣️ 9♠️ 3♣️ Q♥️
Your hand, Pair👯. Your bankroll is now 22 coins.
Place your Bet, or (L)eave Table.
Hand Rankings & Payouts
- 👑Royal Flush🚽 — 10x bet
- 🧻Straight Flush🚽 — 9x bet
- Flush🚽 — 8x bet
- Full House🏠 — 7x bet
- Four of a Kind👯👯 — 6x bet
- Three of a Kind☘️ — 5x bet
- Two Pair👯👯 — 4x bet
- Straight📏 — 3x bet
- Pair👯 — 2x bet
- Bad Hand 🙈 — Lose bet
Notes
- Only one game session per player at a time.
- High scores are saved in
data/videopoker_hs.pkl. - Play via DM for best experience.
- Bets must be between 1 and 5 coins and not exceed your bankroll.
Credits
- Ported from devtronvarma/Video-Poker-Terminal-Game
- Adapted for Meshtastic mesh-bot by K7MHI Kelly Keeton 2024
Word of the Day Game — Rules & Features
- Word of the Day:
Each day, a new word is chosen fromdata/wotd.json(or a default list if missing). Mention the word (or its leet/1337 variants) in chat to win and trigger a new word. - Bingo Mini-Game:
A random 3x3 bingo card of words, drawn fromdata/bingo.json(or a default list if missing). Mention words from the card in chat. Complete a row, column, or diagonal to win BINGO and get a new card. - Emoji Mini-Game:
Use emojis in chat to:- Play a slot machine: send the same emoji several times in a row to hit the JACKPOT!
- Data Files:
data/wotd.json: List of words and definitions for the Word of the Day. [ { "word": "serendipity", "meta": "The occurrence of events by chance in a happy or beneficial way." }, { "word": "ephemeral", "meta": "Lasting for a very short time." }, { "word": "sonder", "meta": "The realization that each passerby has a life as vivid and complex as your own." } ]data/bingo.json: List of words for bingo cards.
[ "dog", "cat", "fish", "bird", "hamster", "rabbit", "turtle", "lizard", "snake" ]
Hangman Game Module
A classic word-guessing game for the Meshtastic mesh-bot. Try to guess the hidden word one letter at a time before you run out of chances!
How to Play
-
Start the Game:
Send the commandhangmanvia DM to the bot to begin a new game. -
Objective:
Guess the secret word by suggesting letters, one at a time. Each incorrect guess brings you closer to losing! -
Game Flow:
- New Game:
- The bot picks a random word and shows you its masked form (e.g.,
_ _ _ _ _). - You’ll see your total games played and games won.
- The bot picks a random word and shows you its masked form (e.g.,
- Guessing:
- Type a single letter to guess.
- Correct guesses reveal all instances of that letter in the word.
- Incorrect guesses are tracked; you have 6 chances before the game ends.
- The bot shows your progress, wrong guesses, and a hangman emoji status.
- Winning & Losing:
- Guess all letters before reaching 6 wrong guesses to win!
- If you lose, the bot reveals the word and starts a new game.
- New Game:
-
Commands:
- Enter a single letter to guess.
- Start a new game by sending
hangmanagain.
Example Session
_ _ _ _ _ _ _
Guess a letter
🥳
Total Games: 1, Won: 1
M E S H T A S T I C
Guess a letter
Notes
- The word list is loaded from
data/hangman.jsonif available, or uses a built-in default list. ["apple","banana","cherry"] - Game stats are tracked per player.
- Only one game session per player at a time.
- Play via DM for best experience.
Data Files
data/hangman.json: List of words for Hangman.
Example:[ "apple", "banana", "cherry" ]
Credits
- Written for Meshtastic mesh-bot by ZR1RF Johannes le Roux 2025
Quiz Game Module
This module implements a multiplayer quiz game for the Meshtastic mesh-bot.
How to Play
- Start the Game:
The quizmaster starts the quiz session (usually with/quiz startor similar command). - Join the Game:
Players join by sending/quiz joinor by answering a question while a quiz is active. - Answer Questions:
- Use
Q: <answer>to answer the current question.- For multiple choice, answer with
A,B,C, etc. - For free-text, type the answer after
Q:.
- For multiple choice, answer with
- Use
Q: ?to request the next question.
- Use
- Leave the Game:
Players can leave at any time with/quiz leave. - Stop the Game:
The quizmaster stops the quiz session (e.g.,/quiz stop). Final scores and the top 3 players are announced.
Rules & Features
- Only the quizmaster can start or stop the quiz.
- Players can join or leave at any time while the quiz is active.
- Questions are loaded from quiz_questions.json and can be multiple choice or free-text.
- Players earn 1 point for each correct answer.
- The first player to answer each question correctly is noted.
- The top 3 players are displayed at the end of the quiz.
- The quizmaster can broadcast messages to all players.
Example Commands
- Start quiz:
/quiz start - Join quiz:
/quiz join - Answer a question:
Q: B
Q: Paris - Next question:
Q: ? - Leave quiz:
/quiz leave - Stop quiz:
/quiz stop
Notes
- Only one quiz can be active at a time.
- Players can only answer each question once.
- The quizmaster is defined by the
bbs_admin_listvariable. - Questions must be formatted correctly in the JSON file for the game to function.
Written for Meshtastic mesh-bot by K7MHI Kelly Keeton 2025
Certainly! Here’s documentation for the Survey Game Module in the same format as your other game modules:
Survey Module "game"
This module implements a survey system for the Meshtastic mesh-bot.
How to Play
-
Start the Survey:
Users start a survey by specifying the survey name (e.g.,/survey start example).
The survey will prompt the user with the first question. -
Answer Questions:
- For multiple choice: reply with a letter (A, B, C, ...).
- For integer: reply with a number.
- For text: reply with your answer as text. After each answer, the next question is shown automatically.
-
End the Survey:
The survey ends automatically after the last question, or the user can sendendto finish early.
Responses are saved to a CSV file.
Rules & Features
- Surveys are defined in JSON files in surveys (e.g.,
example_survey.json). - Each survey can have multiple choice, integer, or text questions.
- User responses are saved to a CSV file named
<survey_name>_responses.csvin the same directory. - Users can only answer each question once per survey session.
- Survey results can be summarized and reported by the bot.
Example Commands
- Start a survey:
/survey start example - Answer a multiple choice question:
A - Answer an integer question:
42 - Answer a text question:
My favorite color is blue. - End the survey early:
end - Get survey results (admin):
/survey results example
Notes
- Only surveys listed in the surveys directory with the
_survey.jsonsuffix are available. - Each user’s responses are tracked separately.
- Results are summarized and can be displayed by the bot.
Written for Meshtastic mesh-bot by K7MHI Kelly Keeton 2025
Game Server Configuration (game.ini)
The game server (script/game_serve.py) supports configuration via a game.ini file placed in the same directory as the script. This allows you to customize network and node settings without modifying the Python code.
How to Use
- Create a
game.inifile in thescript/directory (next togame_serve.py).
If game.ini is not present, the server will use built-in default values.
PyGame Help
'pygame - Community Edition' ('pygame-ce' for short) is a fork of the original 'pygame' library by former 'pygame' core contributors.
It offers many new features and optimizations, receives much better maintenance and runs under a better governance model, while being highly compatible with code written for upstream pygame (import pygame still works).
Details
- Initial announcement on Reddit (or https://discord.com/channels/772505616680878080/772506385304649738/1074593440148500540)
- Why the forking happened
Helpful Links
Installation
pip uninstall pygame # Uninstall pygame first since it would conflict with pygame-ce
pip install pygame-ce
-# Because 'pygame' installs to the same location as 'pygame-ce', it must first be uninstalled.
-# Note that the import pygame syntax has not changed with pygame-ce.
mUDP Help
mUDP library provides UDP-based broadcasting of Meshtastic-compatible packets. MeshBot uses this for the game_server_display server.
Details
Installation
pip install mudp
