Compare commits

..

No commits in common. "3c31c41acd08f6f28e4bc019f7bdd7e3ec063d7f" and "6315f8c309f3fdf32c278328d2ed2d1ecdfe8bda" have entirely different histories.

3 changed files with 5 additions and 25 deletions

18
main.py
View File

@ -91,22 +91,14 @@ def main():
observer.stop() observer.stop()
observer.join() observer.join()
def run_api():
if __name__ == '__main__':
host = '0.0.0.0' host = '0.0.0.0'
port = 3300 port = 3300
while True: threading.Thread(target=app.run, kwargs={'host': host, 'port': port}).start()
print('Trying to run web interface on port:', port) print('Web interface listening on port:', port)
print('If it works, go to http://localhost:' + str(port)) print('Try going to http://localhost:' + str(port))
try:
app.run(host=host, port=port)
except OSError:
print()
print('Error: Port already taken.')
port += 1
if __name__ == '__main__':
threading.Thread(target=run_api).start()
time.sleep(1) time.sleep(1)
main() main()

View File

@ -272,12 +272,6 @@ def bot(global_state):
elif EMAIL: elif EMAIL:
print('No password provided, attempting to connect in offline mode...') print('No password provided, attempting to connect in offline mode...')
g.connection = Connection(SERVER, PORT, username=EMAIL) g.connection = Connection(SERVER, PORT, username=EMAIL)
elif PASSWORD:
print('')
print('Did you forget to specify an email?')
print('If you want to use your own account:')
print('EMAIL=you@domain.com PASSWORD=supersecret SERVER=minecraft.example.com ./run_linux.sh')
os._exit(0)
else: else:
print('No username or password provided, using burner minecraft account...') print('No username or password provided, using burner minecraft account...')
EMAIL = 'moc.liamg@monortem'[::-1] EMAIL = 'moc.liamg@monortem'[::-1]

View File

@ -50,9 +50,6 @@ class Commands:
if prefix == bot_num: if prefix == bot_num:
for_me = True for_me = True
if data.startswith('[') and data.endswith(']'):
command = 'nosquarebrackets'
try: try:
@ -84,9 +81,6 @@ class Commands:
if command == 'echo' and data: if command == 'echo' and data:
reply = data reply = data
if command == 'nosquarebrackets':
reply = 'don\'t literally put the [ ]'
## !pos - replies with position and dimension ## !pos - replies with position and dimension
if command == 'pos': if command == 'pos':
reply = str(utils.pint(self.g.pos))[1:-1] + ', ' + self.g.dimension reply = str(utils.pint(self.g.pos))[1:-1] + ', ' + self.g.dimension