else: sessionid = None if (options.server != ""): serverAddress = options.server else: serverAddress = raw_input("Enter host and port if any: ") if ':' in serverAddress: StuffEnteredIntoBox = serverAddress.split(":") host = StuffEnteredIntoBox[0] port = int(StuffEnteredIntoBox[1]) else: host = serverAddress port = 25565 connection = NetworkManager.ServerConnection(pluginLoader, user, sessionid, host, port, options) connection.setDaemon(True) connection.start() while True: try: chat_input = raw_input() if (connection.isConnected): PacketSenderManager.send03(connection.grabSocket(), chat_input.decode('utf-8')[:100]) else: pass except KeyboardInterrupt, e: connection.disconnect() pluginLoader.disablePlugins() sys.exit(1)
sys.exit(1) sessionid = loginResponse['SessionID'] user = loginResponse['Username'] print "Logged in as " + loginResponse['Username'] + "! Your session id is: " + sessionid else: sessionid = None if(options.server != ""): serverAddress = options.server else: serverAddress = raw_input("Enter host and port if any: ") if ':' in serverAddress: StuffEnteredIntoBox = serverAddress.split(":") host = StuffEnteredIntoBox[0] port = int(StuffEnteredIntoBox[1]) else: host = serverAddress port = 25565 connection = NetworkManager.ServerConnection(user, sessionid, host, port, options) connection.start() while True: try: chat_input = raw_input() if (connection.isConnected): PacketSenderManager.send03(connection.grabSocket(), chat_input) else: pass except KeyboardInterrupt, e: connection.disconnect() sys.exit(1)
def sendChat(socket, message): PacketSenderManager.send03(socket, message)
def breakBlock(seconds, socket, x, y, z, face): PacketSenderManager.send0E(socket, 0, x, y, z, face) time.sleep(seconds) PacketSenderManager.send0E(socket, 2, x, y, z, face)
def swingArm(socket, eid): PacketSenderManager.send12(socket, eid, animation=1)
def selectItem(socket, slot): PacketSenderManager.send10(socket, slot)
def dropItem(socket): PacketSenderManager.send0E(socket, 4, 0, 0, 0, 0)
def placeBlock(socket, x, y, z, direction=0, held=-1, cpx=0, cpy=0, cpz=0): PacketSenderManager.send0F(socket, x, y, z, direction=direction, held=held, cpx=cpx, cpy=cpy, cpz=cpz)
print "Logged in as " + loginResponse['Username'] + "! Your session id is: " + sessionid else: sessionid = None if (options.server != ""): serverAddress = options.server else: serverAddress = raw_input("Enter host and port if any: ") if ':' in serverAddress: StuffEnteredIntoBox = serverAddress.split(":") host = StuffEnteredIntoBox[0] port = int(StuffEnteredIntoBox[1]) else: host = serverAddress port = 25565 connection = NetworkManager.ServerConnection(pluginLoader, user, sessionid, host, port, options) connection.setDaemon(True) connection.start() while True: try: chat_input = raw_input() if (connection.isConnected): PacketSenderManager.send03(connection.grabSocket(), chat_input.decode('utf-8')[:100]) else: pass except KeyboardInterrupt, e: connection.disconnect() pluginLoader.disablePlugins() sys.exit(1)