=========================================== 你若想间隔一定时间做某个动作,如果你的脚本内容不够长,就必须有个循环。 而最初的时间必须定义在循环之外(前面)。 我不清楚你原来的脚本是什么样子的,你可以参考下面的。 其中,Rem 1 和 Goto 1 就是一个循环(当然也有别的方式循环) t1=now t2=now Rem 1 If DateDiff("s",t1,now)>=66 KeyPress 112 1 Delay 10 t1=now EndIf If DateDiff("s",t2,now)>=41 KeyPress 113 1 Delay 10 t2=now KeyPress 192,1 EndIf Delay 32 Goto 1 按键通常是按顺序执行的,当然也有跳转、循环和调用返回等。 若两段内容的间隔比较短,就可以认为是同时进行的。 新版本的按键,有多线程的功能,你可以了解一下。 =================================== 前辈!我找的就是你! 谢谢你能来! 我的脚本内容技能部分是在中间,他的前面有找怪还有些其他动作,技能的后面还有找不到怪要做的动作。脚本是整个脚本一直循环! 前后面都有动作应该怎么做呢? 还有就是这样的话是不是互不影响啊?是不是各自记各自的时间的? ===================================
=========================== 看了很久,终于大概看懂了你的脚本。 你是不是想做成这样的: 找怪,找到后 就开始打怪,用了6种技能,分别按固定间隔发出技能,若此时怪还在,就继续发技能。 没怪,或怪死了,就循环找怪。 是不是? 我按上面我说的意思改了你的脚本(你的脚本中有些错误,比照看一下) Rem 开始 youguai=0 Delay 3000 KeyDown 65,1 KeyDown 83,1 Delay 2200 KeyUp 65,1 KeyUp 83,1 VBSCall FindColorEx(0,0,1024,715,"0916EB",1,0.9,x,y) If x>=0 and y>=0 MoveTo x+15 y+60 Delay 1 LeftClick 1 Delay 1 LeftClick 1 Delay 1 //左键单击进行攻击 t1=time:t2=time:t3=time:t4=time:t5=time:t6=time youguai=1 Goto 打怪 EndIf Delay 3000 KeyDown 68,1 KeyDown 83,1 Delay 1800 KeyUp 68,1 KeyUp 83,1 VBSCall FindColorEx(0,0,1024,715,"0916EB",1,0.9,x,y) If x>=0 and y>=0 MoveTo x+15 y+60 Delay 1 LeftClick 1 Delay 1 LeftClick 1 Delay 1 //左键单击进行攻击 t1=time:t2=time:t3=time:t4=time:t5=time:t6=time youguai=1 Goto 打怪 EndIf Rem 打怪 If youguai=1 Delay 20 If DateDiff("s",t1,time)>=66 //F1黑魔咒 KeyDown 112,1 Delay 1000 KeyUp 112,1 Delay 10 t1=time Delay 500 KeyPress 192,1 EndIf If DateDiff("s",t2,time)>=41 // F2魂灵 KeyDown 113,1 Delay 1000 KeyUp 113,1 Delay 10 t2=time Delay 10 KeyPress 192,1 EndIf If DateDiff("s",t3,time)>=7 //F3魔灵 KeyPress 114 1 Delay 10 t3=time Delay 10 KeyPress 192,1 EndIf If DateDiff("s",t4,time)>=12 //F4束缚 KeyPress 115 1 Delay 10 t4=time KeyPress 192,1 EndIf If DateDiff("s",t5,time)>=24 //3 旋魔 KeyPress 51,1 Delay 10 t5=time Delay 10 KeyPress 192,1 EndIf If DateDiff("s",t6,time)>=12 //4 黑龙咒 KeyPress 52,1 Delay 10 t6=time Delay 10 KeyPress 192,1 EndIf VBSCall FindColorEx(0,0,1024,715,"0916EB",1,0.9,x,y) If x>=0 and y>=0 MoveTo x+15 y+60 Delay 1 LeftClick 1 Delay 1 LeftClick 1 Delay 1 //左键单击进行攻击 youguai=1 Goto 打怪 EndIf EndIf Goto 开始 若不符合你的意愿,就把你想完成的过程说一下。 ================================= 前辈你理解对了我就是这个意思! 我再发个最原来的 Rem 开始 VBSCall FindColorEx(0,0,1024,670,"#0916EB",1,0.9,x,y) If x>=0 and y>=0 //这里证明找到怪,跳到打怪! Goto 打怪 Else Goto 找怪 //没找到跳到找怪 EndIf Rem 打怪 MoveTo x+15 y+60 //因为是抓色找怪 抓的色是怪的名字 所以鼠标要偏移些 Delay 1 LeftClick 1 //鼠标左键单击就是物理攻击 Delay 1 LeftClick 1 //第二次是防止第一次没点上 Delay 1 左键单击进行攻击 Delay 20 If DateDiff("s",t1,time)>=66 //F1黑魔咒 //这里开始使用技能了同时也在物理攻击 VBS t1=time KeyDown 112,1 Delay 1000 KeyUp 112,1 Delay 500 KeyPress 192,1 EndIf If DateDiff("s",t2,time)>=41 // F2魂灵 //都一样只是间隔时间不一样 VBS t2=time KeyDown 113,1 Delay 1000 KeyUp 113,1 Delay 500 KeyPress 192,1 EndIf If DateDiff("s",t3,time)>=7 //F3魔灵 VBS t3=time KeyPress 114 1 Delay 10 KeyPress 192,1 EndIf If DateDiff("s",t4,time)>=12 //F4束缚 VBS t4=time KeyPress 115 1 Delay 10 KeyPress 192,1 EndIf If DateDiff("s",t5,time)>=24 //3 旋魔 //从这里以上都是远程攻击和加防的 VBS t5=time KeyPress 51,1 Delay 10 KeyPress 192,1 EndIf VBSCall FindColorEx(432,288,591,447,"#0916EB",1,0.9,x,y) If x>=0 and y>=0 If DateDiff("s",t6,time)>=12 //4 黑龙咒 //这个是近身攻击所以要在身边有怪的时候才使用 VBS t6=time KeyPress 52,1 Delay 10 KeyPress 192,1 EndIf Goto 开始 Rem 找怪 //找怪这里就是做简单的走动动作 找到怪就跳到打怪那里 Delay 3000 KeyDown 65,1 KeyDown 83,1 Delay 2200 KeyUp 65,1 KeyUp 83,1 VBSCall FindColorEx(0,0,1024,715,"#0916EB",1,0.9,x,y) //区域模煳找色 0,0,1024,768为区域范围 "FFFFFF"为颜色 1为查找方式(中间向外) 0.8为模煳值 x,y为找到颜色后的坐标变量 If x>=0 and y>=0 Goto 打怪 EndIf Delay 3000 KeyDown 68,1 KeyDown 83,1 Delay 1800 KeyUp 68,1 KeyUp 83,1 VBSCall FindColorEx(0,0,1024,715,"#0916EB",1,0.9,x,y) //区域模煳找色 0,0,1024,768为区域范围 "FFFFFF"为颜色 1为查找方式(中间向外) 0.8为模煳值 x,y为找到颜色后的坐标变量 If x>=0 and y>=0 Goto 打怪 EndIf Goto 开始 你那个和我这个还有些不一样 请你帮我解决下延时一定时间再使用技能! 我的问题就出在这里 其他的还可以 本帖最后由 我是新手 于 2011-1-16 22:46 编辑
|
|