1、本源码适用于按键精灵手机版Dim 现在时(),Advertisement,barnfull,barnlevel,dw1,dw2,aaa,aCall 调整屏幕 ()Call 定位干扰 ()Call 重新联机 ()Call 定位种田 ()Call 主程序 ()Sub 主程序()DoIf ReadUIConfig(“fans“) Then Call 粉丝移除()End IfFor 2Call 种植小麦 ()Call 小麦收割 ()Delay 300NextCall 粮仓 ()If barnfull = 1 Then TracePrint “判定粮仓满了“Call 商店()End IfCall 粮仓水
2、位 ()/读取界面元素名称为“账号“的默认值,如果该元素未设置默认值则读出 100If ReadUIConfig(“honey“) ThenCall 收集 ()End If/-找邻居卖东西If ReadUIConfig(“neighbor“) Then /-开始找邻居的时间Call 读现在时(1)If 计时器(30, 1, false) Then Goto jumpfindEnd IfDelay 200/-点击次数aaa=0Do Until 计时器(30, 1, false) =TrueCall 找邻居()Call 邻居小麦()Delay 1000LoopDelay 200Rem jumpfi
3、ndEnd IfCall 商店 ()Call 重新联机 ()FindPic 917, 443, 967, 491, “Attachment:定位图.png“, “000000“, 0, 0.7, dw1, dw2If dw1 0 And cornerY 0 Then TracePrint “已定位种田 “Delay 200TouchDown 635, 422Delay 200TouchMove 635, 160Delay 200TouchUpDelay 200TracePrint “调整完毕 “Exit DoEnd IfIf 计时器(10, 0, false) Then TracePrint
4、“指定时间到 “Call 调整屏幕()Call 定位干扰()Call 重新联机()End IfLoopEnd SubSub 种植小麦()Dim landX,landY/-无云-FindPic 569,530,651,595,“Attachment:First Farmland0.png“,“000000“,0,0.6,landX,landYIf landX 0 And landY 0 Then TracePrint “开始种植“Call 第一田()Delay 500If 小麦() = 1 Then TracePrint “准备刷地 “Call 刷地()End IfDelay 1000/TXL
5、= now/PlantingNumber=PlantingNumber+1End IfEnd SubSub 小麦收割()Dim land2X,land2Y/-无云-FindPic 580,528,647,584,“Attachment:First Farmland2.png“,“000000“,0,0.7,land2X,land2YIf land2X 0 And land2Y 0 Then TracePrint “开始收割 “Call 第一田()Delay 500If 收割() = 1 Then Call 刷地()End IfDelay 1000 End IfEnd Sub/-点击第一块土地S
6、ub 第一田()Delay 200Tap 609,564TracePrint “已点击第一田 “Delay 200End SubFunction 小麦()Dim intX,intYFindPic 497,436,573,512,“Attachment:wheat0.png“,“000000“,0,0.7,intX,intYIf intX 0 And intY 0 Then TracePrint “已找到小麦图标 “TouchDown 537,473,0TracePrint “已点击小麦图标 “Delay 100小麦 = 1Else TracePrint “未找到小麦图标 “小麦=-1End I
7、fEnd FunctionFunction 收割()Dim intX,intYFindPic 465,472,556,552,“Attachment:Sickle.png“,“000000“,0,0.7,intX,intYIf intX 0 And intY 0 ThenTouchDown 511,492,0TracePrint “已按镰刀 “Delay 100收割 = 1Else TracePrint “未找到镰刀图标 “收割=-1End IfEnd FunctionSub 刷地()/种植速度,24 是延时/读取界面元素名称为“账号“的默认值,如果该元素未设置默认值则读出 100Dim fa
8、TracePrint “刷地“fa=ReadUIConfig(“farm“)/将小麦移动至第一块田TouchMove 606,568, 0, 200Delay 200/刷第一排TouchMove 941,395, 0, 800Delay 200If fa = 0 Then TouchUp 0Goto farmlandEnd If/调整至第二排TouchMove 905, 376, 0, 200Delay 200/刷第二排TouchMove 567, 545, 0, 800If fa = 1 Then TouchUp 0Goto farmlandEnd If/调整至第三排TouchMove 53
9、1, 528, 0, 200/刷第三排TouchMove 869, 359, 0, 800If fa = 2 Then TouchUp 0Goto farmlandEnd If/调整至第四排TouchMove 832, 342, 0, 200/刷第四排TouchMove 496, 508, 0, 800If fa = 3 Then TouchUp 0Goto farmlandEnd If/调整至第五排TouchMove 463, 496, 0, 200/刷第五排TouchMove 792, 324, 0, 800If fa = 4 Then TouchUp 0Goto farmlandEnd
10、If/调整至第六排TouchMove 759,307, 0, 200/刷第六排TouchMove 425, 473, 0, 800If fa = 5 Then TouchUp 0Goto farmlandEnd If/调整至第七排TouchMove 389,457, 0, 200/刷第七排TouchMove 721, 288, 0, 800If fa = 6 Then TouchUp 0Goto farmlandEnd If/调整至第八排TouchMove 686,272, 0, 200/刷第八排TouchMove 353, 438, 0, 800If fa = 7 Then TouchUp
11、0Goto farmlandEnd If/调整至第九排TouchMove 327,412, 0, 200/刷第九排TouchMove 653, 253, 0, 800If fa = 8 Then TouchUp 0Goto farmlandEnd IfRem farmlandDelay 100TouchUpDelay 100End SubSub 粮仓()Dim barnX,barnYAdvertisement = 0FindPic 539,126, 735,267, “Attachment:full.png“, “000000“, 0, 0.6, barnX, barnYIf barnX 0
12、And barnY 0 Then TracePrint “粮仓已满 “Tap 873,199Delay 1000barnfull = 1ElseTracePrint “粮仓未满 “End IfCall 种植小麦()Delay 100Call 定位干扰()Delay 100End SubSub 粮仓水位()Dim barnlevelX, barnlevelY,barnlevel2X,barnlevel2Y,BarnlevelText,ba,bbbarnlevel = 5ba = ReadUIConfig(“barn“)Select Case (ba)Case 0bb = 50Case 1bb =
13、 60Case 2bb = 70Case 3bb = 80End SelectFindColor 951,493, 963,584, “4FF8FF“, 0, 0.8, barnlevelX, barnlevelYIf barnlevelX 0 And barnlevelY 0 Then TracePrint “粮仓水位以找到 “BarnlevelText = (584 - barnlevelY) * 100 87 - 10TracePrint BarnlevelTextTracePrint bb / BarnlevelTextbarnlevel =bb / BarnlevelTextElse
14、 FindColor 951,493, 963,584, “4AD5F7“, 0, 0.8,barnlevel2X,barnlevel2YIf barnlevel2X 0 And barnlevel2Y 0 Then TracePrint “粮仓水位以找到 “BarnlevelText = (584 - barnlevel2Y) * 100 87 - 10TracePrint BarnlevelTextTracePrint bb / BarnlevelTextbarnlevel = bb / BarnlevelTextEnd IfEnd IfEnd SubSub 商店()Call 粮仓水位()Delay 500Call 开启商店()Delay 500Call 金钱收集()Delay 100If barnlevel 0 And soldY 0 Then TracePrint “找到已卖出商品 “sold2X = soldXsold2Y = soldY-50