Created
October 20, 2019 05:40
-
-
Save zhudotexe/ab0027e8eb4a6cb4ddb4ff7c755fc5cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from MeteorClient import MeteorClient | |
UNAME = input("un: ") | |
PWD = input("pwd: ").encode() | |
client = MeteorClient('wss://dicecloud.com/websocket', debug=True) | |
client.connect() | |
print("Connected") | |
while not client.connected: | |
time.sleep(0.1) | |
client.login(UNAME, PWD) | |
print("Logged in") | |
time.sleep(1) # wait until users collection has updated | |
USER_ID = client.find_one('users', selector={'username': UNAME}).get('_id') | |
print("User ID: " + USER_ID) | |
if __name__ == '__main__': | |
# regex: https://github.com/aldeed/meteor-simple-schema/blob/4ead24bcc92e9963dd994c07d275eac144733c3e/simple-schema.js#L551 | |
# ^[23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz]{17}$ | |
client.insert('characters', {'name': 'TODO', 'owner': USER_ID, '_id': 'fieraofthetempest'}) | |
time.sleep(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment