minecraftpi吧 关注:1,503贴子:2,564
  • 1回复贴,共1

[新人]python脚本方块扫描器

只看楼主收藏回复


这个吧人好少,感觉有很多大佬


IP属地:湖南1楼2022-02-13 11:45回复
    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 ("扫描结束")


    IP属地:湖南4楼2022-04-30 13:04
    回复