yasir68 commited on
Commit
7837518
1 Parent(s): 0ec4dec

Upload folder using huggingface_hub (#1)

Browse files

- Upload folder using huggingface_hub (1c875b5f0426b4508ac0b8e4e7b91210c890636d)

.github/workflows/docker.yml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and Push Docker Image
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ push_to_registry:
10
+ name: Push Docker image to Docker Hub
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ packages: write
15
+ steps:
16
+ - name: Check out the repo
17
+ uses: actions/checkout@v3
18
+
19
+ - name: Login to GitHub Container Registry
20
+ uses: docker/login-action@v1
21
+ with:
22
+ registry: ghcr.io
23
+ username: ${{ github.actor }}
24
+ password: ${{ secrets.GITHUB_TOKEN }}
25
+
26
+ - name: 'Build Inventory Image'
27
+ run: |
28
+ docker build . --tag ghcr.io/orrnobmahmud/moonbixauto:latest
29
+ docker push ghcr.io/orrnobmahmud/moonbixauto:latest
bot-proxy.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+
3
+ sys.dont_write_bytecode = True
4
+
5
+ from orrnob_drops_automation import base
6
+ from core.token import get_token
7
+ from core.info import get_info
8
+ from core.game import process_play_game
9
+
10
+ import time
11
+ import json
12
+
13
+
14
+ class Moonbix:
15
+ def __init__(self):
16
+ # Get file directory
17
+ self.data_file = base.file_path(file_name="data-proxy.json")
18
+ self.config_file = base.file_path(file_name="config.json")
19
+
20
+ # Initialize line
21
+ self.line = base.create_line(length=50)
22
+
23
+ # Initialize banner
24
+ self.banner = base.create_banner(game_name="Moonbix")
25
+
26
+ def main(self):
27
+ while True:
28
+ base.clear_terminal()
29
+ print(self.banner)
30
+ accounts = json.load(open(self.data_file, "r"))["accounts"]
31
+ num_acc = len(accounts)
32
+ base.log(self.line)
33
+ base.log(f"{base.green}Number of accounts: {base.white}{num_acc}")
34
+
35
+ for no, account in enumerate(accounts):
36
+ base.log(self.line)
37
+ base.log(f"{base.green}Account number: {base.white}{no+1}/{num_acc}")
38
+ data = account["acc_info"]
39
+ proxy_info = account["proxy_info"]
40
+ parsed_proxy_info = base.parse_proxy_info(proxy_info)
41
+ if parsed_proxy_info is None:
42
+ break
43
+
44
+ actual_ip = base.check_ip(proxy_info=proxy_info)
45
+
46
+ proxies = base.format_proxy(proxy_info=proxy_info)
47
+
48
+ try:
49
+ token = get_token(data=data, proxies=proxies)
50
+
51
+ if token:
52
+
53
+ get_info(token=token, proxies=proxies)
54
+
55
+ process_play_game(token=token, proxies=proxies)
56
+
57
+ get_info(token=token, proxies=proxies)
58
+
59
+ else:
60
+ base.log(f"{base.red}Token not found! Please get new query id")
61
+ except Exception as e:
62
+ base.log(f"{base.red}Error: {base.white}{e}")
63
+
64
+ print()
65
+ wait_time = 30 * 60
66
+ base.log(f"{base.yellow}Wait for {int(wait_time/60)} minutes!")
67
+ time.sleep(wait_time)
68
+
69
+
70
+ if __name__ == "__main__":
71
+ try:
72
+ moonbix = Moonbix()
73
+ moonbix.main()
74
+ except KeyboardInterrupt:
75
+ sys.exit()
bot.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ import time
3
+
4
+ sys.dont_write_bytecode = True
5
+
6
+ from orrnob_drops_automation import base
7
+ from core.token import get_token
8
+ from core.info import get_info
9
+ from core.game import process_play_game
10
+
11
+
12
+ class Moonbix:
13
+ def __init__(self):
14
+ # Get file directory
15
+ self.data_file = base.file_path(file_name="data.txt")
16
+ self.config_file = base.file_path(file_name="config.json")
17
+ self.proxy_file = base.file_path(file_name="data.proxy.txt") # Add proxy file path
18
+
19
+ # Initialize line
20
+ self.line = base.create_line(length=50)
21
+
22
+ # Initialize banner
23
+ self.banner = base.create_banner(game_name="Moonbix")
24
+
25
+ def display_proxy(self):
26
+ # Display active proxy details if found
27
+ try:
28
+ with open(self.proxy_file, "r") as file:
29
+ proxy_data = file.read().strip()
30
+ if proxy_data:
31
+ base.log(f"{base.green}Active Proxy: {base.white}{proxy_data}")
32
+ else:
33
+ base.log(f"{base.red}No active proxy found.")
34
+ except FileNotFoundError:
35
+ base.log(f"{base.red}Proxy file not found.")
36
+
37
+ def main(self):
38
+ while True:
39
+ base.clear_terminal()
40
+ print(self.banner)
41
+
42
+ # Display proxy details
43
+ self.display_proxy()
44
+
45
+ data = open(self.data_file, "r").read().splitlines()
46
+ num_acc = len(data)
47
+ base.log(self.line)
48
+ base.log(f"{base.green}Number of accounts: {base.white}{num_acc}")
49
+
50
+ for no, data in enumerate(data):
51
+ base.log(self.line)
52
+ base.log(f"{base.green}Account number: {base.white}{no+1}/{num_acc}")
53
+
54
+ try:
55
+ token = get_token(data=data)
56
+
57
+ if token:
58
+ get_info(token=token)
59
+ process_play_game(token=token)
60
+ get_info(token=token)
61
+ else:
62
+ base.log(f"{base.red}Token Expired! Please get new query id")
63
+ except Exception as e:
64
+ base.log(f"{base.red}Error: {base.white}{e}")
65
+
66
+ print()
67
+ wait_time = 30 * 60
68
+ base.log(f"{base.yellow}Wait for {int(wait_time / 60)} minutes!")
69
+ time.sleep(wait_time)
70
+
71
+
72
+ if __name__ == "__main__":
73
+ try:
74
+ moonbix = Moonbix()
75
+ moonbix.main()
76
+ except KeyboardInterrupt:
77
+ sys.exit()
compose.yml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ services:
2
+ app:
3
+ image: ghcr.io/orrnobmahmud/moonbixauto
4
+ volumes:
5
+ - ./data.txt:/app/moonbixauto/data.txt
config.json ADDED
@@ -0,0 +1 @@
 
 
1
+
core/__init__.py ADDED
File without changes
core/combination.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+ import time
3
+ import base64
4
+ from Crypto.Cipher import AES
5
+ from Crypto.Random import get_random_bytes
6
+
7
+
8
+ def encrypt(text, key):
9
+ iv = get_random_bytes(12)
10
+ iv_base64 = base64.b64encode(iv).decode("utf-8")
11
+ cipher = AES.new(key, AES.MODE_CBC, iv_base64[:16].encode("utf-8"))
12
+
13
+ def pad(s):
14
+ block_size = AES.block_size
15
+ return s + (block_size - len(s) % block_size) * chr(
16
+ block_size - len(s) % block_size
17
+ )
18
+
19
+ padded_text = pad(text).encode("utf-8")
20
+ encrypted = cipher.encrypt(padded_text)
21
+ encrypted_base64 = base64.b64encode(encrypted).decode("utf-8")
22
+
23
+ return iv_base64 + encrypted_base64
24
+
25
+
26
+ def get_game_data(game_response):
27
+ start_time = int(time.time() * 1000)
28
+ end_time = start_time + 45000 # 45 seconds in milliseconds
29
+ game_tag = game_response["data"]["gameTag"]
30
+ item_settings = game_response["data"]["cryptoMinerConfig"]["itemSettingList"]
31
+
32
+ current_time = start_time
33
+ score = 100
34
+ game_events = []
35
+
36
+ while current_time < end_time:
37
+ # Generate random time increment
38
+ time_increment = random.randint(1500, 2500)
39
+ current_time += time_increment
40
+
41
+ if current_time >= end_time:
42
+ break
43
+
44
+ # Generate random hook positions and angles
45
+ hook_pos_x = round(random.uniform(75, 275), 3)
46
+ hook_pos_y = round(random.uniform(199, 251), 3)
47
+ hook_shot_angle = round(random.uniform(-1, 1), 3)
48
+ hook_hit_x = round(random.uniform(100, 400), 3)
49
+ hook_hit_y = round(random.uniform(250, 700), 3)
50
+
51
+ # Determine item type, size, and points
52
+ item_type, item_size, points = 0, 0, 0
53
+ random_value = random.random()
54
+
55
+ if random_value < 0.6:
56
+ # Select a reward item
57
+ reward_items = [item for item in item_settings if item["type"] == "REWARD"]
58
+ selected_reward = random.choice(reward_items)
59
+ item_type = 1
60
+ item_size = selected_reward["size"]
61
+ points = min(selected_reward["rewardValueList"][0], 10)
62
+ score = min(score + points, 200)
63
+ elif random_value < 0.8:
64
+ # Select a trap item
65
+ trap_items = [item for item in item_settings if item["type"] == "TRAP"]
66
+ selected_trap = random.choice(trap_items)
67
+ item_type = 1
68
+ item_size = selected_trap["size"]
69
+ points = min(abs(selected_trap["rewardValueList"][0]), 20)
70
+ score = max(100, score - points)
71
+ else:
72
+ # Select a bonus item
73
+ bonus_item = next(
74
+ (item for item in item_settings if item["type"] == "BONUS"), None
75
+ )
76
+ if bonus_item:
77
+ item_type = 2
78
+ item_size = bonus_item["size"]
79
+ points = min(bonus_item["rewardValueList"][0], 15)
80
+ score = min(score + points, 200)
81
+
82
+ # Create event data string
83
+ event_data = f"{current_time}|{hook_pos_x}|{hook_pos_y}|{hook_shot_angle}|{hook_hit_x}|{hook_hit_y}|{item_type}|{item_size}|{points}"
84
+ game_events.append(event_data)
85
+
86
+ payload = ";".join(game_events)
87
+ encrypted_payload = encrypt(payload, game_tag.encode("utf-8"))
88
+
89
+ return encrypted_payload, score
core/game.py ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import time
3
+ import threading
4
+
5
+ from orrnob_drops_automation import base
6
+ from core.headers import headers
7
+ from core.info import get_info
8
+ from core.combination import get_game_data
9
+
10
+
11
+ def start_game(token, proxies=None):
12
+ url = "https://www.binance.com/bapi/growth/v1/friendly/growth-paas/mini-app-activity/third-party/game/start"
13
+ payload = {"resourceId": 2056}
14
+
15
+ try:
16
+ response = requests.post(
17
+ url=url,
18
+ headers=headers(token=token),
19
+ json=payload,
20
+ proxies=proxies,
21
+ timeout=20,
22
+ )
23
+ data = response.json()
24
+ return data
25
+ except Exception as e:
26
+ base.log(f"{base.white}Error starting game: {e}")
27
+ return None
28
+
29
+
30
+ def complete_game(token, payload, point, proxies=None):
31
+ url = "https://www.binance.com/bapi/growth/v1/friendly/growth-paas/mini-app-activity/third-party/game/complete"
32
+ payload = {
33
+ "resourceId": 2056,
34
+ "payload": payload,
35
+ "log": point,
36
+ }
37
+
38
+ try:
39
+ response = requests.post(
40
+ url=url,
41
+ headers=headers(token=token),
42
+ json=payload,
43
+ proxies=proxies,
44
+ timeout=20,
45
+ )
46
+ data = response.json()
47
+ status = data["success"]
48
+ return status
49
+ except Exception as e:
50
+ base.log(f"{base.white}Error completing game: {e}")
51
+ return None
52
+
53
+
54
+ def loading_animation(seconds):
55
+ animation = "|/-\\"
56
+ for i in range(seconds):
57
+ print(f"\r{base.yellow}Playing... {animation[i % len(animation)]}", end="")
58
+ time.sleep(1)
59
+ print() # Move to the next line after loading
60
+
61
+
62
+ def process_play_game(token, proxies=None):
63
+ while True:
64
+ start_game_data = start_game(token=token, proxies=proxies)
65
+
66
+ if start_game_data is None:
67
+ base.log(f"{base.white}Auto Play Game: {base.red}Failed to start the game")
68
+ break
69
+
70
+ start_game_code = start_game_data.get("code")
71
+
72
+ if start_game_code == "000000":
73
+ payload, point = get_game_data(game_response=start_game_data)
74
+ if payload:
75
+ base.log(f"{base.yellow}Playing for 45 seconds...")
76
+
77
+ # Create and start the loading animation thread
78
+ loading_thread = threading.Thread(target=loading_animation, args=(45,))
79
+ loading_thread.start()
80
+
81
+ # Wait for the game to be played
82
+ time.sleep(45) # Simulating game play time
83
+
84
+ # Wait for the loading animation to finish
85
+ loading_thread.join()
86
+
87
+ complete_game_status = complete_game(
88
+ token=token, payload=payload, point=point, proxies=proxies
89
+ )
90
+ if complete_game_status:
91
+ base.log(f"{base.white}Auto Play Game: {base.green}Success")
92
+ get_info(token=token, proxies=proxies)
93
+ time.sleep(1)
94
+ else:
95
+ base.log(f"{base.white}Auto Play Game: {base.red}Fail")
96
+ break
97
+ else:
98
+ base.log(f"{base.white}Auto Play Game: {base.red}Fail")
99
+ break
100
+ elif start_game_code == "116002":
101
+ base.log(f"{base.white}Auto Play Game: {base.red}No ticket left to play")
102
+ break
103
+ else:
104
+ error_message = start_game_data.get("messageDetail", "Unknown error")
105
+ base.log(f"{base.white}Auto Play Game: {base.red}Error - {error_message}")
106
+ break
core/headers.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ def headers(token=None):
2
+ headers = {
3
+ "Accept": "application/json, text/plain, */*",
4
+ "Origin": "https://www.binance.com",
5
+ "Referer": "https://www.binance.com/en/game/tg/moon-bix",
6
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
7
+ }
8
+ if token:
9
+ headers["X-Growth-Token"] = token
10
+ return headers
core/info.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ from orrnob_drops_automation import base
4
+ from core.headers import headers
5
+
6
+
7
+ def get_info(token, proxies=None):
8
+ url = "https://www.binance.com/bapi/growth/v1/friendly/growth-paas/mini-app-activity/third-party/user/user-info"
9
+ payload = {"resourceId": 2056}
10
+
11
+ try:
12
+ response = requests.post(
13
+ url=url,
14
+ headers=headers(token=token),
15
+ json=payload,
16
+ proxies=proxies,
17
+ timeout=20,
18
+ )
19
+ data = response.json()
20
+ total_grade = data["data"]["metaInfo"]["totalGrade"]
21
+ total_ref_grade = data["data"]["metaInfo"]["referralTotalGrade"]
22
+ if total_ref_grade:
23
+ balance = total_grade + total_ref_grade
24
+ else:
25
+ balance = total_grade
26
+ total_attempts = data["data"]["metaInfo"]["totalAttempts"]
27
+ consumed_attempts = data["data"]["metaInfo"]["consumedAttempts"]
28
+ attempts_left = total_attempts - consumed_attempts
29
+ is_countdown = data["data"]["metaInfo"]["attemptRefreshCountDownTime"]
30
+
31
+ base.log(
32
+ f"{base.green}Balance: {base.white}{balance:,} - {base.green}Tickets Left: {base.white}{attempts_left}"
33
+ )
34
+
35
+ return attempts_left, is_countdown
36
+ except:
37
+ return None, None
core/token.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ from orrnob_drops_automation import base
4
+ from core.headers import headers
5
+
6
+
7
+ def get_token(data, proxies=None):
8
+ url = "https://www.binance.com/bapi/growth/v1/friendly/growth-paas/third-party/access/accessToken"
9
+ payload = {"queryString": data, "socialType": "telegram"}
10
+
11
+ try:
12
+ response = requests.post(
13
+ url=url, headers=headers(), json=payload, proxies=proxies, timeout=20
14
+ )
15
+ data = response.json()
16
+ token = data["data"]["accessToken"]
17
+ return token
18
+ except:
19
+ return None
data-proxy.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "accounts": [
3
+ {
4
+ "acc_info": "",
5
+ "proxy_info": "http://user:pass@ip:port"
6
+ },
7
+ {
8
+ "acc_info": "",
9
+ "proxy_info": "http://user:pass@ip:port"
10
+ }
11
+ ]
12
+ }
data.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ query data here
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ orrnob-drops-automation==0.1.6
2
+ pycryptodome