Android ADB实现COC夜世界自动打资源

@chcp 65001 >nul
@echo off
:body
for /l %%i  in (1,1,10) do call:night
@REM pause
set /p input=是否继续(Y/N)?
if input=="Y" goto:body
if input=="y" goto:body
goto:eof


:night
@REM start fight x[110,270] y[870,1030]
call:tap 110 870 1
@REM confirm x[1500,270] y[660,1030]
call:tap 1500 660 5
@REM pick hero x[380,270] y[900,1030]
call:tap 380 900 1
@REM click any clearing x[2000,270] y[200,1030]
call:tap 2000 200 1

@REM pick troops x[380,270] y[900,1030]
call:tap 580 900 1
@REM click any clearing x[2000,270] y[200,1030]
call:tap 10 10
call:tap 100 10
call:tap 1000 200
call:tap 2000 200
call:tap 2000 500
call:tap 10 10
call:tap 100 10
call:tap 1000 200
call:tap 2000 200
call:tap 2000 500
@REM wait fight
timeout /t 40 /nobreak >nul

@REM stop fight x[110,270] y[736,1030]
call:tap 110 736 1
@REM confirm x[1250,270] y[640,1030]
call:tap 1250 640 1
@REM home x[1100,270] y[880,1030]
call:tap 1100 880 1
goto:eof




:tap
rem echo tap  %1  %2  %3
set /a x = %1 +%random%/256
set /a y = %2 +%random%/512
adb shell input tap %x% %y%
if not "%3"=="" (timeout /t %3 /nobreak >nul)
goto:eof


:swipe
echo swipe暂时用不到
adb shell input swipe %1 %2 %3 %4
goto:eof




:getRand
echo getRand
set /a n=%random%/128
goto:eof


@REM //模拟输入“001”
@REM adb shell input text “001”
@REM //模拟home按键
@REM adb shell input keyevent 3
@REM //模拟点击(540, 1104)坐标
@REM adb shell input tap 540 1104
@REM //模拟滑动,从(250,250)滑动到(300,300)
@REM adb shell input swipe 250 250 300 300

过程中了解到的点

  • 判断入参为空
  • 与,或,非
  • 循环
  • 跳转
  • 函数,函数参数,函数结果返回
  • 延时
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值