-
Notifications
You must be signed in to change notification settings - Fork 0
/
lb.py
131 lines (129 loc) · 4.79 KB
/
lb.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
import os
import requests
import subprocess
import time
import socket
def code():
def cls():
os.system('cls' if os.name=='nt' else 'clear')
print("Welcome to LB, also known as LigmaBalls.")
print("For help, type help below.")
command = input("lb < ")
if (command == "fs"):
isstop = "no"
print("Welcome to freakysay, also known as FS.")
while (isstop == "no"):
echo = input("freakysay < ")
print(echo)
if (command == "help"):
print("Welcome to LigmaBalls!")
print("Here are some commands you can use:")
print("fs")
print("Using fs will launch freakysay, so you can echo your words!")
print("clear")
print("Clear clears the terminal!")
print("freakybob")
print("WARNING: FLOODS CONSOLE")
print("This command prints a freakybob ASCII art thingymajig")
print("update")
print("Updates LigmaBalls")
print("greg")
print("Adds Greg Heffley to your desktop")
print("ping")
print("Pings google.com and provides the ping time in ms.")
print("buttcalc")
print("literally just a calculator")
code()
if (command == "clear"):
cls()
code()
if (command == "freakybob"):
print("This requires an additional download of 5.42 KB.")
input("Are you fine with that? Close this if not. ")
url = 'https://github.com/Freakybob-Team/lb/blob/main/freakybob.txt?raw=true'
response = requests.get(url)
file_Path = 'freakybob.txt'
response = requests.get(url)
if response.status_code == 200:
with open(file_Path, 'wb') as file:
file.write(response.content)
print('File downloaded successfully')
fb = open("freakybob.txt", "r")
print(fb.read())
fb.close()
code()
if (command == "update"):
print("This requires an additional download of 569 bytes.")
input("Are you fine with that? Close this if not. ")
url = 'https://github.com/Freakybob-Team/lb/blob/main/update.py?raw=true'
response = requests.get(url)
file_Path = 'update.py'
if response.status_code == 200:
with open(file_Path, 'wb') as file:
file.write(response.content)
print('File downloaded successfully')
exec(open('update.py').read())
else:
print('Failed to download file')
print("Trying another source...")
alturl = 'https://codeberg.org/Freakybob/lb/raw/branch/main/update.py'
response = requests.get(alturl)
file_Path = 'update.py'
with open(file_Path, 'wb') as file:
file.write(response.content)
print('File downloaded successfully')
exec(open('update.py').read())
if (command == "greg"):
url = 'https://github.com/Freakybob-Team/lb/blob/main/greg.bat?raw=true'
response = requests.get(url)
file_Path = 'greg.bat'
if response.status_code == 200:
with open(file_Path, 'wb') as file:
file.write(response.content)
print('File downloaded successfully')
file.close()
subprocess.run(['greg.bat'])
else:
print('Failed to download file')
print("Bringing you back...")
code()
if (command == "ping"):
server = "google.com"
try:
start_time = time.time()
sock = socket.create_connection((server, 80), timeout=2)
end_time = time.time()
sock.close()
delay = (end_time - start_time) * 1000
print(f"Pong! {delay:.2f} ms")
except Exception as e:
print(f"Error connecting to {server}: {e}")
code()
if (command == "quarky"):
print("YOU DUMMY PYTHON 3.8??? THE NEWEST VERSION IS 3.13")
print("AND A PIP VERSION FROM 2021?????")
code()
if (command == "thiscommanddoesnotexist"):
print("Yes it does.")
code()
if (command == "buttcalc"):
num1 = input("First number: ")
num2 = input("Second number: ")
sign = input("Enter the operation thingy (ex: Addition) ")
if (sign == "Addition"):
sum = int(num1) + int(num2)
print(sum)
if (sign == "Multiplication"):
product = int(num1) * int(num2)
print(product)
if (sign == "Subtraction"):
difference = int(num1) - int(num2)
print(difference)
if (sign == "Division"):
quotient = int(num1) / int(num2)
print(quotient)
code()
if (command == "dungeon"):
print("help freakybob has me in his dungeon send help NOW please")
code()
code()