Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. __author__ = 'mac12841'
  2. from mcstatus import MinecraftServer
  3. import random
  4. import threading
  5.  
  6. pw = open('servers.txt','a')
  7. class MyThread(threading.Thread):
  8. def run (self):
  9. while 1:
  10. ip = ".".join(map(str, (random.randint(0, 255)
  11. for i in range(4))))
  12. try:
  13. server = MinecraftServer.lookup(str(ip))
  14. status = server.status()
  15. pw.write("The minecraft server has {0} players and replied in {1} ms IP {3} \n".format(status.players.online, status.latency,str(ip)))
  16. print("The minecraft server has {0} players and replied in {1} ms IP {3} \n".format(status.players.online, status.latency,str(ip)))
  17. except Exception as e:
  18. print(e,str(ip))
  19.  
  20. for x in range(50):
  21. MyThread().start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement