废话不多说.上代码.
wd = [ "6666666", "看着不错", "大家好", "主播声音挺好听啊", "不错,已回购", "已经拍了,速度发货啊", "已拍,主播速度发货", "确实可以,支持下", "送个小心心鼓励下", "味道不错,买过两次了" ]; ch = [ " "," "," "," "," ","~","!",",",".","。",",","~" ]; str = "说点什么"; str2 = "聊一聊"; a1 = textContains("说点什么").findOne(3000); if( !a1 ){ str = str2; } while( true ){ a1 = textContains( str ).findOne(3000); if( a1 ){ ab = a1.bounds(); click( ab.centerX(), ab.centerY() ); sleep(1000); a2 = textContains( str ).findOne(3000); if( a2 ){ word = wd[ Math.round( Math.random()*wd.length ) ];//取话术 word = word + ch[ Math.round(Math.random()*ch.length) ].repeat( Math.round(Math.random()*3) ); a2.setText( word ); sleep(2000); a3 = text("发送").findOne(3000); if( a3 ){ ab3 = a3.bounds(); click( ab3.centerX(), ab3.centerY() ); } } }else{ alert("中止,找不到元素!"); break; } sleep( 10 * 1000 ); }
简单吧,
最下面 sleep( 10 * 1000 ); 这里,是代表.10秒钟.说一句话.
发表评论