植物大战僵尸禅花园境花园问题

你的位置:
初学者发一个植物大战僵尸禅境花园捡金币的脚本
08:47:56 |
来源: 按键精灵资源站
本人初学者,第一次发帖,感觉有点小激动,不规范的地方请多多包含,下面是植物大战僵尸禅境花园自动捡金币、浇水、施肥、杀虫和听音乐的脚本,写的不好的地方请指点,谢谢各位老师了!
hwnd = Plugin.Window.MousePoint()
//获得窗口左上角的位置和窗口的大小
srect = Plugin.Window.GetClientRect(hwnd)
If InStrRev(srect, &800|600&) = 0 Then
& & MessageBox &请将鼠标放在游戏窗口内在启动游戏&
& & EndScript
//获得窗口左上角的坐标,并将坐标作为参考坐标
dw = Split(srect, &|&) : dwx = dw(0) : dwy = dw(1)
Call 阵列操作(dwx + 1, dwy + 157, 31, 90, 20, 0, 24, 4)
Function 阵列操作(起点x, 起点y, 间隔x, 间隔y, 相移x, 相移y, 循环x, 循环y)
& & Dim i, j
& && &&&Do
& && && && &MoveTo 起点x + 间隔x * i + 相移x * j, 起点y + 间隔y * j + 相移y * i
& && && && &Delay 20
& && && && &LeftClick 1
& && && && &Delay 60
& && && && &i = i + 1
& && &&&Loop&&Until i &= 循环x
& && &&&i = 0 : j = j + 1
& && &&&Delay 50
& & Loop&&Until j &= 循环y
& & Delay 100
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\缺水.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&Call 浇水()
& & End If
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\缺肥.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&Call 施肥()
& & End If
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\杀虫.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&Call 杀虫()
& & End If
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\音乐.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&Call 听音乐()
& & End If
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\蜗牛.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&MoveTo dwx + 312, dwy + 34
& && &&&Delay 50
& && &&&LeftClick 1
& && &&&Delay 50
& && &&&MoveTo intX,intY
& && &&&Delay 100
& && &&&LeftClick 1
& & End If
& & Delay 400&&
End Function
Sub 浇水()
& & Rem 开始1
& & Delay 200
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\缺水.bmp&,0.9,intX,intY
& & Delay 20
& & If intX & 0 And intY & 0 Then
& && && && &MoveTo dwx + 40, dwy + 40
& && && && &Delay 50
& && && && &LeftClick 1
& && && && &Delay 200
& && && && &MoveTo intX, intY
& && && && &Delay 200
& && && && &LeftClick 1
& && && && &Delay 200
& && && && &Goto 开始1
& & End If
Sub 施肥()
& & Rem 开始2
& & Delay 200
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\买肥料.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&MoveTo dwx + 750, dwy + 50
& && &&&Delay 100
& && &&&LeftClick 1
& && &&&Delay 3000
& && &&&For 4
& && && && &MoveTo dwx + 400, dwy + 360
& && && && &Delay 100
& && && && &LeftClick 1
& && && && &Delay 100
& && && && &MoveTo dwx + 300, dwy + 360
& && && && &Delay 400
& && && && &LeftClick 1
& && &&&Next
& && &&&Delay 100
& && &&&MoveTo dwx + 430, dwy + 555
& && &&&Delay 100
& && &&&LeftClick 1
& & End If
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\缺肥.bmp&,0.9,intX,intY
& & Delay 20
& & If intX & 0 And intY & 0 Then
& && &&&Delay 20
& && && && &MoveTo dwx + 100, dwy + 40
& && && && &Delay 50
& && && && &LeftClick 1
& && && && &Delay 200
& && && && &MoveTo intX, intY
& && && && &Delay 200
& && && && &LeftClick 1
& && && && &Delay 100
& && && && &Goto 开始2
& & End If
Sub 杀虫()
& & Rem 开始3
& & Delay 200
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\买杀虫剂.bmp&,0.9,intX,intY
& & If intX & 0 And intY & 0 Then
& && &&&MoveTo dwx + 750, dwy + 50
& && &&&LeftClick 1
& && &&&Delay 3000
& && &&&For 4
& && && && &MoveTo dwx + 472, dwy + 360
& && && && &Delay 100
& && && && &LeftClick 1
& && && && &Delay 100
& && && && &MoveTo dwx + 300, dwy + 360
& && && && &Delay 400
& && && && &LeftClick 1
& && &&&Next
& && &&&Delay 100
& && &&&MoveTo dwx + 430, dwy + 555
& && &&&Delay 100
& && &&&LeftClick 1
& & End If
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\杀虫.bmp&,0.9,intX,intY
& & Delay 20
& & If intX & 0 And intY & 0 Then
& && && && &MoveTo dwx + 175, dwy + 40
& && && && &Delay 50
& && && && &LeftClick 1
& && && && &Delay 200
& && && && &MoveTo intX, intY
& && && && &Delay 200
& && && && &LeftClick 1
& && && && &Delay 100
& && && && &Goto 开始3
& & End If
Sub 听音乐()
& & Rem 开始4
& & Delay 200
& & FindPic dwx, dwy, dwx + 800, dwy + 530 ,&Attachment:\音乐.bmp&,0.9,intX,intY
& & Delay 20
& & If intX & 0 And intY & 0 Then
& && && && &MoveTo&&dwx + 240, dwy + 40
& && && && &Delay 50
& && && && &LeftClick 1
& && && && &Delay 200
& && && && &MoveTo intX, intY
& && && && &Delay 200
& && && && &LeftClick 1
& && && && &Delay 100& && && && && && && && && &
& && && && &Goto 开始4
& && &&&End If
这里在问下发代码的问题,怎样才能有“复制代码”这个链接。

参考资料

 

随机推荐