-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC-Bos.py
230 lines (195 loc) · 7.79 KB
/
C-Bos.py
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
from lib import cboslib
from lib.cboslib import version
import time
import requests
import colorama
import sys
import random
import pwinput
import runpy
cboslib.settitle("C-Bos")
cboslib.cprint("Booting cbos the crappy os...")
time.sleep(0.5)
cboslib.cprint("Checking for updates...")
try:
cboslib.cprint(cboslib.versioncheck(version).available)
except:
cboslib.cprint("Version check failed. Please check your internet connection.")
time.sleep(0.3)
cboslib.cprint("Done!")
time.sleep(0.3)
cboslib.cprint("Welcome to cbos! Type \"help\" for a list of commands!")
time.sleep(0.3)
adminyay = input(cboslib.randomstringcolor("Are you an admin? [Y/N]: ")).lower()
if(adminyay == "y"):
admincode = pwinput.pwinput(prompt=cboslib.randomstringcolor("Put in the admin code: "))
cboslib.cprint("Authenticating...")
isadmin = cboslib.adminauth(admincode)
if(isadmin == True):
cboslib.cprint("Admin code is correct!")
else:
cboslib.cprint("Admin code not correct.")
else:
cboslib.cprint("Not an admin...")
isadmin = False
time.sleep(0.3)
cmdloop = True
while cmdloop:
cmd = input(colorama.Fore.GREEN + "> " + colorama.Fore.RESET)
lowercmd = cmd.lower()
if(lowercmd == "run test"):
print("Its workin!")
elif(lowercmd == "shut down" or lowercmd == "exit"):
print("Shutting down...")
time.sleep(0.5)
sys.exit()
elif(lowercmd == "help"):
cboslib.cprint("1: Run test (it was in the original so I put it here idk)")
time.sleep(0.1)
cboslib.cprint("2: Exit (exits the program wowie)")
time.sleep(0.1)
cboslib.cprint("3: Base64 encode (encodes text)")
time.sleep(0.1)
cboslib.cprint("4: Base64 decode (decodes text)")
time.sleep(0.1)
cboslib.cprint("5: Check version (checks for updates)")
time.sleep(0.1)
cboslib.cprint("6: Credits (Shows credits and some other stuff)")
time.sleep(0.1)
cboslib.cprint("7: Get server text (Shows the text of a txt file on the server)")
time.sleep(0.1)
cboslib.cprint("8: Edit server text (Edits a txt on the server)")
time.sleep(0.1)
cboslib.cprint("9: Luck game (A little game about luck)")
time.sleep(0.1)
cboslib.cprint("10: Ghost story (Tells a random ghost story)")
time.sleep(0.1)
cboslib.cprint("11: How to add a command (Shows a guide on how to add a command)")
time.sleep(0.1)
cboslib.cprint("12: Hello (says hi to you)")
time.sleep(0.1)
cboslib.cprint("13: Magic eight ball (let cbos decide your fate)")
time.sleep(0.1)
cboslib.cprint("14: Gui (An optional gui for cbos. Won't have all cbos features.)")
time.sleep(0.1)
cboslib.cprint("15: Exit! (Exit command but instant)")
time.sleep(0.1)
cboslib.cprint("16: Exit? (Joke command. Don't take this seriously.)")
elif(lowercmd == "base64 encode"):
bumhole = cboslib.base64encode(input("String: "))
print(bumhole)
print("")
time.sleep(1)
cboslib.cprint("Btw if you want check out my base64 tool made in kotlin")
cboslib.cprint("https://github.com/Thepuppetqueen57/Basket")
elif(lowercmd == "base64 decode"):
bum = cboslib.base64decode(input("Encoded string: "))
print(bum)
print("")
time.sleep(1)
cboslib.cprint("Btw if you want check out my base64 tool made in kotlin")
cboslib.cprint("https://github.com/Thepuppetqueen57/Basket")
elif(lowercmd == "check version"):
cboslib.cprint(cboslib.versioncheck(version).available)
elif(lowercmd == "credits"):
print("Puppet: https://thepuppet57.alwaysdata.net")
print("Dexter (theuntrueone): Dizzy5g on discord")
print("Cj: http://butteredtoast.141412.xyz")
print("C-Bos legacy: https://github.com/Thepuppetqueen57/C-Bos-Legacy")
elif(lowercmd == "get server text"):
cboslib.getservertext()
elif(lowercmd == "edit server text"):
boobiehahahaha = input("New text: ")
cboslib.editservertext(boobiehahahaha)
elif(lowercmd == "luck game"):
cboslib.cprint("Type help for what you can do")
kys = input(cboslib.randomstringcolor("What do you want to do: ")).lower()
if(kys == "play"):
gonnabeatyou = 0
score = 0
while gonnabeatyou != 10:
score += 1
gonnabeatyou = random.randint(1, 10)
cboslib.cprint(f"You score is: {score}")
time.sleep(0.05)
highscore = cboslib.gethighscore()
if(score > highscore):
cboslib.updatehighscore(score)
elif(kys == "high score"):
highscore = cboslib.gethighscore()
print(f"Your high score is {highscore}!")
elif(kys == "help"):
cboslib.cprint("The cbos luck game is a game where it generates a random number from 1 to 10")
cboslib.cprint("It repeats this until the number is 10")
cboslib.cprint("Every time it repeats your score goes up")
cboslib.cprint("Try to get the highest score!")
time.sleep(1)
cboslib.cprint("Now here is a list of commands. There is only 1 rn.")
time.sleep(0.3)
cboslib.cprint("1: Play (plays the game)")
time.sleep(0.1)
cboslib.cprint("2: High score (Shows you your high score)")
elif(lowercmd == "ghost story"):
cboslib.randomghoststory()
elif(lowercmd == "how to add a command"):
cboslib.cprint("Open cbos.py with vs code")
time.sleep(0.5)
cboslib.cprint("And right below the bottom elif add another elif")
time.sleep(0.5)
cboslib.cprint("Example: elif(lowercmd == \"this is whatever you want the command to be\"): code to run")
time.sleep(0.5)
cboslib.cprint("You can probably figure out how to make a function in cboslib.py and if not tell me to add a guide for that")
time.sleep(0.5)
elif(lowercmd == "hello"):
cboslib.cprintnnl("h")
time.sleep(0.1)
cboslib.cprintnnl("e")
time.sleep(0.1)
cboslib.cprintnnl("l")
time.sleep(0.1)
cboslib.cprintnnl("l")
time.sleep(0.1)
cboslib.cprintnnl("o")
time.sleep(0.1)
print("")
elif(lowercmd == "magic eight ball"):
question = input("Whats your question bro: ")
print("Lemme think bro")
time.sleep(1)
print(cboslib.magicball())
elif(lowercmd == "gui"):
cboslib.cprint("Gui opened!")
runpy.run_path("lib/gui.py")
cboslib.cprint("Gui closed!")
elif(lowercmd == "exit!"):
sys.exit()
elif(lowercmd == "exit?"):
cboslib.cprint("oh hi")
time.sleep(3)
cboslib.cprint("I see you want to exit cbos. Why?")
time.sleep(5)
cboslib.cprint("Well go on. Speak.")
time.sleep(3)
cboslib.cprint("Okay are you mute or deaf?")
time.sleep(3)
cboslib.cprint("ANSWER ME")
time.sleep(3)
cboslib.cprint("Screw you I'm kicking you out of cbos")
time.sleep(1)
sys.exit()
elif(isadmin):
# The home of admin commands.
if(lowercmd == "admin help"):
print("there are currently no admin commands because I have no ideas for any at the moment")
else:
dumberror = cboslib.getdumberror()
if(dumberror == True):
print(f"{cmd} is stupid! try again!")
else:
print(f"{cmd} is an invalid command. Please try again!")
else:
dumberror = cboslib.getdumberror()
if(dumberror == True):
print(f"{cmd} is stupid! try again!")
else:
print(f"{cmd} is an invalid command. Please try again!")