from mcpi import minecraft
import _thread
import time
mc = minecraft.Minecraft.create()
pos = mc.player.getPos()
id = float(input('输入你要寻找的方块id:'))
print ('扫描中...')
# 为线程定义一个函数
def scan1( delay):
tid = id
x,y,z = 0,-63,0
while True:
bid = mc.getBlock(pos.x + x ,y ,pos.z + z)
if bid == tid:
print("线程1号:", pos.x + x ,y ,pos.z + z)
if x < 16 and x >= 0:
x = x +1
elif x == 16:
x = -1
elif x < 0 and x > -16:
x = x - 1
elif x == -16:
x, y = 0, y + 1
if y == 10 and z <= 16:
x, y ,z = 0, -63 ,z + 1
elif y == 10 and z == 17:
exit()
def scan2( delay):
tid = id
x,y,z = 0,-63,-1
while True:
bid = mc.getBlock(pos.x + x ,y ,pos.z + z)
if bid == tid:
print("线程2号:", pos.x + x ,y ,pos.z + z)
if x < 16 and x >= 0:
x = x +1
elif x == 16:
x = -1
elif x < 0 and x > -16:
x = x - 1
elif x == -16:
x, y = 0, y + 1
if y == 10 and z >= -16:
x, y ,z = 0, -63 ,z - 1
elif y == 10 and z == -17:
exit()
try:
_thread.start_new_thread( scan1, (2, ) )
_thread.start_new_thread( scan2 ( 4, ) )
except:
print ("扫描结束")
import _thread
import time
mc = minecraft.Minecraft.create()
pos = mc.player.getPos()
id = float(input('输入你要寻找的方块id:'))
print ('扫描中...')
# 为线程定义一个函数
def scan1( delay):
tid = id
x,y,z = 0,-63,0
while True:
bid = mc.getBlock(pos.x + x ,y ,pos.z + z)
if bid == tid:
print("线程1号:", pos.x + x ,y ,pos.z + z)
if x < 16 and x >= 0:
x = x +1
elif x == 16:
x = -1
elif x < 0 and x > -16:
x = x - 1
elif x == -16:
x, y = 0, y + 1
if y == 10 and z <= 16:
x, y ,z = 0, -63 ,z + 1
elif y == 10 and z == 17:
exit()
def scan2( delay):
tid = id
x,y,z = 0,-63,-1
while True:
bid = mc.getBlock(pos.x + x ,y ,pos.z + z)
if bid == tid:
print("线程2号:", pos.x + x ,y ,pos.z + z)
if x < 16 and x >= 0:
x = x +1
elif x == 16:
x = -1
elif x < 0 and x > -16:
x = x - 1
elif x == -16:
x, y = 0, y + 1
if y == 10 and z >= -16:
x, y ,z = 0, -63 ,z - 1
elif y == 10 and z == -17:
exit()
try:
_thread.start_new_thread( scan1, (2, ) )
_thread.start_new_thread( scan2 ( 4, ) )
except:
print ("扫描结束")