This repository was archived by the owner on Aug 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFYSCv1.2.py
More file actions
297 lines (264 loc) · 9.52 KB
/
Copy pathFYSCv1.2.py
File metadata and controls
297 lines (264 loc) · 9.52 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# PYFYSCV1.3AUG2
# -------IMPORTING-------
import time
import random
import threading
import pickle
import os
import sys
# -------DATABASE-------
base_path = os.getcwd()
file_name = "data/mydata.txt"
file_name2 = "data/mydata2.txt"
file_name3 = "data/mydata3.txt"
Udatafile_name1 = "data/Udata1.txt"
Udatafile_name2 = "data/Udata2.txt"
Udatafile_name3 = "data/Udata3.txt"
fyscdollarfile = "data/fyscdollar.txt"
full_path = os.path.join(base_path, file_name)
full_path2 = os.path.join(base_path, file_name2)
full_path3 = os.path.join(base_path, file_name3)
Upath1 = os.path.join(base_path, Udatafile_name1)
Upath2 = os.path.join(base_path, Udatafile_name2)
Upath3 = os.path.join(base_path, Udatafile_name3)
Upath4 = os.path.join(base_path, fyscdollarfile)
file_path = r"%s"%(full_path)
print(full_path)
file_path2 = r"%s"%(full_path2)
print(full_path2)
file_path3 = r"%s"%(full_path3)
print(full_path3)
Upath1 = r"%s"%(Upath1)
Upath2 = r"%s"%(Upath2)
Upath3 = r"%s"%(Upath3)
Upath4 = r"%s"%(Upath4)
# -------VARIABLE SETUP-------
U1boost = 1
U1cost = 100
tupU1 = 0
U2num = 0 # no save for now
U2str = 'coming soon' # no save for now
U2cost = 0 # no save for now
fyscdollar = 0
subs = 0
growth = 0
repeat = 0
ctime = 0
# for update use (reset all data)
"""with open(file_path, "wb") as f:
pickle.dump(subs, f, pickle.HIGHEST_PROTOCOL)
with open(file_path2, "wb") as f:
pickle.dump(growth, f, pickle.HIGHEST_PROTOCOL)
with open(file_path3, "wb") as f:
pickle.dump(ctime, f, pickle.HIGHEST_PROTOCOL)
with open(Upath1, "wb") as f:
pickle.dump(U1boost, f, pickle.HIGHEST_PROTOCOL)
with open(Upath2, "wb") as f:
pickle.dump(U1cost, f, pickle.HIGHEST_PROTOCOL)
with open(Upath3, "wb") as f:
pickle.dump(tupU1, f, pickle.HIGHEST_PROTOCOL)
with open(Upath4, "wb") as f:
pickle.dump(fyscdollar, f, pickle.HIGHEST_PROTOCOL)"""
# -------CLEAN SCREEN-------
def clear_screen_ansi():
print("\033[H\033[2J", end="")
# -------LOAD DATA-------
with open(file_path, "rb") as f:
subs = pickle.load(f)
print('loaded', subs,)
subs = float(subs)
with open(file_path2, "rb") as f:
growth = pickle.load(f)
print('loaded', growth,)
growth = float(growth)
with open(file_path3, "rb") as f:
ctime = pickle.load(f)
print('loaded', ctime,)
with open(Upath1, "rb") as f:
U1boost = pickle.load(f)
print('loaded', U1boost,)
U1boost = float(U1boost)
with open(Upath2, "rb") as f:
U1boost = pickle.load(f)
print('loaded', U1cost,)
U1cost = int(U1cost)
with open(Upath3, "rb") as f:
U1boost = pickle.load(f)
print('loaded', tupU1,)
tupU1 = int(tupU1)
with open(Upath4, "rb") as f:
U1boost = pickle.load(f)
print('loaded', fyscdollar,)
fyscdollar = float(fyscdollar)
if ctime == 0:
ctime = time.time()
otime = time.time()
offlinetime = int(otime - ctime)
print('total offline time:', offlinetime, 'seconds')
while repeat < offlinetime / 2:
print(f"\rProcessing item {repeat} of {offlinetime / 2}...", end="")
subs += growth / 50000
fyscdollar += growth / 50000 / 100
growth -= growth / 50000
repeat += 1
print("\nDone!")
print('subs now:', subs)
ttime = time.time()
print('total time used to cal:', (ttime - otime) * 1000, 'ms')
clear_screen_ansi()
print('Welcome to Python FYSC v1.3. type "help" if you need help. type "cmd" if you dont know the command.')
def growths():
while True:
global subs
global growth
global fyscdollar
global ctime
time.sleep(2)
subs += growth / 50000
fyscdollar += growth / 50000 / 100
growth -= growth / 50000
ctime = time.time()
with open(file_path, "wb") as f:
pickle.dump(subs, f, pickle.HIGHEST_PROTOCOL)
with open(file_path2, "wb") as f:
pickle.dump(growth, f, pickle.HIGHEST_PROTOCOL)
with open(file_path3, "wb") as f:
pickle.dump(ctime, f, pickle.HIGHEST_PROTOCOL)
def savedata():
while True:
global U1boost
global U1cost
global tupU1
global fyscdollar
time.sleep(2)
with open(Upath1, "wb") as f:
pickle.dump(U1boost, f, pickle.HIGHEST_PROTOCOL)
with open(Upath2, "wb") as f:
pickle.dump(U1cost, f, pickle.HIGHEST_PROTOCOL)
with open(Upath3, "wb") as f:
pickle.dump(tupU1, f, pickle.HIGHEST_PROTOCOL)
with open(Upath4, "wb") as f:
pickle.dump(fyscdollar, f, pickle.HIGHEST_PROTOCOL)
threadgrowth = threading.Thread(target=growths)
threadgrowth.daemon = True
threadgrowth.start()
savedata = threading.Thread(target=savedata)
savedata.daemon = True
savedata.start()
while True:
command = input('Enter Command: ')
if command == 'video':
randomnum = random.randrange(1,5)
if randomnum == random.randrange(1,5):
randomgrowth = random.randrange(200, 1200) * U1boost
growth += randomgrowth
print('wow! you put good effort on your video and end up getting %d growth!'%(randomgrowth))
else:
randomgrowth = random.randrange(60, 300) * U1boost
growth += randomgrowth
print('you put some effort on your video. end up getting %d growth.'%(randomgrowth))
elif command == 'short' and subs >= 1000:
randomnum = random.randrange(1,5)
if randomnum == random.randrange(1,5):
randomgrowth = random.randrange(300, 2000) * U1boost
growth += randomgrowth
print('wow! you put good effort on your short and end up getting %d growth!'%(randomgrowth))
else:
randomgrowth = random.randrange(75, 600) * U1boost
growth += randomgrowth
print('you put some effort on your short. end up getting %d growth.'%(randomgrowth))
elif command == 'short' and subs <= 1000:
print("you haven't reached the requirement for you to upload shorts. type the command milestone to learn more.")
elif command == 'help':
print('This is Python FYSC. A new stage of FYSC. In there, you can gain subscribers by typing "video" or "short" in the command panel. In the future, we will expect upgrades added to this FYSC!')
elif command == 'cmd':
print("""Commands:
video / short: upload a video onto the FYSC to gain subs.
help: get help. cmd: get the list of commands.
end: help you save the data and tell you to press the x button.
stats: get your stats.
milestone: see milestone.
upgrade: see upgrades (10000 subs required)""")
elif command == 'stats':
print("""
your subs is %d.
your growth is %d.
"""%(subs, growth))
elif command == 'end':
print('saving...')
ctime = time.time()
with open(file_path, "wb") as f:
pickle.dump(subs, f, pickle.HIGHEST_PROTOCOL)
print('saved', subs)
with open(file_path2, "wb") as f:
pickle.dump(growth, f, pickle.HIGHEST_PROTOCOL)
print('saved', growth)
with open(file_path3, "wb") as f:
pickle.dump(ctime, f, pickle.HIGHEST_PROTOCOL)
print('saved', ctime)
print('Ending...')
sys.exit(0)
print('END FAILED')
elif command == 'milestone':
if subs >= 1000:
milestone1 = int(0)
eta1 = str(0)
else:
milestone1 = 1000 - subs
eta1 = milestone1 /(growth / 50000 / 2)
if subs > 10000:
milestone2 = int(0)
eta2 = str(0)
else:
milestone2 = 10000 - subs
eta2 = milestone2 /(growth / 50000 / 2)
if subs > 1000000:
milestone3 = int(0)
eta3 = str(0)
else:
milestone3 = 1000000 - subs
eta3 = milestone3 /(growth / 50000 / 2)
print("""
Milestone (subs left for milestone)
1,000 subs(requirement for shorts): %d ETA: %s seconds
10,000 subs(requirement for upgrades): %d ETA: %s seconds
1,000,000 subs: %d ETA: %s seconds"""%(milestone1,eta1, milestone2,eta2, milestone3, eta3))
elif command == 'upgrade' and subs >= 10000:
ucommand = input("""
Upgrade Shop
FYSC Dollars: %d
U1: Better Video and Short: gain more growth on them. Current boost: %d
Cost: %d
Command to buy: buyU1
U2: Worker: worker help you upload video while you are offline. upload every %d %s
Cost: %d
Command to buy: COMING SOON
Type Upgrade Command Here: """%(fyscdollar, U1boost, U1cost, U2num, U2str, U2cost))
if ucommand == 'buyU1':
buyU1cal = U1cost
print(buyU1cal)
cal = fyscdollar
print(cal)
maxbuyU1 = 0
if U1cost < cal:
while cal > 0:
cal -= buyU1cal
buyU1cal *= 1.05
maxbuyU1 += 1
maxbuyU1 -= 1
utobuy1 = input("how many upgrades to buy? max is %d. Type number here: "%(maxbuyU1))
utobuy1 = int(utobuy1)
if isinstance(utobuy1, int) == True:
print(isinstance(utobuy1, int))
if utobuy1 <= maxbuyU1:
print('doing it')
repeat2 = 0
while utobuy1 > repeat2:
repeat2 += 1
fyscdollar -= U1cost
U1cost *= 1.05
U1boost += 0.1
tupU1 += 1
print("you have now %d upgrades. You have %d fysc dollar now."%(tupU1, fyscdollar))
elif command == 'upgrade' and subs <= 10000:
print("you didn't meet the requirement to go to the upgrade shop.")