⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 autologin.ser

📁 诛仙挂机脚本 完美无封号危险 Seraph应用无限可能
💻 SER
📖 第 1 页 / 共 3 页
字号:
#[HOTKEY][EXT]MULTIPLY

# 本脚本必须在800*600窗口方式运行游戏!
# 按键设置:默认为12技能,3拣东西,4疗伤,5红,6蓝,7打坐,F1,F2,F3加状态,可在参数内自行修改
# 按工具条上的“设置脚本参数”设置基本参数。如果不想喝蓝,把喝蓝百分比改为0就好,不想打坐也是一样
# 当验证模式参数AutoLogin设为0时,可以多开游戏并最小化运行,设为1时,不支持多开,但脚本会自动避开反外挂问题验证
# !!!注意!!!如果你把AD键改成了转向,运行脚本前需要改回左右走,不然范围打怪时会乱跑
# 在游戏中按小键盘*键启动脚本,随后可以最小化游戏


#SetArgsOnCompile

#内存地址
dim addNowBlood
dim addAllBlood
dim addNowMP
dim addAllMP
dim addFist
dim addSecond
dim addTarget
dim addStar
dim addnowx,addnowy
dim addTargetX,addTargetY
dim addBagFirst
dim addGroundCount,addGroundBase
dim BugbearBase
dim addOnline

#补血百分比
dim bloodCure
dim bloodNeedSit
dim dazuobloodNeedSit
dim bloodQuit
dim cureCooldown
dim lastCureTime
dim lastRedTime
dim lastBlueTime
dim minRedInterval
dim minBlueInterval

#补气百分比
dim MPNeedSit
dim dazuoMPNeedSit

#红小于多少退出
dim RedExitCount

#当前窗口ID
dim WinID

#按键设置
dim fightSeq
dim key_pick, key_cure
dim key_red, key_blue, key_sit
dim key_status1, key_status2, key_status3, key_status4, key_status5

#按键坐标
dim Button1X
dim Button1Y
dim ButtonSize
dim ButtonF1X
dim ButtonF1Y

dim FightCount

#小星星出现的时间
dim LastStarTime
dim StarWarned

#小星星报警声音
dim StarWarnSound

#验证框处理模式
dim AutoLogin

#背包栏
dim img_BagTitle
dim xBagTitle
dim yBagTitle
dim BagCount
dim RedID
dim BlueID

#红蓝药的背包位置
dim WantDragRedBlue
dim RedBagIndex
dim BlueBagIndex

#鼠标输入参数
dim MouseInput

#打怪半径范围
dim MonsterRadius
dim MonsterMinDist
dim MonsterMaxDist

#检测服务器线
dim WantDetectOffline

#强退参数
dim OnlyExitOnIdle

#角色初始坐标(用于范围打怪)
dim myStartX
dim myStartY

#小地图坐标
dim RadarCX
dim RadarCY

#F1-F5状态使用
dim UseF1,UseF2,UseF3,UseF4,UseF5
dim F1Timeout,F2Timeout,F3Timeout,F4Timeout,F5Timeout
dim F1Delay,F2Delay,F3Delay,F4Delay,F5Delay
#状态开始时间
dim F1Time,F2Time,F3Time,F4Time,F5Time

#拣宝
dim PickTime
dim PickOnFight
dim PickFilter

#怪物名称过滤
dim TargetNameFilter

#角色朝向
dim pi

// -------------- 用于自动登录和退出的全局变量-----------------
dim ClientPath
dim UserName
dim Password
dim LoginDelay
dim LoginTimeout

dim img_GongGao
dim img_SrvName
dim img_SrvSelect
dim img_LineName
dim img_ChangeLine
dim img_BtOffline

dim ScreenWidth
dim ScreenHeight

dim WinX
dim WinY
// -----------------------------------------------------------

function LogPrint(msg)
	Print(msg)
	WriteLog("1.log", msg)
end function

// -------------- 用于自动登录和退出的函数 -----------------
#初始化数据
function Login_Init
Login_Init=false
LogPrint("初始化自动登录数据")
ClientPath=GetConfigString("ClientPath")
UserName=GetConfigString("UserName")
Password=GetConfigString("Password")
LoginDelay=GetConfigNumber("LoginDelay")
LoginTimeout=GetConfigNumber("登录超时时间")*1000
ScreenWidth=GetScreenWidth()
ScreenHeight=GetScreenHeight()

if not LoadImage("GongGao.sel", img_GongGao) then
	LogPrint("无法读取图像文件GongGao.sel")
	exit function
end if
if not LoadImage("SrvName.sel", img_SrvName) then
	LogPrint("无法读取图像文件SrvName.sel")
	exit function
end if
if not LoadImage("SrvSelect.sel", img_SrvSelect) then
	LogPrint("无法读取图像文件SrvSelect.sel")
	exit function
end if
if not LoadImage("LineName.sel", img_LineName) then
	LogPrint("无法读取图像文件LineName.sel")
	exit function
end if
if not LoadImage("ChangeLine.sel", img_ChangeLine) then
	LogPrint("无法读取图像文件ChangeLine.sel")
	exit function
end if
if not LoadImage("BtOffline.sel", img_BtOffline) then
	LogPrint("无法读取图像文件BtOffline.sel")
	exit function
end if
Login_Init=true
end function

#取得当前血的百分比
function GetBloodPercent
ReadMemory(addNowBlood, 2, NowBlood)
ReadMemory(addAllBlood, 2, AllBlood)
GetBloodPercent=NowBlood*100/AllBlood
end function

#取得当前蓝的百分比
function GetMPPercent
ReadMemory(addNowMP, 2, NowMP)
ReadMemory(addAllMP, 2, AllMP)
GetMPPercent=NowMP*100/AllMP
end function

#取得背包里第n格物品ID
function GetBagItemInfo(n, byref ID, byref number)
if n<0 or n>=BagCount then
	ID=0
	number=0
	exit function
end if
ReadMemory(addBagFirst+n*4, 2, addBagBase)
if addBagBase=0 then
	ID=0
	number=0
	exit function
end if
ReadMemory(addBagBase+&H8, 1, ID)
ReadMemory(addBagBase+&H14, 1, number)
end function

#搜索背包里某个物品的数量
function GetBagItemCount(itemID, byref count)
count=0
BagCount1=BagCount
if BagCount1>48 then
	BagCount1=48
end if
for i=0 to BagCount1-1
	GetBagItemInfo(i, id, num)
	if id=itemID then
		count=count+num
	end if
next
end function

#自动关机
function Shutdown
LogPrint("关机...")
SetInputMode(0)
KeyDown(91)
wait(100)
KeyDown("m")
wait(100)
KeyUp("m")
wait(100)
KeyUp(91)
wait(2000)
KeyDown(91)
wait(100)
KeyDown("r")
wait(100)
KeyUp("r")
wait(100)
KeyUp(91)
wait(2000)
InputText("cmd")
wait(1000)
KeyPress(13)
wait(2000)
KeyPress("s")
KeyPress("h")
KeyPress("u")
KeyPress("t")
KeyPress("d")
KeyPress("o")
KeyPress("w")
KeyPress("n")
KeyPress(32)
KeyPress("SUBTRACT")
KeyPress("s")
KeyPress(32)
KeyPress("SUBTRACT")
KeyPress("f")
KeyPress(13)
end function

#小退
function Logout
if GetBloodPercent()<bloodQuit then
	KeyPress("5")
end if
SetInputMode(1)
Wait(500)
MouseLeftClick(775,579)
Wait(200)
MouseLeftClick(779,542)
Wait(200)
MouseLeftClick(775,579)
Wait(200)
MouseLeftClick(779,542)
Wait(200)
MouseLeftClick(442,337)
Wait(200)
MouseLeftClick(368,311)
end function

function WaitForImg(img, x0, y0, x1, y1, byref x, byref y, timeout)
WaitForImg=false
st=GetTime()
do
	wait(100)
	if FindImageEx(img, Color(30,30,30), x0, y0, x1, y1, true, x, y) then
		WaitForImg=true
		exit function
	end if
loop while GetTime()-st<timeout
end function

#退出当前登录
function CancelLogin
LogPrint("登录超时,退出游戏")
SetInputMode(0)
KeyPress("ESC")
Wait(800)
KeyPress("ESC")
Wait(800)
KeyPress("ESC")
Wait(800)
end function

#启动客户端并登录
function Login
Login=false
SetInputMode(0)
#启动客户端
RunApp(ClientPath)
#等待直到客户端界面出现
do
	Wait(100)
loop while (not FindImageEx(img_GongGao, Color(30,30,30), 0, 0, ScreenWidth, ScreenHeight, true, x, y))
MouseLeftClick(x, y-50)
Wait(500)
GetActiveWindowXY(WinX,WinY)
#按公告框的确定按钮
Wait(LoginDelay)
st=GetTime()
do
	KeyPress("RETURN")
loop while not (WaitForImg(img_SrvName, WinX,WinY, WinX+800, WinY+600, x, y, 3000)) and GetTime()-st<LoginTimeout
if GetTime()-st>=LoginTimeout then
	CancelLogin()
	exit function
end if
#登录直到成功
SuccessLogin=false
bFirst=true
st1=GetTime()
do
	st=GetTime()
	do
		KeyPress("RETURN")
		LogPrint("服务器选择列表")
	loop while (not WaitForImg(img_SrvSelect, WinX,WinY, WinX+800, WinY+600, x, y, 3000)) and GetTime()-st<LoginTimeout
	if GetTime()-st>=LoginTimeout then
		CancelLogin()
		exit function
	end if
	Wait(LoginDelay)
	MouseLeftClick(WinX+392, WinY+223)
	InputText(UserName)
	LogPrint("输入用户名...")
	KeyPress("TAB")
	InputText(Password)
	LogPrint("密码...")
	if bFirst then
		MouseLeftClick(WinX+364, WinY+313)
		Wait(100)
	end if
	//点击“进入游戏”
	LogPrint("进入游戏...")
	MouseLeftClick(WinX+397, WinY+370)
	Wait(1000)
	Wait(LoginDelay)
	LogPrint("等待登录游戏...请稍候")
	st=GetTime()
	do
		Wait(100)
		if FindImageEx(img_LineName, Color(30,30,30), WinX,WinY, WinX+800, WinY+600, true, x, y) then
			SuccessLogin=true
			LogPrint("选择服务器线路...")
			exit do
		end if
		if FindImageEx(img_SrvSelect, Color(30,30,30), WinX,WinY, WinX+800, WinY+600, false, x, y) then
			LogPrint("登录失败,回到登录界面")
			exit do
		end if
	loop while GetTime()-st<LoginTimeout
	if GetTime()-st>=LoginTimeout then
		CancelLogin()
		exit function
	end if
	#登录失败则等待1秒,不要太频繁登录
	if not SuccessLogin then
		LogPrint("帐号登录不成功...1秒后重新选择")
		Wait(1000)
	end if
	bFirst=false
loop while (not SuccessLogin) and GetTime()-st1<LoginTimeout
if GetTime()-st1>=LoginTimeout then
	CancelLogin()
	exit function
end if
Wait(LoginDelay)
	LogPrint("帐号登录成功...")
	LogPrint("进入人物选择界面...")
#选择角色
st=GetTime()
do
	KeyPress("RETURN")
loop while (not WaitForImg(img_ChangeLine, WinX,WinY, WinX+800, WinY+600, x, y, 3000)) and GetTime()-st<LoginTimeout
if GetTime()-st>=LoginTimeout then
	CancelLogin()
	exit function
end if
LogPrint("登录人物成功...")
Wait(LoginDelay)
LogPrint("正在进入诛仙...请稍候")
do
	KeyPress("RETURN")
	Wait(200)
	CopyScreen()
	for y=35 to 40
		GetPixel(WinX+100, WinY+y, false, pixel)
		if (GetR(pixel)>150 and GetG(pixel)<5 and GetB(pixel)<5) then
			exit do
		end if
	next
loop while true
Wait(LoginDelay)
Wait(1000)
KeyPress("ESC")
ResetActiveApp()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -