# ba_meta require api 9 #! Crafted by brostos from platform import machine import threading import time import urllib.request import re import babase import bauiv1 as bui import bascenev1 as bs def threaded(func): def wrapper(*args, **kwargs): thread = threading.Thread( target=func, args=args, kwargs=kwargs, name=func.__name__ ) thread.start() return wrapper def play_sound(sound): with bs.get_foreground_host_activity().context: bs.getsound(sound).play() @threaded def fetch_update(): url = 'https://ballistica.net/downloads' try: response = urllib.request.urlopen(url) web_content = response.read().decode('utf-8') except: return match = re.search(r'(\d+)', web_content) if match: latest_build_number = int(match.group(1)) current_build_number = int(babase.app.env.engine_build_number) if latest_build_number == current_build_number: return pattern = r' 0: time.sleep(delay) babase.pushcall(babase.Call(play_sound, sound), from_other_thread=True) time.sleep(1) bui.open_url(f'https://ballistica.net/downloads#:~:text={extension}') elif not build: if ('server' in link_lower) and bs_platform.lower() in link_lower: GREEN = "\033[32m" LIGHT_BLUE = "\033[94m" RESET = "\033[0m" try: print(f"{GREEN}A new BombSquad version is available...Redirecting to download page{RESET}") time.sleep(4) bui.open_url(f'https://ballistica.net/downloads#:~:text={extension}') except: print( f"{GREEN}Download the latest version using this official link-> {LIGHT_BLUE}{link}{RESET}") # ba_meta export babase.Plugin class bybrostos(babase.Plugin): def on_app_running(self): fetch_update()