声明:因涉及操作封包,有外挂之嫌,不喜请勿继续.
纵观网站脚本,皆为按键精灵,可能与其简单易上手有关,但功能方面,不算强大.本文选择的脚本软件为autoit3,风格类似vb,支持子函数,易模块化,易读性方面比按键精灵强得多.至于其他方面如用户界面、网络、进程管理等因与本文无关,不再赘述。至于用封包操作,主要基于网络状况考虑,不用考虑延迟会稳定很多。如何截包网上搜一搜,会有一大串。
准备步骤:
1.安装 autoit3.2.2(或成品) wpe 0.9c
2.分辨率:800*600 窗口模式 默认:F7 丢弃 F12 露天 发包1 采集 发包2 料理
脚本如下:
Global $MaxHp =250 ;体力最大值
Global $AddHp =50 ;料理补体力值
Global $HindWindows =0 ;是否隐含窗口 如隐含将不能检测是否满仓,但可全后台化
Global $NeedReject =1 ;是否丢弃
Global $NeedSell =1 ;是否露天
Global $x1 =1 ;采集封包位置
Global $x2 =2 ;料理封包位置
Global $d1 =2 ;要丢的货物1的位置
Global $d2 =4 ; 要丢的货物2的位置
Global $f1 ="F7" ;丢弃货物快捷键
Global $f2 ="F12" ; 露天快捷键
Global $r1 =1 ; 要露天的货物1的位置
Global $r2 =2 ; 要露天的货物2的位置
Global $rj1 =800 ; 货物1的价格
Global $rj2 =5000 ; 货物2的价格2
Global $wait =400 ;等待时间
Global $mousespeed =1 ;鼠标速度
Global $dol = "大航海bot design by 泡菜 " ;dol标题
Global $wpe = "wpe" ;wpe标题
Global $total =0
Global $err =0
Global $gpause
Opt("MouseCoordMode", 2)
Opt("PixelCoordMode", 2)
if WinExists ( $dol)=0 then WinSetTitle ("大航海时代","" , $dol )
if WinExists ( $wpe)=0 then WinSetTitle ("WPE 专业版","" , $wpe )
HotKeySet("`", "cj1") ;生产快捷键
while 1
sleep(100)
wend
;----------------------------------------------------------------------------------------
;发包
;----------------------------------------------------------------------------------------
Func SendPack($x,$c,$t)
if $gpause=0 then Return(0)
if WinActive( $wpe)=0 then WinActivate( $wpe)
for $i=1 to 5
if PixelGetColor( 16, 296+($i-1)*17)=0 then MouseClick("left", 16, 296+($i-1)*17, 1,$mousespeed) ;检查多余的勾 无反应可能因版本不同 更改 296 值
next
if PixelGetColor( 16, 296+($x-1)*17)=16777215 then MouseClick("left", 16, 296+($x-1)*17, 1,$mousespeed) ;无反应可能因版本不同 更改 296 值
sleep($wait)
MouseClick("left", 27, 260, 1,$mousespeed)
sleep($wait)
$i=0
while WinActive("发送设置")=1
ControlSend("发送设置", "", "Edit7", "{left}")
ControlSend("发送设置", "", "Edit7", "{left}")
ControlSend("发送设置", "", "Edit7", "{left}")
ControlSend("发送设置", "", "Edit7", "{del}")
ControlSend("发送设置", "", "Edit7", "{del}")
ControlSend("发送设置", "", "Edit7", "{del}")
ControlSend("发送设置", "", "Edit7", $c)
$tt=ControlGetText("发送设置", "", "Edit8")
ControlFocus("发送设置", "", "Edit8")
if $tt<$t then ControlSend("发送设置", "", "Edit8", "{up " & ($t-$tt)/100 & "}")
if $tt>$t then ControlSend("发送设置", "", "Edit8", "{down " & ($tt-$t)/100 & "}")
ControlClick("发送设置", "", "Button6")
wend
if $t=100 then
sleep($c*150)
else
sleep(500)
endif
EndFunc
;------------------------------------------------------------------------------------------------
;采集
;-------------------------------------------------------------------------------------------------
Func cj1()
$gpause= not $gpause
if WinActivate( $wpe)=0 then $gpause=0
$j=0
$cerr=0
if $HindWindows then
WinSetState( $dol, "", @SW_hide )
WinSetState( $wpe, "", @SW_hide )
endif
While $gpause
$title=WinGetTitle("")
$pos = MouseGetPos()
$n=Floor($maxhp/$AddHp) ;喝酒次数
$n1=Floor($AddHp*$n/5)+4 ;生产次数
; MsgBox(4096, "Test", $maxhp & " " & $AddHp, 2)
WinActivate( $dol) ;检查是否仓满
sleep( 500)
send("{" & $f1 & "}")
$i=0
if $gpause and $total<>0 then
lutian()
if diuqi(4,5,0,0,0) >1 Then ContinueLoop
endif
if $gpause and $total<>0 then SendPack(2,$n,100)
SendPack(1,$n1,6000) ;采集
WinActivate($title)
mousemove($pos[0],$pos[1],1)
$dolzt=0
sleep(315000)
dolstat()
wend
WinSetState( $dol, "", @SW_show )
WinSetState( $wpe, "", @SW_show )
EndFunc
;----------------------------------------------------------------------------------------
;丢弃
;----------------------------------------------------------------------------------------
Func diuqi($x1,$x2,$x3,$x4,$x5) ;丢弃
if $gpause=0 then Return(0)
WinActivate( $dol)
sleep( 500)
send("{esc 3}")
sleep( 500)
send("{" & $f1 & "}")
;MsgBox(4096, "Test","Test", 2)
$i=0
While PixelGetColor( 647, 373)<>63222 And PixelGetColor( 647, 373)<>63479
sleep(500)
$i=$i+1
if $i=60 then exitloop
wend
if PixelGetColor( 718, 373)=16219260 then
$err+=1
$cerr+=1
EndIf
MouseClick("left", 433, 360, 1,$mousespeed)
sleep(1000)
if $x1<>0 then dq($x1,1)
if $x2<>0 then dq($x2,1)
if $x3<>0 then dq($x3,1)
if $x4<>0 then dq($x4,1)
if $x5<>0 then dq($x5,1)
if PixelGetColor( 362, 360)<>16219260 then $cerr=0
MouseClick("left", 630, 390, 1,$mousespeed)
sleep(1000)
Return( $cerr)
EndFunc
;----------------------------------------------------------------------------------------
;丢弃内部函数
;----------------------------------------------------------------------------------------
Func dq($x,$y) ;丢弃
if $gpause=0 then Return(0)
MouseClick("left",130+($x-1)*56, 120+($y-1)*56, 1,$mousespeed)
sleep(500)
MouseClick("left", 130+($x-1)*56, 120+($y-1)*56, 1,$mousespeed)
sleep(500)
MouseClick("left", 205+($x-1)*56, 240+($y-1)*56, 1,$mousespeed)
sleep(1000)
MouseClick("left", 205+($x-1)*56, 310+($y-1)*56, 1,$mousespeed)
sleep(1000)
EndFunc
;----------------------------------------------------------------------------------------
;露天内部
;----------------------------------------------------------------------------------------
Func lt($x,$y,$p)
if $gpause=0 then Return(0)
MouseClick("left",135+($x-1)*56, 125+($y-1)*56, 1,$mousespeed)
sleep(500)
MouseClick("left",135+($x-1)*56, 125+($y-1)*56, 1,$mousespeed)
sleep(500)
MouseClick("left", 345, 220, 1,$mousespeed)
sleep(500)
MouseClick("left", 520, 285, 1,$mousespeed)
sleep(1000)
send("{bs 4}")
send($p)
MouseClick("left", 470, 390, 1,$mousespeed)
sleep(1000)
EndFunc
;----------------------------------------------------------------------------------------
;露天
;----------------------------------------------------------------------------------------
Func lutian() ;露天
if $gpause=0 then Return(0)
WinActivate( $dol)
sleep( 500)
send("{esc 3}")
sleep( 500)
send("{" & $f2 & "}")
sleep(1000)
ChkSleep(437, 161,14800964,60,"<>")
sleep(1000)
lt($r2,1,$rj2)
lt($r1,1,$rj1)
MouseClick("left", 545, 410, 1,$mousespeed)
MouseClick("left", 610, 410, 1,$mousespeed)
sleep(1000)
EndFunc
;----------------------------------------------------------------------------------------
;dol状态
;----------------------------------------------------------------------------------------
Func dolstat()
if $gpause=0 then Return(0)
$total=$total+1
TrayTip("","错误=" & $err & " 总计次数= " & $total,1)
EndFunc
;----------------------------------------------------------------------------------------
;检查暂停 x,y,次数,判断符号
;----------------------------------------------------------------------------------------
Func ChkSleep($x,$y,$c,$t,$f)
if $gpause=0 then Return(0)
$i=0
Select
Case $f= "="
While PixelGetColor( $x, $y)=$c
sleep(500)
$i=$i+1
if $i>$t then exitloop
wend
Case $f= "<>"
While PixelGetColor( $x, $y)<>$c
sleep(500)
$i=$i+1
if $i>$t then exitloop
wend
EndSelect
return($i)
EndFunc
| 此篇文章为17173玩家原创作品,获得积分奖励 Z。 17173全新积分兑换系统上线 点卡周边等你拿>>>详情点击 |





