Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
import os
|
|
|
|
import json
|
|
|
|
import logging
|
2025-02-01 18:08:59 -08:00
|
|
|
import time
|
2025-02-16 17:50:42 -08:00
|
|
|
import random
|
2025-03-16 16:52:34 -07:00
|
|
|
import threading
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
import pwnagotchi
|
|
|
|
import pwnagotchi.plugins as plugins
|
|
|
|
import pwnagotchi.ui.faces as faces
|
|
|
|
import pwnagotchi.ui.fonts as fonts
|
|
|
|
from pwnagotchi.ui.components import LabeledValue
|
|
|
|
from pwnagotchi.ui.view import BLACK
|
|
|
|
|
|
|
|
class Age(plugins.Plugin):
|
|
|
|
__author__ = 'AlienMajik'
|
2025-05-04 14:15:07 -07:00
|
|
|
__version__ = '3.1.0'
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
__license__ = 'MIT'
|
2025-05-04 14:15:07 -07:00
|
|
|
__description__ = ('An enhanced plugin with frequent titles, dynamic quotes, progress bars, '
|
|
|
|
'random events, handshake streaks, personality evolution, and secret achievements. '
|
|
|
|
'UI is optimized to avoid clutter.')
|
2025-02-01 18:08:59 -08:00
|
|
|
|
|
|
|
DEFAULT_AGE_TITLES = {
|
2025-05-04 14:15:07 -07:00
|
|
|
100: "Baby Steps",
|
|
|
|
500: "Getting the Hang of It",
|
2025-02-16 17:50:42 -08:00
|
|
|
1000: "Neon Spawn",
|
2025-02-01 20:22:55 -08:00
|
|
|
2000: "Script Kiddie",
|
2025-03-16 16:52:34 -07:00
|
|
|
5000: "WiFi Outlaw",
|
2025-02-16 17:50:42 -08:00
|
|
|
10000: "Data Raider",
|
|
|
|
25000: "Prophet",
|
2025-05-04 14:15:07 -07:00
|
|
|
33333: "Off the Grid",
|
|
|
|
55555: "Multiversed",
|
|
|
|
111111: "Intergalactic"
|
2025-02-01 18:08:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFAULT_STRENGTH_TITLES = {
|
2025-05-04 14:15:07 -07:00
|
|
|
100: "Sparring Novice",
|
|
|
|
300: "Gear Tickler",
|
2025-02-16 17:50:42 -08:00
|
|
|
500: "Fleshbag",
|
|
|
|
1500: "Lightweight",
|
|
|
|
2000: "Deauth King",
|
2025-02-16 20:30:15 -08:00
|
|
|
2500: "Handshake Hunter",
|
2025-05-04 14:15:07 -07:00
|
|
|
3333: "Unstoppable",
|
|
|
|
55555: "Rev-9",
|
|
|
|
111111: "Kuato"
|
2025-02-01 18:08:59 -08:00
|
|
|
}
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
def __init__(self):
|
2025-03-16 16:52:34 -07:00
|
|
|
# Default UI positions (x, y)
|
2025-02-01 18:08:59 -08:00
|
|
|
self.default_positions = {
|
|
|
|
'age': (10, 40),
|
|
|
|
'strength': (80, 40),
|
|
|
|
'points': (10, 60),
|
2025-05-04 14:15:07 -07:00
|
|
|
'progress': (10, 80),
|
|
|
|
'personality': (10, 100),
|
2025-02-01 18:08:59 -08:00
|
|
|
}
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Core metrics
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
self.epochs = 0
|
|
|
|
self.train_epochs = 0
|
2024-12-15 14:56:57 -08:00
|
|
|
self.network_points = 0
|
|
|
|
self.handshake_count = 0
|
2025-02-01 18:08:59 -08:00
|
|
|
self.last_active_epoch = 0
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
self.data_path = '/root/age_strength.json'
|
2024-12-15 14:56:57 -08:00
|
|
|
self.log_path = '/root/network_points.log'
|
2025-02-01 18:08:59 -08:00
|
|
|
self.handshake_dir = '/home/pi/handshakes'
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Configurable settings
|
2025-02-01 18:08:59 -08:00
|
|
|
self.decay_interval = 50
|
|
|
|
self.decay_amount = 10
|
|
|
|
self.age_titles = self.DEFAULT_AGE_TITLES
|
|
|
|
self.strength_titles = self.DEFAULT_STRENGTH_TITLES
|
2025-05-04 14:15:07 -07:00
|
|
|
self.show_personality = False # Default to False to avoid clutter
|
2025-03-16 16:52:34 -07:00
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Achievement tracking
|
2025-03-16 16:52:34 -07:00
|
|
|
self.prev_age_title = "Unborn"
|
|
|
|
self.prev_strength_title = "Untrained"
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Points and quotes
|
2025-03-16 16:52:34 -07:00
|
|
|
self.points_map = {
|
|
|
|
'wpa3': 10,
|
|
|
|
'wpa2': 5,
|
|
|
|
'wep': 2,
|
|
|
|
'wpa': 2
|
|
|
|
}
|
|
|
|
self.motivational_quotes = [
|
|
|
|
"Keep going, you're crushing it!",
|
|
|
|
"You're a WiFi wizard in the making!",
|
|
|
|
"More handshakes, more power!",
|
|
|
|
"Don't stop now, you're almost there!",
|
|
|
|
"Keep evolving, don't let decay catch you!"
|
|
|
|
]
|
2025-05-04 14:15:07 -07:00
|
|
|
|
|
|
|
# New features
|
|
|
|
self.last_handshake_enc = None
|
|
|
|
self.last_decay_points = 0
|
|
|
|
self.streak = 0
|
|
|
|
self.active_event = None
|
|
|
|
self.event_handshakes_left = 0
|
|
|
|
self.event_multiplier = 1.0
|
|
|
|
self.personality_points = {'aggro': 0, 'stealth': 0, 'scholar': 0}
|
|
|
|
self.night_owl_handshakes = 0
|
|
|
|
self.enc_types_captured = set()
|
|
|
|
|
2025-03-16 16:52:34 -07:00
|
|
|
self.data_lock = threading.Lock()
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
def on_loaded(self):
|
2025-03-16 16:52:34 -07:00
|
|
|
# Load configuration options with fallbacks
|
2025-02-01 18:08:59 -08:00
|
|
|
self.decay_interval = self.options.get('decay_interval', 50)
|
|
|
|
self.decay_amount = self.options.get('decay_amount', 10)
|
|
|
|
self.age_titles = self.options.get('age_titles', self.DEFAULT_AGE_TITLES)
|
|
|
|
self.strength_titles = self.options.get('strength_titles', self.DEFAULT_STRENGTH_TITLES)
|
2025-03-16 16:52:34 -07:00
|
|
|
self.points_map = self.options.get('points_map', self.points_map)
|
|
|
|
self.motivational_quotes = self.options.get('motivational_quotes', self.motivational_quotes)
|
2025-05-04 14:15:07 -07:00
|
|
|
self.show_personality = self.options.get('show_personality', False)
|
2025-02-01 18:08:59 -08:00
|
|
|
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
self.load_data()
|
2025-02-01 18:08:59 -08:00
|
|
|
self.initialize_handshakes()
|
|
|
|
|
|
|
|
def initialize_handshakes(self):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Initialize handshake count based on existing .pcap files."""
|
2024-12-15 14:56:57 -08:00
|
|
|
if self.handshake_count == 0 and os.path.isdir(self.handshake_dir):
|
2025-02-01 18:08:59 -08:00
|
|
|
existing = [f for f in os.listdir(self.handshake_dir) if f.endswith('.pcap')]
|
2025-05-04 14:15:07 -07:00
|
|
|
self.handshake_count = len(existing)
|
|
|
|
logging.info(f"[Age] Initialized with {self.handshake_count} handshakes")
|
|
|
|
self.save_data()
|
2025-02-01 18:08:59 -08:00
|
|
|
|
|
|
|
def get_age_title(self):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Determine age title based on epochs."""
|
2025-02-01 18:08:59 -08:00
|
|
|
thresholds = sorted(self.age_titles.keys(), reverse=True)
|
|
|
|
for t in thresholds:
|
|
|
|
if self.epochs >= t:
|
|
|
|
return self.age_titles[t]
|
|
|
|
return "Unborn"
|
|
|
|
|
|
|
|
def get_strength_title(self):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Determine strength title based on train_epochs."""
|
2025-02-01 18:08:59 -08:00
|
|
|
thresholds = sorted(self.strength_titles.keys(), reverse=True)
|
|
|
|
for t in thresholds:
|
|
|
|
if self.train_epochs >= t:
|
|
|
|
return self.strength_titles[t]
|
|
|
|
return "Untrained"
|
|
|
|
|
2025-02-16 17:50:42 -08:00
|
|
|
def random_motivational_quote(self):
|
2025-05-04 14:15:07 -07:00
|
|
|
"""Return a context-aware motivational quote."""
|
|
|
|
if self.last_handshake_enc:
|
|
|
|
quote = f"Boom! That {self.last_handshake_enc.upper()} never saw you coming."
|
|
|
|
self.last_handshake_enc = None
|
|
|
|
return quote
|
|
|
|
elif self.last_decay_points > 0:
|
|
|
|
quote = f"Decay stung for {self.last_decay_points}. Time to fight back!"
|
|
|
|
self.last_decay_points = 0
|
|
|
|
return quote
|
|
|
|
else:
|
|
|
|
return random.choice(self.motivational_quotes)
|
2025-02-16 17:50:42 -08:00
|
|
|
|
2025-02-16 20:30:15 -08:00
|
|
|
def random_inactivity_message(self, points_lost):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Return a random inactivity message with points lost."""
|
2025-02-16 17:50:42 -08:00
|
|
|
messages = [
|
2025-05-04 14:15:07 -07:00
|
|
|
f"Time to wake up, lost {points_lost} to rust!",
|
|
|
|
f"Decayed by {points_lost}, keep it active!",
|
2025-02-16 17:50:42 -08:00
|
|
|
"Stale, but you can still revive!",
|
|
|
|
"Don't let inactivity hold you back!",
|
|
|
|
"Keep moving, no room for decay!"
|
|
|
|
]
|
2025-05-04 14:15:07 -07:00
|
|
|
return random.choice(messages)
|
2025-02-16 17:50:42 -08:00
|
|
|
|
2025-02-01 18:08:59 -08:00
|
|
|
def check_achievements(self, agent):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Check and announce new age or strength achievements."""
|
2025-02-01 18:08:59 -08:00
|
|
|
current_age = self.get_age_title()
|
|
|
|
current_strength = self.get_strength_title()
|
|
|
|
|
|
|
|
if current_age != self.prev_age_title:
|
|
|
|
agent.view().set('face', faces.HAPPY)
|
2025-02-16 17:50:42 -08:00
|
|
|
agent.view().set('status', f"🎉 {current_age} Achieved! {self.random_motivational_quote()}")
|
2025-03-16 16:52:34 -07:00
|
|
|
logging.info(f"[Age] New age title: {current_age}")
|
2025-02-01 18:08:59 -08:00
|
|
|
self.prev_age_title = current_age
|
|
|
|
|
|
|
|
if current_strength != self.prev_strength_title:
|
|
|
|
agent.view().set('face', faces.MOTIVATED)
|
2025-02-16 17:50:42 -08:00
|
|
|
agent.view().set('status', f"💪 Evolved to {current_strength}!")
|
2025-03-16 16:52:34 -07:00
|
|
|
logging.info(f"[Age] New strength title: {current_strength}")
|
2025-02-01 18:08:59 -08:00
|
|
|
self.prev_strength_title = current_strength
|
|
|
|
|
|
|
|
def apply_decay(self, agent):
|
2025-05-04 14:15:07 -07:00
|
|
|
"""Apply decay to network points based on inactivity."""
|
2025-02-01 18:08:59 -08:00
|
|
|
inactive_epochs = self.epochs - self.last_active_epoch
|
|
|
|
if inactive_epochs >= self.decay_interval:
|
2025-03-16 16:52:34 -07:00
|
|
|
decay_factor = inactive_epochs / self.decay_interval
|
|
|
|
points_lost = int(decay_factor * self.decay_amount)
|
2025-02-01 18:08:59 -08:00
|
|
|
self.network_points = max(0, self.network_points - points_lost)
|
|
|
|
|
|
|
|
if points_lost > 0:
|
2025-05-04 14:15:07 -07:00
|
|
|
self.last_decay_points = points_lost
|
|
|
|
self.streak = 0 # Reset streak on decay
|
2025-02-01 18:08:59 -08:00
|
|
|
agent.view().set('face', faces.SAD)
|
2025-02-16 20:30:15 -08:00
|
|
|
agent.view().set('status', self.random_inactivity_message(points_lost))
|
2025-05-04 14:15:07 -07:00
|
|
|
logging.info(f"[Age] Applied decay: lost {points_lost} points")
|
2025-02-01 18:08:59 -08:00
|
|
|
self.last_active_epoch = self.epochs
|
2024-12-15 14:56:57 -08:00
|
|
|
self.save_data()
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
def on_ui_setup(self, ui):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Set up UI elements with configurable positions."""
|
2025-02-01 18:08:59 -08:00
|
|
|
def get_position(element):
|
2025-05-04 14:15:07 -07:00
|
|
|
x = self.options.get(f"{element}_x", self.default_positions[element][0])
|
|
|
|
y = self.options.get(f"{element}_y", self.default_positions[element][1])
|
2025-02-01 18:08:59 -08:00
|
|
|
return (int(x), int(y))
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
positions = {key: get_position(key) for key in self.default_positions if key != 'stars'}
|
2025-02-01 18:08:59 -08:00
|
|
|
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
ui.add_element('Age', LabeledValue(
|
2025-02-01 18:08:59 -08:00
|
|
|
color=BLACK, label='Age', value="Newborn",
|
|
|
|
position=positions['age'], label_font=fonts.Bold, text_font=fonts.Medium))
|
|
|
|
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
ui.add_element('Strength', LabeledValue(
|
2025-02-01 18:08:59 -08:00
|
|
|
color=BLACK, label='Str', value="Rookie",
|
|
|
|
position=positions['strength'], label_font=fonts.Bold, text_font=fonts.Medium))
|
|
|
|
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
ui.add_element('Points', LabeledValue(
|
2025-05-04 14:15:07 -07:00
|
|
|
color=BLACK, label='Pts', value="0",
|
2025-02-01 18:08:59 -08:00
|
|
|
position=positions['points'], label_font=fonts.Bold, text_font=fonts.Medium))
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
ui.add_element('Progress', LabeledValue(
|
|
|
|
color=BLACK, label='Next Age', value="[ ]",
|
|
|
|
position=positions['progress'], label_font=fonts.Bold, text_font=fonts.Medium))
|
|
|
|
|
|
|
|
if self.show_personality:
|
|
|
|
ui.add_element('Personality', LabeledValue(
|
|
|
|
color=BLACK, label='Trait', value="Neutral",
|
|
|
|
position=positions['personality'], label_font=fonts.Bold, text_font=fonts.Medium))
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
def on_ui_update(self, ui):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Update UI elements with current values."""
|
2025-02-01 18:08:59 -08:00
|
|
|
ui.set('Age', self.get_age_title())
|
|
|
|
ui.set('Strength', self.get_strength_title())
|
|
|
|
ui.set('Points', self.abrev_number(self.network_points))
|
2025-05-04 14:15:07 -07:00
|
|
|
|
|
|
|
# Update progress bar for next age title
|
|
|
|
next_threshold = self.get_next_age_threshold()
|
|
|
|
if next_threshold:
|
|
|
|
progress = self.epochs / next_threshold
|
|
|
|
bar_length = 5
|
|
|
|
filled = int(progress * bar_length)
|
|
|
|
bar = '[' + '=' * filled + ' ' * (bar_length - filled) + ']'
|
|
|
|
ui.set('Progress', bar)
|
|
|
|
else:
|
|
|
|
ui.set('Progress', '[MAX]')
|
|
|
|
|
|
|
|
if self.show_personality:
|
|
|
|
ui.set('Personality', self.get_dominant_personality())
|
|
|
|
|
|
|
|
def get_next_age_threshold(self):
|
|
|
|
"""Get the next age title threshold."""
|
|
|
|
thresholds = sorted(self.age_titles.keys())
|
|
|
|
for t in thresholds:
|
|
|
|
if self.epochs < t:
|
|
|
|
return t
|
|
|
|
return None # Max level reached
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
def on_epoch(self, agent, epoch, epoch_data):
|
2025-05-04 14:15:07 -07:00
|
|
|
"""Handle epoch events."""
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
self.epochs += 1
|
2025-02-01 18:08:59 -08:00
|
|
|
self.train_epochs += 1 if self.epochs % 10 == 0 else 0
|
2025-05-04 14:15:07 -07:00
|
|
|
if self.epochs % 10 == 0:
|
|
|
|
self.personality_points['scholar'] += 1
|
|
|
|
|
2025-03-16 16:52:34 -07:00
|
|
|
logging.debug(f"[Age] Epoch {self.epochs}, Points: {self.network_points}")
|
2025-02-01 18:08:59 -08:00
|
|
|
|
|
|
|
self.apply_decay(agent)
|
|
|
|
self.check_achievements(agent)
|
|
|
|
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
if self.epochs % 100 == 0:
|
2025-05-04 14:15:07 -07:00
|
|
|
self.handle_random_event(agent)
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
self.age_checkpoint(agent)
|
2025-02-01 18:08:59 -08:00
|
|
|
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
self.save_data()
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
def handle_random_event(self, agent):
|
|
|
|
"""Trigger a random event with 5% chance every 100 epochs."""
|
|
|
|
if random.random() < 0.05:
|
|
|
|
events = [
|
|
|
|
{"description": "Lucky Break: Double points for next 5 handshakes!", "multiplier": 2.0, "handshakes": 5},
|
|
|
|
{"description": "Signal Noise: Next handshake worth half points.", "multiplier": 0.5, "handshakes": 1},
|
|
|
|
]
|
|
|
|
self.active_event = random.choice(events)
|
|
|
|
self.event_handshakes_left = self.active_event["handshakes"]
|
|
|
|
self.event_multiplier = self.active_event["multiplier"]
|
|
|
|
agent.view().set('status', self.active_event["description"])
|
|
|
|
logging.info(f"[Age] Random event: {self.active_event['description']}")
|
|
|
|
|
2025-02-01 20:22:55 -08:00
|
|
|
def age_checkpoint(self, agent):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Display milestone message every 100 epochs."""
|
2025-02-01 20:22:55 -08:00
|
|
|
view = agent.view()
|
|
|
|
view.set('face', faces.HAPPY)
|
|
|
|
view.set('status', f"Epoch milestone: {self.epochs} epochs!")
|
|
|
|
view.update(force=True)
|
|
|
|
|
2025-02-01 18:08:59 -08:00
|
|
|
def on_handshake(self, agent, *args):
|
2025-05-04 14:15:07 -07:00
|
|
|
"""Handle handshake events with streaks and secret achievements."""
|
2025-03-16 16:52:34 -07:00
|
|
|
try:
|
|
|
|
if len(args) < 3:
|
|
|
|
logging.warning("[Age] Insufficient arguments in on_handshake")
|
|
|
|
return
|
|
|
|
|
|
|
|
ap = args[2]
|
|
|
|
if isinstance(ap, dict):
|
|
|
|
enc = ap.get('encryption', '').lower()
|
|
|
|
essid = ap.get('essid', 'unknown')
|
|
|
|
else:
|
2025-05-04 14:15:07 -07:00
|
|
|
logging.warning(f"[Age] AP is a string: {ap}")
|
2025-03-16 16:52:34 -07:00
|
|
|
return
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Base points
|
2025-03-16 16:52:34 -07:00
|
|
|
points = self.points_map.get(enc, 1)
|
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Apply streak bonus
|
|
|
|
self.streak += 1
|
|
|
|
streak_threshold = 5
|
|
|
|
streak_bonus = 1.2
|
|
|
|
if self.streak >= streak_threshold:
|
|
|
|
points *= streak_bonus
|
|
|
|
agent.view().set('status', f"Streak bonus! +{int((streak_bonus - 1) * 100)}% points")
|
|
|
|
|
|
|
|
# Apply random event multiplier
|
|
|
|
if self.active_event and self.event_handshakes_left > 0:
|
|
|
|
points *= self.event_multiplier
|
|
|
|
self.event_handshakes_left -= 1
|
|
|
|
if self.event_handshakes_left == 0:
|
|
|
|
self.active_event = None
|
|
|
|
self.event_multiplier = 1.0
|
|
|
|
|
|
|
|
points = int(points)
|
2025-03-16 16:52:34 -07:00
|
|
|
self.network_points += points
|
|
|
|
self.handshake_count += 1
|
|
|
|
self.last_active_epoch = self.epochs
|
2025-05-04 14:15:07 -07:00
|
|
|
self.last_handshake_enc = enc
|
|
|
|
self.personality_points['aggro'] += 1
|
2025-03-16 16:52:34 -07:00
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
# Secret achievements
|
|
|
|
current_hour = time.localtime().tm_hour
|
|
|
|
if 2 <= current_hour < 4:
|
|
|
|
self.night_owl_handshakes += 1
|
|
|
|
if self.night_owl_handshakes == 10:
|
|
|
|
agent.view().set('status', "Achievement Unlocked: Night Owl!")
|
|
|
|
self.network_points += 50 # Bonus
|
|
|
|
|
|
|
|
self.enc_types_captured.add(enc)
|
|
|
|
if self.enc_types_captured == set(self.points_map.keys()):
|
|
|
|
agent.view().set('status', "Achievement Unlocked: Crypto King!")
|
|
|
|
self.network_points += 100 # Bonus
|
|
|
|
|
|
|
|
# Log handshake
|
|
|
|
with open(self.log_path, 'a') as f:
|
|
|
|
f.write(f"{time.time()},{essid},{enc},{points}\n")
|
2025-03-16 16:52:34 -07:00
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
logging.info(f"[Age] Handshake: {essid}, enc: {enc}, points: {points}, streak: {self.streak}")
|
2025-03-16 16:52:34 -07:00
|
|
|
|
|
|
|
self.save_data()
|
|
|
|
except Exception as e:
|
2025-05-04 14:15:07 -07:00
|
|
|
logging.error(f"[Age] Handshake error: {str(e)}")
|
2024-12-15 17:00:36 -08:00
|
|
|
|
2025-02-01 18:08:59 -08:00
|
|
|
def load_data(self):
|
2025-05-04 14:15:07 -07:00
|
|
|
"""Load saved data from JSON file."""
|
2025-02-16 17:50:42 -08:00
|
|
|
try:
|
2025-02-01 18:08:59 -08:00
|
|
|
if os.path.exists(self.data_path):
|
|
|
|
with open(self.data_path, 'r') as f:
|
|
|
|
data = json.load(f)
|
2025-03-16 16:52:34 -07:00
|
|
|
self.epochs = data.get('epochs', 0)
|
|
|
|
self.train_epochs = data.get('train_epochs', 0)
|
|
|
|
self.network_points = data.get('points', 0)
|
|
|
|
self.handshake_count = data.get('handshakes', 0)
|
2025-02-01 18:08:59 -08:00
|
|
|
self.last_active_epoch = data.get('last_active', 0)
|
|
|
|
self.prev_age_title = data.get('prev_age', self.get_age_title())
|
|
|
|
self.prev_strength_title = data.get('prev_strength', self.get_strength_title())
|
2025-05-04 14:15:07 -07:00
|
|
|
self.streak = data.get('streak', 0)
|
|
|
|
self.night_owl_handshakes = data.get('night_owl_handshakes', 0)
|
|
|
|
self.enc_types_captured = set(data.get('enc_types_captured', []))
|
|
|
|
for trait in ['aggro', 'stealth', 'scholar']:
|
|
|
|
self.personality_points[trait] = data.get(f'personality_{trait}', 0)
|
2025-02-01 18:08:59 -08:00
|
|
|
except Exception as e:
|
|
|
|
logging.error(f"[Age] Load error: {str(e)}")
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
|
|
|
|
def save_data(self):
|
2025-03-16 16:52:34 -07:00
|
|
|
"""Save current data to JSON file with thread safety."""
|
2025-02-16 17:50:42 -08:00
|
|
|
data = {
|
2025-02-01 18:08:59 -08:00
|
|
|
'epochs': self.epochs,
|
|
|
|
'train_epochs': self.train_epochs,
|
|
|
|
'points': self.network_points,
|
|
|
|
'handshakes': self.handshake_count,
|
|
|
|
'last_active': self.last_active_epoch,
|
|
|
|
'prev_age': self.get_age_title(),
|
|
|
|
'prev_strength': self.get_strength_title(),
|
2025-05-04 14:15:07 -07:00
|
|
|
'streak': self.streak,
|
|
|
|
'night_owl_handshakes': self.night_owl_handshakes,
|
|
|
|
'enc_types_captured': list(self.enc_types_captured),
|
|
|
|
'personality_aggro': self.personality_points['aggro'],
|
|
|
|
'personality_stealth': self.personality_points['stealth'],
|
|
|
|
'personality_scholar': self.personality_points['scholar'],
|
Add files via upload
Below is an example of how you can describe the plugin’s purpose, functionality, and installation instructions in a README.md file on your GitHub repository. You can adjust the wording and formatting as you see fit:
Age, Strength, and Network Points Plugin for Pwnagotchi
Author: AlienMajik
Version: 1.0.4
License: MIT
Description
This Pwnagotchi plugin extends your Pwnagotchi’s user interface and functionality by adding three key stats:
Age (♥ Age): Tracks how many epochs your Pwnagotchi has lived.
Strength (Str): Indicates how much your Pwnagotchi has "trained," increasing every 10 epochs by default.
Network Points (★ Pts): Awards points based on the type of network handshakes your Pwnagotchi captures. Stronger encryptions yield more points, weaker encryptions yield fewer. The points are logged for your reference.
Network Points Scoring:
WPA3: +10 points
WPA2: +5 points
WEP/WPA: +2 points
Open/Unknown: +1 point
Each time points are awarded, an entry is appended to /root/network_points.log with the ESSID, encryption type, points gained, and the updated total.
All stats (age, strength, network points) are saved to /root/age_strength.json, ensuring that your Pwnagotchi remembers these values across reboots.
Features
Persistent Stats: Age, Strength, and Points survive restarts.
UI Integration: Displays stats directly on the Pwnagotchi screen.
Logging: Keeps a dedicated log file of network-related point gains.
Customizable: You can tweak increments and positions via config options.
2024-12-14 23:19:32 -08:00
|
|
|
}
|
2025-03-16 16:52:34 -07:00
|
|
|
with self.data_lock:
|
|
|
|
try:
|
|
|
|
with open(self.data_path, 'w') as f:
|
|
|
|
json.dump(data, f, indent=2)
|
|
|
|
except Exception as e:
|
|
|
|
logging.error(f"[Age] Save error: {str(e)}")
|
2025-02-01 18:08:59 -08:00
|
|
|
|
2025-05-04 14:15:07 -07:00
|
|
|
def get_dominant_personality(self):
|
|
|
|
"""Determine dominant personality trait."""
|
|
|
|
if not any(self.personality_points.values()):
|
|
|
|
return "Neutral"
|
|
|
|
dominant = max(self.personality_points, key=self.personality_points.get)
|
|
|
|
return dominant.capitalize()
|
2025-02-01 18:08:59 -08:00
|
|
|
|
|
|
|
def abrev_number(self, num):
|
2025-05-04 14:15:07 -07:00
|
|
|
"""Abbreviate large numbers."""
|
2025-02-01 18:08:59 -08:00
|
|
|
for unit in ['','K','M','B']:
|
|
|
|
if abs(num) < 1000:
|
|
|
|
return f"{num:.1f}{unit}".rstrip('.0')
|
|
|
|
num /= 1000.0
|
|
|
|
return f"{num:.1f}T"
|