黑松山资源网 Design By www.paidiu.com
本文实例为大家分享了php微信跳一跳的具体代码,供大家参考,具体内容如下
<"#%05d: ", $id); // 截图 screencap(); // 获取坐标 $image = imagecreatefrompng('screen.png'); list($sx, $sy) = getStart(); list($tx, $ty) = getEnd(); if ($sx == 0) break; echo sprintf("(%d, %d) -> (%d, %d) ", $sx, $sy, $tx, $ty); // 图像描点 imagefilledellipse($image, $sy, $sx, 10, 10, 0xFF0000); imagefilledellipse($image, $ty, $tx, 10, 10, 0xFF0000); imagepng($image, sprintf("screen/%05d.png", $id)); // 计算按压时间 $time = pow(pow($tx - $sx, 2) + pow($ty - $sy, 2), 0.425) * PRESS_TIME; $time = round($time); echo sprintf("time: %f\n", $time); press($time); // 等待下一次截图 sleep(SLEEP_TIME); }
<"htmlcode">function jump() { sleep(2.5);//延迟 2.5 秒,音乐盒、便利店、井盖等站 2 秒加分 $screenShell = "cd D:\&adb shell /system/bin/screencap -p /sdcard/screenshot.png&adb pull /sdcard/screenshot.png d:jumper/screenshot.png"; exec($screenShell);//截图 $i=imagecreatefrompng("d:jumper/screenshot.png");//读取图片 $point=array(); for ($y=400;$y<imagesy($i);$y++) {//从第 400 行开始,避开上部内容 for ($x=0;$x<imagesx($i);$x++) {//横向扫描 $rgb = imagecolorat($i,$x,$y);//取得颜色 $point["now"]["r"] = ($rgb16) & 0xFF; $point["now"]["g"] = ($rgb8) & 0xFF; $point["now"]["b"] = $rgb & 0xFF; if(isset($point["last"]["r"])){ if(!isset($point["x"]["a"])){ if( abs($point["now"]["r"]-$point["last"]["r"])>1 or abs($point["now"]["g"]-$point["last"]["g"])>1 or abs($point["now"]["b"]-$point["last"]["b"])>1 ){ $point["x"]["a"]=$x; if(imagesx($i)/2>$x){ $point["direction"]="left"; }else{ $point["direction"]="right"; } $point["a"]=$point["last"]; } }else{ if($point["now"]==$point["a"]){ $point["x"]["b"]=$x-1; break; } } } $point["last"]=$point["now"]; } if(isset($point["x"])){ break; } } $param["left"] = 3750; $param["right"] = 3100; $time = pow((abs(imagesx($i)/2-($point["x"]["a"]+$point["x"]["a"])/2)/imagesx($i)),1)*$param[$point["direction"]]; if($time<400){ $time+=($param[$point["direction"]]/300); } $time = round($time,0); echo "direction:".$point["direction"]; echo "\nx.a:".$point["x"]["a"]; echo "\nx.b:".$point["x"]["b"]; echo "\ntime:".$time."\n"; $touchShell = "cd D:\&adb shell input swipe 50 250 250 250 ".$time; exec($touchShell); imagedestroy($i); jump(); } jump();更多内容大家可以参考专题《微信跳一跳》进行学习。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
更新日志
2025年03月05日
2025年03月05日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]