def fctMidas(p1, p2): xp, yp, zp = mc.player.getTilePos() if p1 == True: s = 15 if p1 == False: s = 5 if p2 == True: idb = 57 if p2 == False: idb = 41 Midas.Midascube(xp, yp, zp, s, idb) os('omxplayer -o local Desktop/minecraft/Magic_Wand/songs/Midas.mp3')
button_fct_pressed('button1') button_fct_pressed('button2') button_fct_pressed('button3') button_fct_pressed('button4') button_fct_pressed('button5') # ======================================= # Principal # ======================================= while True: check_buttons_fct() # test every button to know their positions xp, yp, zp = mc.player.getTilePos() if flags['button1'] == True: # 1=True= beeing pressed mc.postToChat("You've pressed button1") # now just for test Mine.Mine(xp, yp, zp, "North", 23) if flags['button2'] == True: # 1=True= beeing pressed mc.postToChat("You've pressed button2") # now just for test Midas.Midascube(xp, yp, zp, 9, 41) if flags['button3'] == True: # 1=True= beeing pressed mc.postToChat("You've pressed button3") # now just for test House.house(xp + 4, yp, zp - 2, 6, 8, 7) if flags['button4'] == True: # 1=True= beeing pressed mc.postToChat("You've pressed button4") # now just for test direction_wool.direction() if flags['button5'] == True: # 1=True= beeing pressed mc.postToChat("You've pressed button5") # now just for test # To see how button are "detected". Attention! Use a time.sleep function if you want to test this on Thonny #print(flags['button1'],flags['button2'],flags['button3'],flags['button4'],flags['button5'])