#cs
----------------------------------------------------------------------------
AutoIt Version: 3.2.2.0
Author:
nullspace
Script Function:
文件:sun.au3
功能:奇迹世界(SUN)自动打怪(ver 0.12)
改进:
1 暂停/运行命令
2 托盘图标
3 可以跑动,跑动方式如下:
跑到一个地方,打若干个怪,
若没有怪可打,则转一个随机的角度,跑动随机的时间,再打
每个怪打3个回合(每个回合即2-6技能各使用一次),
打完每个怪捡东西(至多3个)
4 检测颜色: 掉血时加血,无怪时继续跑
用法:(方括号内为可选操作)
1 安装AutoIt 3 (http://www.autoitscript.com/autoit3/)
2 拷贝代码到记事本(或任何其它纯文本编辑器),保存为sun.au3
3 [用文本编辑器根据需要修改脚本]
4 [在脚本文件上点右键编译,生成sun.exe]
5 [发送快捷方式到桌面,并设置热键(好像不起作用)]
6 窗口模式(修改游戏目录3dsetup.ini,
fullscreen=0)登录游戏,走到一个怪多的区域
7 运行脚本(或编译后的exe),点游戏窗口,就可以自动打了
8 要停止自动打怪,在托盘右键点脚本图标,exit或暂停
问题:
-
要保证你的血不会被打光:需要级别足够高,所选区域的怪级别相对较低,基本上不会让你掉很多血
- 可能有物品捡不到,特别是射手,远距离的东西可能捡不到
- 跑动时有可能卡住
- 有可能跑到boss怪的地方,容易挂掉(禁止跑:$runenable=0)
- 有的怪可能没打死就换下一个或跑了
(可以通过改相关参数改进:$fightcount,$tabcount)
- 可能跑动时经过的地方有怪但不会停下来
- 跑动时被攻击也不会反击,如果被卡住,不会停下来,有可能挂
- 不能处理弹出对话框,比如有人组队
- 不能做回城或其它动作
5:05 2007-05-13
#ce
----------------------------------------------------------------------------
#include
<Constants.au3>
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1) ; Default
tray menu items (Script Paused/Exit) will not be shown.
TraySetClick(16)
; Only secondary mouse button will show the tray menu.
$paused =
0
$runenable = 1 ;是否跑动
Opt("SendKeyDelay", 700) ;按键之间的延迟
;Opt("TrayIconDebug", 1)
Opt("PixelCoordMode", 2)
$pauseitem =
TrayCreateItem("暂停")
TrayItemSetOnEvent(-1,"Pause")
$infoitem =
TrayCreateItem("Info")
TrayItemSetOnEvent(-1,"ShowInfo")
TrayCreateItem("")
$exititem =
TrayCreateItem("Exit")
TrayItemSetOnEvent(-1,"ExitScript")
TraySetIcon
("SUN.ico")
TraySetState()
Opt("WinDetectHiddenText", 1)
While 1
If $paused =
0 Then
Fight()
EndIf
WEnd
Exit
; Functions
Func ShowInfo()
Msgbox(0,"Info","奇迹世界(SUN)自动打怪脚本 by nullspace")
EndFunc
Func ExitScript()
Exit
EndFunc
Func Pause()
If $paused = 0 Then
$paused = 1
TrayItemSetText ( $pauseitem,
"运行" )
Else
$paused = 0
TrayItemSetText ( $pauseitem,
"暂停" )
EndIf
EndFunc
Func Fight()
$delay=200
$fightcount=3
;每次按tab,战斗动作循环次数,即打一个怪需要的次数
$tabcount=1000 ;跑之前按tab的次数,
即在一个地方打怪的最大个数
For $k = 1 to $tabcount
Send("{TAB}")
Sleep($delay)
$monster = PixelGetColor(
486, 13 )
If $monster<>0 Then
ExitLoop
EndIf
For $i = 1 to $fightcount
$blood =
StringLeft( Hex( PixelGetColor( 200, 15 ), 6 ), 3 )
;TrayTip("blood
color", $blood, 5)
If
$blood<>"0BA" Then
Send("9")
;加血
RunAway()
;跑开
;Send("=")
;坐下
;Sleep(3000)
;
回血
Send("8")
;金钟罩
;ContinueLoop
EndIf
;技能已设置好快捷键2-6
Send("23456")
;战斗
Next ; i
Send("{1 3}")
;捡拾物品,最多3个
Next ; k
RunAway()
EndFunc
Func RunAway()
If $runenable=1 Then
Send("{SPACE down}")
;向后跳一下
Send("{DOWN down}");
Sleep(200)
Send("{DOWN up}");
Send("{SPACE up}")
Send("{LEFT down}")
$turntime=Random(5, 20, 1)*50
;转身时间(控制方向)
Sleep( $turntime )
Send("{LEFT up}")
Send("R")
$runtime=Random(1, 10, 1)*1000
;每次跑动的时间
Sleep($runtime)
Send("R") ;stop
EndIf
EndFunc