Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'mac12841'
- from mcstatus import MinecraftServer
- import random
- import threading
- pw = open('servers.txt','a')
- class MyThread(threading.Thread):
- def run (self):
- while 1:
- ip = ".".join(map(str, (random.randint(0, 255)
- for i in range(4))))
- try:
- server = MinecraftServer.lookup(str(ip))
- status = server.status()
- pw.write("The minecraft server has {0} players and replied in {1} ms IP {3} \n".format(status.players.online, status.latency,str(ip)))
- print("The minecraft server has {0} players and replied in {1} ms IP {3} \n".format(status.players.online, status.latency,str(ip)))
- except Exception as e:
- print(e,str(ip))
- for x in range(50):
- MyThread().start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement