Hello i have problem with opening backpacks sometimes when bot reopen backpacks bot opens VIP window or skills window and bot can't open a few backpacks only each backpack. I Dont know why? please help me !!!

I use script :
closewindows()

openitem(MainBPname, "back")
wait(1500, 2000)
resizewindows()
wait(1000)
openitem(LootBPname, MainBPname, true)
wait(1500, 2000)
resizewindows()
wait(1000)
openitem(GoldBPname, MainBPname, true)
wait(1500, 2000)
resizewindows()