Skip to content

Commit 1189870

Browse files
committed
3.2.3
- python 3.11.6 > 3.11.7 - added force-translate to settings! - removed unitypackff - updated packages - minor code improvements Former-commit-id: c86c918
1 parent 49a4980 commit 1189870

File tree

4 files changed

+30
-37
lines changed

4 files changed

+30
-37
lines changed

__src__/executor.py

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[NOTE]
99
1010
- executor.py is meant to be executed only as an executable, not as a python script!
11-
- the below packages are not required by the executor.py script but is required by the various __modules__ run by the dank.tool.exe
11+
- the below packages are not required by the executor.py script but are required by the various __modules__ run by the dank.tool.exe
1212
- they are listed here to be included in the final build of dank.tool.exe
1313
'''
1414

@@ -20,6 +20,7 @@
2020
import ctypes
2121
import winreg
2222
import sqlite3
23+
import requests
2324
import pyminizip
2425
import subprocess
2526
import tkinter as tk
@@ -33,35 +34,26 @@
3334
from pynput.keyboard import Key, Listener
3435
from pynput.mouse import Button, Controller
3536
from mcstatus import JavaServer, BedrockServer
36-
from dankware import cls, err, multithread, align, github_downloads, github_file_selector, rm_line, random_ip, get_duration, sys_open, is_admin, export_registry_keys, file_selector, folder_selector, get_path
37+
from concurrent.futures import ThreadPoolExecutor
38+
from dankware import cls, clr, title, err, multithread, align, github_downloads, github_file_selector, rm_line, random_ip, get_duration, sys_open, is_admin, export_registry_keys, file_selector, folder_selector, get_path
3739
from dankware import reset, black, blue, cyan, green, magenta, red, white, yellow, black_normal, blue_normal, cyan_normal, green_normal, magenta_normal, red_normal, white_normal, yellow_normal, black_dim, blue_dim, cyan_dim, green_dim, magenta_dim, red_dim, white_dim, yellow_dim
3840

39-
# required packages for dank.fusion-fall.py
40-
41-
from unitypackff.asset import Asset
42-
from unitypackff.export import OBJMesh
43-
from unitypackff.object import FFOrderedDict, ObjectPointer
44-
from unitypackff.modding import import_texture, import_mesh, import_audio
45-
4641
# required packages for dank.game.py
4742

4843
import numpy
4944
from ursina import *
45+
from ursina.scripts import *
5046
from ursina.shaders import *
51-
from ursina.shaders import texture_blend_shader
5247
from ursina.prefabs.first_person_controller import FirstPersonController
5348

5449
# required packages for executor.py
5550

56-
import requests
5751
from pypresence import Presence
58-
from dankware import clr, title
5952
from packaging.version import parse
60-
from concurrent.futures import ThreadPoolExecutor
6153

6254
# variables
6355

64-
DANK_TOOL_VERSION = "3.2.2"
56+
DANK_TOOL_VERSION = "3.2.3"
6557
session = requests.Session()
6658
_executor = ThreadPoolExecutor(10)
6759
headers = {"User-Agent": "dank.tool"}
@@ -85,18 +77,20 @@ def settings_json():
8577
"offline-mode": "0",
8678
"dev-branch": "0",
8779
"force-update": "0",
80+
"force-translate": "0",
8881
"force-startup-audio": "0",
8982
"disable-startup-audio": "0",
9083
}
9184

9285
if not os.path.isfile('settings.json'):
9386
overwrite = True
9487
else:
95-
keys = json.loads(open('settings.json', 'r', encoding='utf-8').read()).keys()
88+
data = json.loads(open('settings.json', 'r', encoding='utf-8').read())
9689
for key in default_settings:
97-
if not key in keys:
90+
if not key in data.keys():
9891
overwrite = True
99-
break
92+
else:
93+
default_settings[key] = data[key]
10094

10195
if overwrite:
10296
open('settings.json', 'w', encoding='utf-8').write(json.dumps(default_settings, indent=4))
@@ -114,9 +108,8 @@ def settings_json():
114108
# handle KeyboardInterrupt
115109

116110
def print_warning_symbol():
117-
118-
warning_symbol = f'\n\n{red} ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red}██ {white}██████{red} ██\n{red}██ ██\n{red} ██████████████████████████████████████████ \n'
119-
cls(); print(align(warning_symbol))
111+
112+
cls(); print(align(f'\n\n{red} ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ ██ \n{red} ██ {white}██████{red} ██ \n{red} ██ {white}██████{red} ██ \n{red}██ {white}██████{red} ██\n{red}██ ██\n{red} ██████████████████████████████████████████ \n'))
120113

121114
# get latest version number
122115

@@ -167,8 +160,6 @@ def dank_tool_installer():
167160
except: pass
168161
input(clr(f"{err_message}\n\n > Press [ENTER] to EXIT... ",2))
169162
sys.exit(err_message)
170-
171-
sys.exit("Updated!")
172163

173164
# update environment variables
174165

@@ -211,13 +202,16 @@ def check_windows_language():
211202
break
212203

213204
if not locale_name.lower().startswith('en'):
214-
translator = Translator()
215-
result = translator.translate("Would you like to enable the translate feature?", source_language='en', destination_language=locale_name)
216-
print(clr(f"\n - Your windows language is set to '{cyan}{locale_name}'!"))
217-
if input(clr(f"\n > {result} [y/n]:", colour_one=cyan)).lower() == 'y':
205+
if int(DANK_TOOL_SETTINGS['force-translate']):
218206
os.environ['DANK_TOOL_LANG'] = locale_name
219207
else:
220-
os.environ['DANK_TOOL_LANG'] = "en"
208+
translator = Translator()
209+
result = translator.translate("Would you like to enable the translate feature?", source_language='en', destination_language=locale_name).result
210+
print(clr(f"\n - Your windows language is set to '{cyan}{locale_name}'!"))
211+
if input(clr(f"\n > {result} [y/n]: ", colour_one=cyan) + cyan).lower() == 'y':
212+
os.environ['DANK_TOOL_LANG'] = locale_name
213+
else:
214+
os.environ['DANK_TOOL_LANG'] = "en"
221215
else:
222216
os.environ['DANK_TOOL_LANG'] = "en"
223217

@@ -284,6 +278,7 @@ def dank_tool_runs_counter():
284278
try: session.get("https://dank-site.onrender.com/counter?id=dank.tool&hit=true", headers=headers); break
285279
except: fail_counter += 1
286280
time.sleep(60)
281+
del globals()['dank_tool_runs_counter']
287282

288283
if ONLINE_MODE:
289284
_executor.submit(dank_tool_runs_counter)
@@ -301,6 +296,7 @@ def dank_tool_chatroom():
301296
try: session.post("https://dank-site.onrender.com/chatroom-users", headers=headers); fail_counter = 0 # do not add a break here! (keeps user validated)
302297
except: fail_counter += 1
303298
time.sleep(240)
299+
del globals()['dank_tool_chatroom']
304300

305301
if ONLINE_MODE:
306302
_executor.submit(dank_tool_chatroom)
@@ -321,16 +317,13 @@ def dank_tool_chatroom():
321317
err_message = err(sys.exc_info())
322318
print(clr(err_message, 2))
323319
LATEST_VERSION = latest_dank_tool_version()
324-
325-
if "Updated!" in err_message:
326-
sys.exit("Updated!")
327-
328-
elif "Error Type: KeyboardInterrupt" in err_message:
320+
321+
if "Error Type: KeyboardInterrupt" in err_message:
329322
print_warning_symbol()
330323
print(clr("\n - Please select text first and then use [ CTRL + C ]!"))
331324

332325
elif parse(LATEST_VERSION) > parse(DANK_TOOL_VERSION):
333-
print(clr(f"\n - Updating to the latest version...\n\n - Update Found: {LATEST_VERSION}"))
326+
print(clr(f"\n - Update Found: {LATEST_VERSION}"))
334327
dank_tool_installer()
335328

336329
elif ONLINE_MODE:
@@ -342,5 +335,5 @@ def dank_tool_chatroom():
342335
print(clr("\n - Error Reported! If it is an OS error, Please run as admin and try again!\n\n - If it is a logic error, it will be fixed soon!"))
343336

344337
input(clr("\n > Press [ENTER] to EXIT... "))
345-
os.system("taskkill /f /im dank.tool.exe")
338+
os.system("taskkill /f /t /im dank.tool.exe")
346339

__src__/executor_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.2
1+
3.2.3

dank.tool.zip.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3607a77fbd2cec7e330ca7141a5f38e7b8d2c944
1+
0e89166ad0026be58666b56f3c4e4b7533d5f57d

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ win11toast
1212
translatepy
1313
playsound==1.2.2
1414
numpy
15-
ursina
15+
https://github.com/pokepetter/ursina/archive/refs/heads/master.zip

0 commit comments

Comments
 (0)