Skip to content

Commit

Permalink
[update] (2.8) Fix Boost & Boost Sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
m3taphor committed Dec 27, 2024
1 parent 9c0a82b commit 99c8415
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<img src="https://i.ibb.co/Q6Lwvdt/photo-2024-11-18-23-50-52-modified.png" alt="TinyVerse Logo" width="100" height="100">
</a>

<h3 align="center">Auto <a href="https://t.me/TVerse?startapp=galaxy-0001a845e80004f232c60000a43a7f">@TVerse 2.7</a></h3>
<h3 align="center">Auto <a href="https://t.me/TVerse?startapp=galaxy-0001a845e80004f232c60000a43a7f">@TVerse 2.8</a></h3>
<p align="center">
Auto <a href="https://t.me/TVerse?startapp=galaxy-0001a845e80004f232c60000a43a7f">@TVerse</a> Farming Script
<br />
Expand Down
23 changes: 11 additions & 12 deletions bot/core/tapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from random import randint

from bot.utils.functions import unix_convert, stars_count, getGiftCode, errorGiftCode
from bot.utils.functions import unix_convert, stars_count, getGiftCode, errorGiftCode, boostCount

from ..utils.firstrun import append_line_to_file

Expand All @@ -54,10 +54,9 @@ def __init__(self, tg_client: Client, first_run: bool, app_id: str):
self.app_version = app_id
self.theme_params = "{\"accent_text_color\":\"#6ab2f2\",\"bg_color\":\"#17212b\",\"bottom_bar_bg_color\":\"#17212b\",\"button_color\":\"#5288c1\",\"button_text_color\":\"#ffffff\",\"destructive_text_color\":\"#ec3942\",\"header_bg_color\":\"#17212b\",\"hint_color\":\"#708499\",\"link_color\":\"#6ab3f3\",\"secondary_bg_color\":\"#232e3c\",\"section_bg_color\":\"#17212b\",\"section_header_text_color\":\"#6ab3f3\",\"section_separator_color\":\"#111921\",\"subtitle_text_color\":\"#708499\",\"text_color\":\"#f5f5f5\"}"
self.boost_translation = {
1: "3h +20% Speed",
2: "12h +50% Speed",
3: "3h Auto-Collect",
4: "12h Auto-Collect"
1: "+20% Speed",
2: "+50% Speed",
3: "Auto Collect",
}

async def get_tg_web_data(self, proxy: str | None) -> str:
Expand Down Expand Up @@ -347,11 +346,12 @@ async def get_boost(self, http_client: aiohttp.ClientSession, session_token):
return None

@error_handler
async def activate_boost(self, http_client: aiohttp.ClientSession, session_token, boost_id):
async def activate_boost(self, http_client: aiohttp.ClientSession, session_token, boost_id, boost_count):
additional_headers = {'X-Application-Version': self.app_version}
urlencoded_data = {
"session": session_token,
"boost_id": boost_id
"boost_id": boost_id,
"count": boost_count
}

response = await self.make_request(http_client, 'POST', endpoint="/boost/activate", urlencoded_data=urlencoded_data, extra_headers=additional_headers)
Expand Down Expand Up @@ -638,7 +638,8 @@ async def run(self, user_agent: str, proxy: str | None) -> None:

if expires == 0 or current_time > expires and count > 0:
boost_id = int(item['boost_id'])
apply_boost = await self.activate_boost(http_client, session_token=session_token, boost_id=boost_id)
boost_count = boostCount(total=count)
apply_boost = await self.activate_boost(http_client, session_token=session_token, boost_id=boost_id, boost_count=boost_count)
if not apply_boost:
logger.error(f"{self.session_name} | Unknown error while activating Boost!")
logger.info(f"{self.session_name} | Sleep <y>{round(sleep_time / 60, 1)}</y> min")
Expand All @@ -647,10 +648,8 @@ async def run(self, user_agent: str, proxy: str | None) -> None:

logger.success(f"{self.session_name} | Boost Activated <y>{boost_id}</y>: <g>({self.boost_translation.get(boost_id, 'N/A')})</g>")

if boost_id == 4: # 12 Hours boost
boost_delay = max(boost_delay, 12 * 60 * 60)
elif boost_id == 3: # 3 Hours boost
boost_delay = max(boost_delay, 3 * 60 * 60)
if boost_id == 3: # 3 Hours boost
boost_delay = max(boost_delay, boost_count * 60 * 60)

await asyncio.sleep(random.randint(1, 3))
if boost_delay > 0:
Expand Down
8 changes: 7 additions & 1 deletion bot/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ def errorGiftCode(code, type_):
else:
return None

save_data('gift-codes.json', data)
save_data('gift-codes.json', data)

def boostCount(total):
if total > 24:
return 24
else:
return int(total)
2 changes: 1 addition & 1 deletion bot/utils/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def print_banner():
\033[38;5;128m |█▓' ▓▓ ║▓╫ ▓▓N ▓▓И ╞▓▌ |╫▓ ┣▓┦ ▓▓N \033[38;5;213m [▓▓▌
\033[38;5;128m ▓█| ╬▓ ┣▓╫ ▓█L,╥=, ╫╫L_ Æ╣] ╘╨▓║P_ ' ▓█L,╥=, \033[38;5;213m ╘║║╛
\033[38;5;128m ╫║ ┣▓▓__▓█╫ ║║Γ`""' ▓▓Γ`┣▓ _ ▀█┳ ║║Γ`""' \033[38;5;213m ▓▓ \033[37m- For education purpose
\033[38;5;128m █▓| ╡╬▓▓╡╡ ▓▓_ ▓█ ╘█▌ ╫╪L _█╫ ▓▓_ \033[38;5;213m ▀▀ \033[37m- Version: 2.7 (accounts.json edition)
\033[38;5;128m █▓| ╡╬▓▓╡╡ ▓▓_ ▓█ ╘█▌ ╫╪L _█╫ ▓▓_ \033[38;5;213m ▀▀ \033[37m- Version: 2.8 (accounts.json edition)
\033[38;5;128m ╘"' "╘╘ ╘╘╘""""' ╘"" ╘╘ """"""" ╘╘╘""""'\033[38;5;213m ╘╘ \033[37m- By [G.Hub]: \033[5m@m3taphor\033[38;5;135m
\033[0m''')

Expand Down
2 changes: 1 addition & 1 deletion bot/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


logger.remove()
logger.add(sink=sys.stdout, format="<white>TVerse 2.7</white>"
logger.add(sink=sys.stdout, format="<white>TVerse 2.8</white>"
" | <white>{time:YYYY-MM-DD HH:mm:ss}</white>"
" | <level>{level: <8}</level>"
" | <cyan><b>{line}</b></cyan>"
Expand Down

0 comments on commit 99c8415

Please sign in to comment.