你的位置:
我找到一个DNF自动收货源码
23:51:53 |
来源: 按键精灵资源站
本帖最后由 l 于
13:10 编辑
我找到一个DNF自动收货源码!把他生成小精灵怎么就用不了求解
'wlsj=Lib.网络.获取网络时间()
'Delay 2000
'If wlsj&cdate(&&)
' Delay 100
'MsgBox &使用期限已到,请从任务管理器关闭程序&
'EndScript
//使用期限检测脚本
DimEnv shuliang,time1,time2,time3,time4,ktjc,feyjy
Dim hwnd,hwnd1,hwnd2
DimEnv kaiguan
hwnd=Plugin.Window.MousePoint
x=Plugin.Window.Move(hwnd,0,0)
'Delay 1000
time1=plugin.sys.GetTime //获取脚本运行时系统初始时间
'set ws=createobject(&wscript.shell&)
'ws.run &c:\testfile.txt&,5,ture
'Delay 500
'hwnd2=Plugin.Window.Foreground
'y=Plugin.Window.Move(hwnd2,0,480)
gosub ***自动喊话
Rem kaitou
Sub ***自动喊话 //***喊话脚本
//下面这句在屏幕区域范围内查找16进制颜色(&0000FF&)的数量
UserVar fdys=15 &防掉线设置&
MoveTo 603,439
gosub 检查是否有交易
time3=plugin.sys.GetTime
If int(time3-time1)&fdys*60*1000 then //15分钟后开启防掉线,只支持***的时候
gosub 防掉线
KeyPressS &Enter&, 1
NUM =plugin.Color.CountColor(60, 398,92, 407, &AADDEE&,1) //查找喊话窗口是否存在
If NUM&0 then
KeyPressS &Z&, 2
KeyPressS &1&, 1
KeyPressS &Enter&, 1
delay 1000
gosub 等待交易 //跳到等待交易
Sub 等待交易
x=Plugin.Window.Active(hwnd)
FindPic 455,305,636,419,&Attachment:\公告按钮.bmp&,0.9,intX,intY //扫描交易框
If intX & 0 And intY & 0 Then
MoveTo 523,403
LeftClick 2
FindPic 0,0,,&Attachment:\11.bmp&,0.9,intX,intY
If intX & 0 And intY & 0 Then
gosub 等待放入物品
gosub ***自动喊话
gosub ***自动喊话
Sub 等待放入物品
UserVar ddfw=10000 &等待放入物品延迟时间(单位:毫秒)注:1000毫秒=1秒&
Delay ddfw
Do Until i&8
FindPic 71,173,306,198,&Attachment:\交易栏无物品图.bmp&,0.9,intX,intY
If intX & 0 And intY & 0 Then
gosub 检查并交易
KeyPress &esc&,1
gosub ***自动喊话
Sub 输入金钱
Dim qian,x,cishu
Rem jiaqian
qian=jiage(100)
If qian&&0 then
'MsgBox &总价钱为:&&qian
MoveTo 197,301
LeftClick 1
KeyPress &BackSpace&, 15 //金钱输入清零
cishu=len(qian)
shu=left(qian,1) //取qian的左起第一个数字
qian=right(qian,cishu-x) //取qian的右起第I个数字
KeyPress shu,1
If i&30 //30秒内金钱为0则跳转喊话
Goto jiaqian
Delay 1000
KeyPress &esc&,1
gosub ***自动喊话
LeftClick 1
gosub 检查并交易
Sub 检查并交易
Rem jiancha
gosub 检查交易是否提前结束
//检查己方输入的金钱
Dim no(9) //数字特征码
no(0)=&1110&
no(1)=&0111& //自取特征码,DNF己方金钱框专用
no(2)=&1111&
no(3)=&1110&
no(4)=&1000&
no(5)=&1110&
no(6)=&1110&
no(7)=&0100&
no(8)=&1110&
no(9)=&1110&
Dim colo(3) //颜色十六进制值 10月7日版
colo(1)=&008CFF&
colo(0)=&0050FF&
colo(2)=&00F0FF&
MoveTo 603,439
rightx=296 //初始x坐标
righty=299 //初始Y坐标
For 3 //千万位数字扫描
rightx=296-21*y
for 3 //百位数字扫描
For 8 //单个数字扫描
rx=rightx-jici*6 //后退6个像素点
ifcolor rx,ry,colo(y),0
number=number&nob
If number=no(i)
jine=i&jine
jici=jici+1
ry=righty //循环一次结束后初始化ry坐标
Next //修改初始化值
'MsgBox jine
feyjy=feyjy+1
If feyjy&120 Then //若一段时间内没有成功交易则取消交易,慎重!!!
KeyPress &Esc&,1
gosub ***自动喊话
If int(jine)=jiage(1000) Then
'MsgBox &价格正确可以进行下一步交易&
ifcolor 167,269,&44EEFF&,0 //检查对方是否先点击了交易
MoveTo 161,426 //交易逐步点击
LeftClick 2
LeftClick 2
Goto jiancha
'MsgBox &价格不符合&
gosub 输入金钱
Gosub 检查并交易
Sub 检查交易是否提前结束
FindPic 0,0,,&Attachment:\11.bmp&,0.9,intX,intY
If intX & 0 And intY & 0 Then
Delay 500 //2分钟内未交易完成则关闭交易框
gosub ***自动喊话
Goto jiewei
rem jiewei
Sub 检查是否有交易
FindPic 0,0,,&Attachment:\11.bmp&,0.9,intX,intY
If intX & 0 And intY & 0 Then
gosub 检查并交易
' Goto jiewei
' rem jiewei
Sub 防掉线
MoveTo 33,439
KeyPress &w&, 1
KeyPress &q&, 1
MoveTo 89,202
LeftClick 1
Delay 1000
IfColor 143,437,&6DA2B9&,1 then
//接受任务
Delay 1000
MoveTo 143,437
LeftClick 1
KeyPress &Esc&, 1
MoveTo 419,405
LeftClick 2
Delay 1000
//放弃任务
MoveTo 419,402
LeftClick 1
MoveTo 336,407
LeftClick 1
KeyPress &Esc&, 1
Sub 输出信息
Call Plugin.Bkgnd.SendString(Hwnd2, &内容&)
Plugin.Window.Active hwnd2
KeyPress &enter&,1
Function xiejiage(geshu,jq,wupin)
Set fso = CreateObject(&Scripting.FileSystemObject&)
b=Plugin.File.ExistFile(&c:\testfile.txt&)
If b=0 Then
Set c= fso.CreateTextFile(&c:\testfile.txt&)
set a=fso.opentextfile(&c:\testfile.txt&,8)
set a=fso.opentextfile(&c:\testfile.txt&,8)
a.writeline(now&&————&&&第&&geshu&&格单价:&&wupin&&价钱&&jq)
End Function
Function jiage(yanshi)
Delay yanshi
Dim ss(100)
ss(0)=&3131CE& //强韧
ss(1)=&52423A& //威严
ss(2)=&84C6C6& //狂乱
ss(3)=&6B6B63& //灵魂
ss(4)=&528429& //灾难
ss(5)=&4A4A5B& //眼睛
ss(6)=&D69473& //小篮
ss(7)=&848484& //无色
ss(8)=&AD73D6& //碳 175,191
ss(9)=&BDB5C6& // 蓝冰
ss(10)=&73194A& //小黑
ss(11)=&7B7BEF& //小红
ss(12)=&B5B5B5& //小白
//这里使用查找颜色来获取物品 不知道在别的电脑上是否能使用 反正在我自己的电脑上是可以用的 请教一下
uservar sss0= 23000 &强韧恶魔的邀请函&
uservar sss1= 23000 &威严&
uservar sss2= 23000 &狂乱&
uservar sss3= 3800 &灵魂&
uservar sss4= 3200 &灾难&
uservar sss5= 25000 &眼睛&
uservar sss6= 100 &小篮&
uservar sss7= 50 &无色&
uservar sss8= 50 &碳&
uservar sss9= 9000 &蓝冰&
uservar sss11= 250 &小红&
uservar sss12= 80 &小白&
uservar sss10= 120 &小黑&
Dim n,m,i,j,qian
kx=85 //第一格物品x取色点
ky=191 //第一个物品y取色点
//扫描第一行物品,共8个物品格
// 单格物品扫描
IfColor ux,ky,ss(n),0
ElseIf n=1
ElseIf n=2
ElseIf n=3
ElseIf n=4
ElseIf n=5
ElseIf n=6
ElseIf n=7
ElseIf n=8
ElseIf n=9
ElseIf n=10
ElseIf n=11
ElseIf n=12
jiag=wupin(geshu,sss) //获取物品价钱
'Call xiejiage(geshu,jiag,sss)
'BeginThread 输出信息
qian=qian+jiag //计算总价格
jiag=0 //价格清零
ux=ux+30 //x坐标加30,扫描下一个框内物品
geshu=geshu+1 //个数循环
jiage=qian //参数传递
End Function
Function wupin(GS,JQ) //计算物品总价格 LX 查找类型
//代码太他妈有才了
//此代码论坛中有,个人觉得很好。
dim a(100)
dim b(100)
dim q(100)
number0=&Attachment:\0.bmp&
number1=&Attachment:\1.bmp&
number2=&Attachment:\2.bmp&
number3=&Attachment:\3.bmp&
number4=&Attachment:\4.bmp&
number5=&Attachment:\5.bmp&
number6=&Attachment:\6.bmp&
number7=&Attachment:\7.bmp&
number8=&Attachment:\8.bmp&
number9=&Attachment:\9.bmp&
leftx=72+(GS-1)*30 //132
upy=174 //155
rightx=99+(GS-1)*30 //162
downy=185 //235
Dim n,m,p,i,j
While n&&m
FindPic leftx,upy,rightx,downy,number0,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number1,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number2,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number3,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number4,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number5,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number6,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number7,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number8,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While n&&m
FindPic leftx,upy,rightx,downy,number9,Similar,fx,fy
If fx&=0 and fy&=0
leftx=fx+1
While p&n+2
While i&n+2
//读取到有数字返回值为 num, 没读取到有数字返回值为0
If n=0 then
num=num+b(q(g))*10^(g-1)
'jiaqian(cishu)=num //这些都是测试时用的,可以不必理
'lx=leftx+30
'leftx=leftx+30
'rightx=rightx+30
'cishu=cishu+1
wupin=JQ*num //改初始坐标
End Function
!!求解!!!!!