Need help writing while loop

Hello all!

I’m trying to loop through this to when the Command_commands shows ‘G4N3F’, I need to write to BP2_Has_Cook.

if Has_Command < 1:
system.tag.write(“AGCs/AGC2/To_Cart/Command_commands”, ‘DG4N3F’)
system.tag.write(“AGCs/AGC2/To_Cart/Command_distances”, ‘113,14,127,157’)
system.tag.write(“AGCs/AGC2/To_Cart/Command_rfids”, rfid_35+","+rfid_36+","+rfid_30+","+rfid_8)
system.tag.write(“AGCs/AGC2/Status/JustLoaded”, 0)
system.tag.write(“Backpacks/BP2_Has_Cook”, 1)
else:
pass

Thank you!