while (true) {
            if (className("自改").exists()) {
                if (textContains(")").id("自改").findOne()) {
                    className("自改").id("自改").find().each(
                        function(obj) {
                            try {
                                if (obj.children().get(1).children().get(0).children().get(1).childCount() == 1) {
                                    if (obj.children().get(1).children().get(0).children().get(1).children().length == 1) {
                                        obj.click()
                                        threads.start(function() {
                                            desc("开").findOne().click()
                                        })
                                        sl=sl+1
                                        log("一共抢到了:"+sl+"个")
                                        sleep(3000)
                                        back()
                                    }
                                } else {
                                    

                                }
                            } catch (err) {
                                
                            }
                        }
                    )
                }
            }
        }
    });

仅供大家参考和修改
成品大家自己制作吧
(教程学技术的应该能看懂)