-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
133 lines (117 loc) · 3.74 KB
/
main.py
File metadata and controls
133 lines (117 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from os import name, system
from math import ceil
from colorama import Fore
from time import sleep
class OS:
def __init__(self):
self.on_windows = name == "nt"
def on_start(self):
if self.on_windows:
system("Title SkyBlock Bits Shutdown Timer")
else:
print(Fore.RED + "Please make sure this script is running as root, otherwise the shutdown command can not run automatically.\nStarting in 5 seconds...")
sleep(5)
def clear(self):
if self.on_windows:
system("cls")
else:
system("clear")
def shutdown(self):
if self.on_windows:
system("shutdown -s -t 0")
else:
system("shutdown -h now")
try:
sys = OS()
multipliers = {
1: 1.0,
2: 1.1,
3: 1.2,
4: 1.3,
5: 1.4,
6: 1.6,
7: 1.8,
8: 1.9,
9: 2.0,
10: 2.04,
11: 2.08,
12: 2.12,
13: 2.16,
14: 2.2,
15: 2.22,
16: 2.24,
17: 2.26
}
def clear():
sys.clear()
print(Fore.WHITE + "HYPIXEL SKYBLOCK AFK BITS SHUTDOWN TIMER")
def main():
clear()
sys.on_start()
while True:
try:
bitsleft = abs(int(input(Fore.GREEN + "Enter remaining number of bits you need to AFK for: " + Fore.WHITE)))
break
except ValueError:
print(Fore.RED + "ERROR: Entered number of bits was invalid. Please try again.")
clear()
print(Fore.GREEN + "Select your fame rank.")
print(Fore.CYAN + "(1) New Player")
print("(2) Settler")
print("(3) Citizen")
print("(4) Contributor")
print("(5) Philanthropist")
print("(6) Patron")
print("(7) Famous Player")
print("(8) Attaché")
print("(9) Ambassador")
print("(10) Statesperson")
print("(11) Senator")
print("(12) Dignitary")
print("(13) Councilor")
print("(14) Minister")
print("(15) Premier")
print("(16) Chancellor")
print("(17) Supreme")
while True:
try:
multiplier = int(input(Fore.GREEN + "> " + Fore.WHITE))
if multiplier not in range(1, 18):
raise ValueError
break
except ValueError:
print(Fore.RED + "ERROR: Invalid option. Please try again.")
clear()
timer = ceil(bitsleft / (250 * multipliers.get(multiplier))) * 1800
bitcount = bitsleft
interval = bitscurrent = 0
while timer >= 0:
timer -= 1
interval += 1
if interval >= 1800:
offset = int((250 * multipliers.get(multiplier)))
bitcount -= offset
bitscurrent += offset
interval = 0
clear()
print(f"{ Fore.CYAN }Time remaining to auto-shutdown: { str(timer) } seconds || { format(timer / 60, '.3f') } minutes || { format(timer / 3600, '.3f') } hours.")
print(f"{ Fore.GREEN }Bits collected: { bitscurrent }/{ bitsleft }")
print(f"Bits remaining: { bitcount }")
sleep(1)
clear()
t = 10
try:
while t >= 0:
print(f"{ Fore.RED }Shutdown command running in { t } seconds. CTRL+C to cancel.")
sleep(1)
t -= 1
clear()
except KeyboardInterrupt:
print(Fore.GREEN + "\nShutdown command cancelled." + Fore.RESET)
exit(0)
sys.shutdown()
if __name__ == "__main__":
main()
except KeyboardInterrupt:
print(Fore.RED + "\nProgram terminated." + Fore.RESET)
exit(0)