Krenair

MCPBotAutoCommandSend.py

Mar 7th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import socket
  2. import time
  3. import sys
  4.  
  5. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  6. s.connect(('ocean-labs.de', 34132))
  7.  
  8. for command in open('cmds').read().splitlines():
  9.     s.send(command + '\r\n')
  10.     print command
  11.     time.sleep(2)
  12.  
  13. try:
  14.     while True:
  15.         sys.stdout.write(s.recv(1))
  16. except KeyboardInterrupt:
  17.     pass
  18.  
  19. s.close()
Advertisement
Add Comment
Please, Sign In to add comment