【按键精灵】星际家园 脚本分享学习
本帖最后由 wushaominkk 于 2018-9-23 22:28 编辑纯属个人爱好 编写了一套虚拟机内运行的 基本完善脚本
前台实现
已实现
1.自动登录
2.自动出城
3.自动更换0耐久装备
4.安全码 识别
5.实现自动拾取别人不要的材料 提炼后 卖系统 赚取游戏币 金币 1w=1块钱
6.自动打怪 自动挖矿(正在开发中)
本人菜鸟 各位大牛 手下留情 源代码如下
flg=0//基地出不去
quyu = ""//区域判断
xquyu = ""//选择的区域
nengliangtiao = ""//能量条
xueliang = 0//血值
tili = 0//体力
cx = 0//车坐标
cy = 0//车坐标
shezhi_tili = 0
ishang = 0
ixia = 0
izuo = 0
iyou = 0
set dm = createobject("dm.dmsoft")
base_path = dm.GetBasePath()
dm_ret = dm.SetPath(base_path)
dm_ret = dm.SetDict(0,"dm_soft.txt")
shezhi_tili = Form1.InputBox2.Text//获取设置的体力
xquyu = Form1.InputBox1.Text//获取设置的区域
ishang = Form1.Ishang.Text
ixia = Form1.Ixia.Text
izuo = Form1.Izuo.Text
iyou = Form1.Iyou.Text
yanchi = Form1.InputBox3.Text//拾取延迟
jiesuo=Form1.InputBox4.Text//解锁密码
nengliangtiao = GetPixelColor(501, 732)
MessageBox "最新脚本"
Delay 2000
For 10000
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
//MessageBox s
//MessageBox "大循环"&+flg
Call 屋检测
Call 自动登陆
//Call 区域判断
If InStr(s, "基地大厅") > 0 and flg=0 Then
Call 出城
ElseIf InStr(s, "安全区f06") > 0 Then
Call 行走拾取
Else
//MessageBox"1"
flg = 1
Call 回城
End If
Next
hong = 0
Sub 自动登陆
deng = 0
dm_ret = dm.FindStr(0, 0, 1024, 768, "安全屋内", "000000-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
deng = 1
End If
dm_ret = dm.FindStr(0, 0, 1024, 768, "网络已断开", "000000-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
deng = 1
End If
dm_ret = dm.FindStr(2,740 , 905,762, "波星", "000000-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
Delay 500
Else
deng = 1
End If
dm_ret = dm.FindStr(0, 0, 1024, 768, "异常操作", "000000-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
deng = 1
End If
dm_ret = dm.FindStr(0, 0, 1024, 768, "分钟后", "ffffff-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
deng = 1
End If
If deng > 0 Then
Call Lib.系统.结束进程("FTGMOS.exe")
Delay 8000
dm_ret = dm.FindStr(0, 0, 1024, 768, "登录器", "000000-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
MoveTo intX, IntY
Delay 500
LeftClick 1
Delay 4000
End If
Delay 5000
For 500
FindPic 0,0,1024,768,"Attachment:\denglu1.bmp",0.8,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 2000
LeftClick 1
Delay 2000
End If
Delay 5000
FindPic 0,0,1024,768,"Attachment:\denglu2.bmp",0.8,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 2000
LeftClick 1
Delay 2000
End If
Delay 5000
dm_ret = dm.FindStr(0, 0, 1024, 768, "登录验", "000000-000000", 1.0, intX, intY)
If intX > 0 and IntY > 0 Then
MoveTo intX+50, IntY+40
Delay 500
LeftClick 1
Delay 4000
Else
FindPic 0,0,1024,768,"Attachment:\denglu3.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 2000
LeftClick 1
Delay 2000
End If
Delay 20000
s = dm.Ocr(21, 0, 308, 18, "ffffff-000000", 1.0)
If InStr(s, "波星") > 0 Then
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
Delay 10000
SetSimMode 0
Delay 3000
MoveTo 315, 464
Delay 3000
LeftDown 1
Delay 3000
MoveTo 316, 652
Delay 3000
LeftUp 1
Delay 3000
MoveTo 84,694
Delay 3000
LeftClick 1
Delay 3000
Exit For
Else
Call Lib.系统.结束进程("FTGMOS.exe")
End If
End If
Next
End If
End Sub
Sub 换装备
Delay 3000
KeyPress "A", 1
Delay 3000
FindPic 0,0,1024,768,"Attachment:\30yin1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
End If
Delay 2000
s = dm.Ocr(0, 0, 1024, 768, "f70000-000000", 1.0)
If InStr(s,"耐久度")>0 Then
hong=1
End If
Delay 2000
FindPic 0,0,1024,768,"Attachment:\40che1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
End If
Delay 3000
s = dm.Ocr(0, 0, 1024, 768, "f70000-000000", 1.0)
If InStr(s,"耐久度")>0 Then
hong=1
End If
If hong = 1 Then
//MessageBox "1"
Delay 3000
KeyPress "A", 1
flg = 1
Call 回城
Delay 3000
KeyPress "A", 1
Delay 2000
FindPic 0,0,1024,768,"Attachment:\30yin1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftDoubleClick 1
Delay 2000
End If
FindPic 0,0,1024,768,"Attachment:\40che1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftDoubleClick 1
Delay 2000
End If
Delay 3000
KeyPress "A", 1
MoveTo 48, 31
Delay 500
RightClick 1
Delay 3000
MoveTo 649, 30
Delay 500
RightClick 1
Delay 10000
dm_ret = dm.FindStr(0,0,1024,768,"百","f7f7f7-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
MoveTo intX + 20, IntY + 40
Delay 500
LeftClick 1
dm_ret = dm.FindStr(0,0,1024,768,"卖","f7f7f7-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
MoveTo intX +5, IntY + 5
Delay 500
LeftClick 1
Delay 2000
MoveTo 458, 528
Delay 500
LeftDown 1
Delay 8000
LeftUp 1
Delay 2000
dm_ret = dm.FindStr(0, 0, 1024, 768, "领", "f7ebc6-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
MoveTo intX +250, IntY + 5
Delay 500
LeftClick 1
Delay 2000
MoveTo intX +340, IntY +108
Delay 500
LeftClick 1
Delay 3000
dm_ret =dm.FindStr(0, 0, 1024, 768, "安全锁", "f7f7f7-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
Delay 2000
MoveTo intX +60, IntY +60
Delay 500
LeftClick 1
Delay 2000
SayString ""&+jiesuo
Delay 1000
dm_ret =dm.FindStr(0, 0, 1024, 768, "解锁", "addbe7-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
Delay 2000
MoveTo intX +5, IntY +3
Delay 500
LeftClick 1
Delay 3000
dm_ret = dm.FindStr(0, 0, 1024, 768, "领", "f7ebc6-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
MoveTo intX +250, IntY + 5
Delay 500
LeftClick 1
Delay 2000
MoveTo intX +340, IntY +108
Delay 500
LeftClick 1
Delay 3000
End If
End If
End If
End If
dm_ret = dm.FindStr(0, 0, 1024, 768, "改", "f7ebc6-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
MoveTo intX +250, IntY + 5
Delay 500
LeftClick 1
Delay 2000
MoveTo intX +340, IntY +108
Delay 500
LeftClick 1
Delay 2000
End If
End If
End If
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
dm_ret = dm.FindStr(0,0,1024,768,"百","f7f7f7-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
MoveTo intX + 20, IntY + 40
Delay 500
LeftClick 1
dm_ret = dm.FindStr(0,0,1024,768,"买","f7f7f7-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
MoveTo intX +5, IntY + 5
Delay 500
LeftClick 1
Delay 2000
dm_ret = dm.FindStr(0, 0, 1024, 768, "领", "f7ebc6-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
MoveTo intX +250, IntY + 5
Delay 500
LeftClick 1
Delay 2000
MoveTo intX +340, IntY +108
Delay 500
LeftClick 1
Delay 2000
End If
dm_ret = dm.FindStr(0, 0, 1024, 768, "改", "f7ebc6-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
MoveTo intX +250, IntY + 5
Delay 500
LeftClick 1
Delay 2000
MoveTo intX +340, IntY +108
Delay 500
LeftClick 1
Delay 2000
End If
End If
End If
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
KeyPress "D", 1
Delay 3000
FindPic 0,0,1024,768,"Attachment:\zhengli.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
FindPic 0,0,1024,768,"Attachment:\40che.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftDoubleClick 1
Delay 4000
End If
MoveTo 963, 44
Delay 500
LeftClick 1
Delay 1000
FindPic 0,0,1024,768,"Attachment:\30yin.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftDoubleClick 1
Delay 4000
End If
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
hong = 0
End If
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
End Sub
Sub 检测
FindPic 0,0,1024,768,"Attachment:\jiance.bmp",0.7,intX,intY
If intX> 0 And intY> 0 Then
Delay 200
MoveTo 350,660
Delay 1000
LeftClick 1
Delay 2000
s = dm.Ocr(430,357,587,390 ,"120.2.98-20.20.20|0.100.91-20.20.20|194.7.91-20.20.20|203.13.48-20.20.20|359.56.94-20.20.20|359.62.68-20.20.20|0.100.35-20.20.20|0.100.74-20.20.20|359.98.68-20.20.20|5.64.81-20.20.20",1.0)
//MessageBox s
s = Replace(s, "-", "")
s = Replace(s, "一", "")
//MessageBox s
b = 0
If InStr(s, "加")>0 Then
a=Split(s,"加")
b=a(0)*1+a(1)*1
End If
If InStr(s, "减")>0 Then
a=Split(s,"减")
b=a(0)*1-a(1)*1
End If
//MessageBox b
MoveTo 499,416
Delay 1000
LeftClick 1
Delay 1000
SayString b
MoveTo 530, 492
Delay 1000
LeftClick 1
Delay 1000
End If
End Sub
Sub 屋检测
Delay 2000
c = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
//MessageBox c
If InStr(c, "安全屋") > 0 Then
Delay 2000
For 5
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 2000
End If
Next
For 30
MoveTo 330, 397
RightClick 1
Delay 1000
MoveTo 144, 401
RightClick 1
Delay 1000
//MessageBox "2222"
FindPic 0,0,1024,768,"Attachment:\anquan.bmp",0.7,intX,intY
If intX> 0 And intY> 0 Then
MoveTo intX, intY
LeftClick 3
Delay 2000
FindPic 0,0,1024,768,"Attachment:\anquan5.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
Exit For
End If
End If
FindPic 0,0,1024,768,"Attachment:\anquan1.bmp",0.7,intX,intY
If intX> 0 And intY> 0 Then
MoveTo intX, intY
LeftClick 3
Delay 2000
FindPic 0,0,1024,768,"Attachment:\anquan5.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
Exit For
End If
End If
FindPic 0,0,1024,768,"Attachment:\anquan2.bmp",0.7,intX,intY
If intX> 0 And intY> 0 Then
MoveTo intX, intY
LeftClick 3
Delay 2000
FindPic 0,0,1024,768,"Attachment:\anquan5.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
Exit For
End If
End If
FindPic 0,0,1024,768,"Attachment:\anquan3.bmp",0.7,intX,intY
If intX> 0 And intY> 0 Then
MoveTo intX, intY
LeftClick 3
Delay 2000
FindPic 0,0,1024,768,"Attachment:\anquan5.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
Exit For
End If
End If
Next
For 10
FindPic 0,0,1024,768,"Attachment:\anquan5.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
Else
Exit Sub
End If
Delay 2000
s= dm.Ocr(430,357,587,390 ,"120.2.98-20.20.20|0.100.91-20.20.20|194.7.91-20.20.20|203.13.48-20.20.20|359.56.94-20.20.20|359.62.68-20.20.20|0.100.35-20.20.20|0.100.74-20.20.20|359.98.68-20.20.20|5.64.81-20.20.20",1.0)
//MessageBox s
s = Replace(s, "-", "")
s = Replace(s, "一", "")
//MessageBox s
b = 0
If InStr(s, "加")>0 Then
a=Split(s,"加")
b=a(0)*1+a(1)*1
End If
If InStr(s, "减")>0 Then
a=Split(s,"减")
b=a(0)*1-a(1)*1
End If
//MessageBox b
MoveTo 499,416
Delay 1000
LeftClick 1
Delay 1000
SayString b
MoveTo 530, 492
Delay 1000
LeftClick 1
Delay 10000
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
If InStr(s, "安全屋") = 0 Then
Exit For
End If
Next
End If
End Sub
Sub 行走拾取
//MessageBox "行走"&+flg
//右
For iyou
Call 自动登陆
Call 检测
FindColor 0,0,1024,768,"F70000",intX,intY
If intX > 0 And intY > 0 Then
cx = intX + 25
cy = intY - 50
If cx < 700-25 Then
MoveTo 784,240
RightClick 1
Delay 1000
Call 拾取
MoveTo 891,538
RightClick 1
Delay 1000
Call 拾取
Else
//MessageBox "到右边了"
MoveTo 512, 376
RightClick 1
Delay 1000
MoveTo 400, 376
RightClick 1
Delay 1000
Exit For
End If
else
MoveTo 969, 44
Delay 100
LeftClick 1
Delay 100
End If
Next
Call 区域判断
//下
For ixia
Call 自动登陆
Call 检测
FindColor 0,0,1024,768,"F70000",intX,intY
If intX > 0 And intY > 0 Then
cx = intX + 25
cy = intY - 50
If cy < 490+50 Then
MoveTo 507,521
RightClick 1
Delay 1000
Call 拾取
MoveTo 783,583
RightClick 1
Delay 1000
Call 拾取
Else
//MessageBox "到下边了"
MoveTo 512, 376
RightClick 1
Delay 1000
MoveTo 400, 376
RightClick 1
Delay 2000
Exit For
End If
Else
MoveTo 969, 44
Delay 100
LeftClick 1
Delay 100
End If
Next
Call 区域判断
Call 加能量
//左
For izuo
Call 自动登陆
Call 检测
FindColor 0,0,1024,768,"F70000",intX,intY
If intX > 0 And intY > 0 Then
cx = intX + 25
cy = intY - 50
If cx > 280-25 Then
MoveTo 341,153
RightClick 1
Delay 1000
Call 拾取
MoveTo 187,516
RightClick 1
Delay 1000
Call 拾取
Else
//MessageBox "到左边了"
MoveTo 512, 376
RightClick 1
Delay 1000
MoveTo 400, 376
RightClick 1
Delay 1000
Exit For
End If
Else
MoveTo 969, 44
Delay 100
LeftClick 1
Delay 100
End If
Next
Call 区域判断
//上
For ishang
Call 自动登陆
Call 检测
FindColor 0,0,1024,768,"F70000",intX,intY
If intX > 0 And intY > 0 Then
cx = intX + 25
cy = intY - 50
If cy > 230+50 Then
MoveTo 229,127
RightClick 1
Delay 1000
Call 拾取
MoveTo 587,284
RightClick 1
Delay 1000
Call 拾取
Else
//MessageBox "到左边了"
MoveTo 512, 376
RightClick 1
Delay 2000
MoveTo 400, 376
RightClick 1
Delay 1000
Exit For
End If
Else
MoveTo 969, 44
Delay 100
LeftClick 1
Delay 100
End If
Next
Call 区域判断
Call 吃体力
Delay 2000
Call 加能量
Delay 2000
Call 换装备
End Sub
Sub 拾取
FindPic 112,150,836,607,"Attachment:\dibao.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX - 20, intY - 10
RightClick 1
Delay 50
MoveTo intX+20, intY+10
RightClick 1
Delay 50
MoveTo intX-20, intY+10
RightClick 1
Delay 50
MoveTo intX+20, intY-10
RightClick 1
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
End If
FindPic 112,150,836,607,"Attachment:\digui.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX - 20, intY - 10
RightClick 1
Delay 50
MoveTo intX+20, intY+10
RightClick 1
Delay 50
MoveTo intX-20, intY+10
RightClick 1
Delay 50
MoveTo intX+20, intY-10
RightClick 1
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
End If
FindPic 112,150,836,607,"Attachment:\dike.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX - 20, intY - 10
RightClick 1
Delay 50
MoveTo intX+20, intY+10
RightClick 1
Delay 50
MoveTo intX-20, intY+10
RightClick 1
Delay 50
MoveTo intX+20, intY-10
RightClick 1
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
End If
FindPic 112,150,836,607,"Attachment:\dijiao.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX - 20, intY - 10
RightClick 1
Delay 50
MoveTo intX+20, intY+10
RightClick 1
Delay 50
MoveTo intX-20, intY+10
RightClick 1
Delay 50
MoveTo intX+20, intY-10
RightClick 1
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
KeyPress "E", 1
Delay yanchi
End If
End Sub
Sub 区域判断
If xquyu = 1 Then
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
If InStr(s, "安全区f06") > 0 Then
Exit Sub
Else
//MessageBox"2"
flg = 1
Call 回城
End If
End If
If xquyu = 2 Then
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
If InStr(s, "安全区f06-1") > 0 Then
Exit Sub
Else
//MessageBox"3"
flg = 1
Call 回城
End If
End If
If xquyu = 3 Then
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
If InStr(s, "安全区f06-2") > 0 Then
Exit Sub
Else
//MessageBox"4"
flg = 1
Call 回城
End If
End If
End Sub
Sub 加能量
Delay 2000
KeyPress "D", 1
Delay 1000
FindPic 0,0,1024,768,"Attachment:\zhengli.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
Delay 1000
FindPic 223,190,863,726,"Attachment:\djnlb.bmp",0.8,intX,intY
If intX > 0 And intY > 0 Then
Delay 1000
MoveTo IntX + 3, IntY + 3
Delay 500
LeftDoubleClick 1
Delay 1000
End If
Call 关闭
End Sub
Sub 关闭
For 5
FindPic 0,0,1024,768,"Attachment:\xxx.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 2000
End If
Next
End Sub
Sub 吃体力
Delay 2000
MoveTo 969, 44
Delay 500
LeftDoubleClick 1
Delay 1000
KeyPress "C", 1
Delay 1000
//获取体力值
s = dm.Ocr(298, 259, 316, 272, "f7ebc6-000000", 1.0)
Delay 2000
Call 关闭
Delay 1000
If s > shezhi_tili Then
Delay 1000
Exit Sub
Else
Delay 2000
KeyPress "D", 1
Delay 1000
FindPic 0,0,1024,768,"Attachment:\zhengli.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 500
LeftClick 1
Delay 4000
End If
Delay 1000
FindPic 223,190,863,726,"Attachment:\mifan.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
Delay 1000
MoveTo IntX + 3, IntY + 3
Delay 500
LeftDoubleClick 1
Delay 1000
MoveTo 969, 44
Delay 500
LeftDoubleClick 1
Delay 1000
End If
Delay 1000
Call 关闭
Delay 1000
dm_ret = dm.FindStr(281,193,835,605, "不", "f7c700-000000", 1.0, intX, intY)
If IntX > 0 and IntY > 0 Then
MoveTo IntX - 18, IntY + 6
Delay 1000
LeftClick 1
Delay 2000
MoveTo IntX + 37, IntY + 30
Delay 1000
LeftClick 1
Delay 1000
End If
End If
End Sub
Sub 血量
//获取血值
s = dm.Ocr(729, 230, 749, 243, "f7f7f7-000000", 1.0)
End Sub
Sub 红名
dm_ret = dm.FindStr(0,0,1024,768,"红名村","ffffff-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
Delay 1200000
End If
End Sub
Sub 回城
Call 红名
Call 屋检测
If flg = 1 Then
Delay 3000
MoveTo 971, 46
Delay 100
LeftClick 1
Delay 1000
KeyPress "B", 1
//MessageBox flg
Delay 3000
For 20
dm_ret = dm.FindStr(0,0,1024,768,"免费方式","f7df00-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
Delay 3000
MoveTo intX+5, intY+3
Delay 1000
LeftClick 1
Exit For
Else
Delay 3000
MoveTo 695,705
Delay 1000
LeftClick 1
//MessageBox flg
Delay 3000
End If
Next
For 20
Call 屋检测
Delay 38000
//s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
dm_ret = dm.FindStr(85, 2, 300, 14,"基地大厅","ffffff-000000",1.0,intX,intY)
If intX > 0 And intY > 0 Then
dt = 0
FindPic 0,0,1024,768,"Attachment:\dating1.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
dt=1
End If
FindPic 0,0,1024,768,"Attachment:\dating2.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
dt=1
End If
FindPic 0,0,1024,768,"Attachment:\dating3.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
dt=1
End If
FindPic 0,0,1024,768,"Attachment:\dating4.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
dt=1
End If
FindPic 0,0,1024,768,"Attachment:\dating5.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
dt=1
End If
If dt>0 Then
flg = 0
//MessageBox "回程"&+flg
Exit For
Else
Delay 3000
MoveTo 971, 46
Delay 100
LeftClick 1
Delay 1000
KeyPress "B", 1
//MessageBox flg
Delay 3000
For 20
dm_ret = dm.FindStr(0,0,1024,768,"免费方式","f7df00-000000",1.0,intX,intY)
If intX > 0 and IntY > 0 Then
Delay 3000
MoveTo intX+5, intY+3
Delay 1000
LeftClick 1
Exit For
Else
Delay 3000
MoveTo 695,705
Delay 1000
LeftClick 1
//MessageBox flg
Delay 3000
End If
Next
End If
End If
Next
End If
End Sub
Sub 出城
//MessageBox "c"&+flg
For 4
MoveTo 740, 551
RightClick 1
Delay 1000
MoveTo 843, 625
RightClick 1
Delay 1000
Next
Delay 3000
For 20
FindPic 0,0,1024,768,"Attachment:\jidi1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 100
RightClick 1
Delay 3000
KeyDown "Tab", 1
Delay 300
MoveTo 565, 200
Delay 300
RightClick 1
Delay 300
KeyUp "Tab", 1
Delay 3000
MoveTo 568, 305
Delay 300
LeftClick 1
Delay 3000
Exit For
End If
Next
Delay 3000
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
If InStr(s,"行政区")>0 Then
MoveTo 445, 170
RightClick 1
Delay 3000
MoveTo 108, 183
RightClick 1
Delay 4000
MoveTo 202, 130
RightClick 1
Delay 4500
For 30
MoveTo 700, 200
RightClick 1
Delay 2000
MoveTo 861, 222
RightClick 1
Delay 2000
FindPic 0,0,1024,768,"Attachment:\c1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 100
RightClick 1
Delay 4000
MoveTo 499, 79
Delay 500
RightClick 1
Delay 15000
MoveTo 559, 32
Delay 500
RightClick 1
Delay 4000
MoveTo 783, 101
Delay 500
RightClick 1
Delay 4000
End If
FindPic 0,0,1024,768,"Attachment:\cheng1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
Delay 100
RightClick 1
Delay 3000
KeyDown "Tab", 1
Delay 300
MoveTo 896, 468
Delay 300
RightClick 1
Delay 300
KeyUp "Tab", 1
Delay 3000
If xquyu = 1 Then
//1
MoveTo 922, 311
Delay 300
LeftClick 1
Delay 3000
End If
If xquyu = 2 Then
//1
MoveTo 922, 335
Delay 300
LeftClick 1
Delay 3000
End If
If xquyu = 3 Then
//1
MoveTo 922, 358
Delay 300
LeftClick 1
Delay 3000
End If
Delay 5000
s = dm.Ocr(85, 2, 300, 14, "ffffff-000000", 1.0)
Delay 5000
//MessageBox s
If InStr(s, "安全区f06") > 0 Then
Exit Sub
Else
//MessageBox flg
flg = 1
//MessageBox"5"
Call 回城
End If
Exit For
End If
Next
Else
flg = 1
//MessageBox flg
//MessageBox"6"
Call 回城
End If
End Sub
成品地址:https://pan.baidu.com/s/1uH7ynHaMJVPyXGgP5vIxtA
源代码分享,仅供学习交流
请问一下,在手机540*960上面写的代码怎么适配到其他分辨率? 1.shui 发表于 2018-9-23 16:10
请问一下,在手机540*960上面写的代码怎么适配到其他分辨率?
这个应该 可以通过 计算 得到 其他分辨率 的定点
我也是菜鸟 可以提供给你这个思路 向大神膜拜学习 感谢分享 感谢大佬分享 感谢分享 感谢大佬分享 感谢分享 谢谢分享