ahk简易辅助挂机冒险岛脚本

冒险岛私服怀旧告一段落,一直用自己写的挂机脚本练级,当然这个只是简易的示例,实际用上需要自行调试,放在这里给大家参考

#SingleInstance, Force ; {权限和启动参数
DetectHiddenWindows, Off  ;找窗口相关
;一些影响速度的
#MaxMem 2048
SetBatchLines, -1
Process, Priority,, High
#MaxThreadsPerHotkey 100
#MaxHotkeysPerInterval 400
SendMode Input
SetBatchLines, -1
SetKeyDelay, -1
SetMouseDelay, -1
CoordMode, ToolTip, Screen
;runwith()  ;默认u32启动; }
global l:=0
global w:=0
HzChk:
Gui, jineng:Destroy
;Gui, jineng:+AlwaysOnTop
Gui, jineng:Font, s14
Gui, jineng:Add, GroupBox, w375 h140, 自动技能
Gui, jineng:Add, Text, x27 y45, 按键:Q
Gui, jineng:Add, Edit, x+15 y+-23 Center vq延时, 100
Gui, jineng:Add, Text, x+5 y+-23, 毫秒
Gui, jineng:Add, Text, x+15, F1启动/停止
Gui, jineng:Add, Text, x+25 vq状态, 停止
Gui, jineng:Add, Text, x27 y80, 按键:W
Gui, jineng:Add, Edit, x+15 y+-23 Center vw延时, 100
Gui, jineng:Add, Text, x+5 y+-23, 毫秒
Gui, jineng:Add, Text, x+15, F2启动/停止
Gui, jineng:Add, Text, x+25 vw状态, 停止
Gui, jineng:Add, Text, x27 y115, 按键:E
Gui, jineng:Add, Edit, x+15 y+-23 Center ve延时, 100
Gui, jineng:Add, Text, x+5 y+-23, 毫秒
Gui, jineng:Add, Text, x+15, F3启动/停止
Gui, jineng:Add, Text, x+25 ve状态, 停止
Gui, jineng:Add, GroupBox, xm w375 h110, 自动buff
Gui, jineng:Add, Text, x27 y195, 物品:1
Gui, jineng:Add, Edit, x+15 y+-23 Center v1延时, 10
Gui, jineng:Add, Text, x+5 y+-23, 秒
Gui, jineng:Add, Text, x+15, F4启动/停止
Gui, jineng:Add, Text, x+25 v1状态, 停止
Gui, jineng:Add, Text, x27 y230, 物品:2
Gui, jineng:Add, Edit, x+15 y+-23 Center v2延时, 10
Gui, jineng:Add, Text, x+5 y+-23, 秒
Gui, jineng:Add, Text, x+15, F5启动/停止
Gui, jineng:Add, Text, x+25 v2状态, 停止
Gui, jineng:Add, GroupBox, xm w375 h75
Gui, jineng:Font, s11
Gui, jineng:Add, Text, x27 y300,mxd by-hzn   Enter/Esc/b 停止所有 
Gui, jineng:Add, Text, x27 y325, F8 重启  F6 退出  F7 开/关窗口
Gui, jineng:Show,,mxd by-hzn
Return
显隐:
XY := XY?0:1
If(XY=1)
{
	Gui, jineng:Hide
}
Else
{
	Gui, jineng:Show
}
Return
#IfWinActive ahk_class MapleStoryClass
F1::
Gui, jineng:Submit, NoHide
kaiguanq := kaiguanq?0:1
q_状态 := (kaiguanq == 1)?"启动":"停止"
GuiControl, jineng:Text, q状态, % q_状态
SetTimer, kaiguan_q, % q延时
Return
F2::
Gui, jineng:Submit, NoHide
kaiguanw := kaiguanw?0:1
w_状态 := (kaiguanw == 1)?"启动":"停止"
GuiControl, jineng:Text, w状态, % w_状态
SetTimer, kaiguan_w, % w延时
Return
F3::
Gui, jineng:Submit, NoHide
kaiguane := kaiguane?0:1
e_状态 := (kaiguane == 1)?"启动":"停止"
GuiControl, jineng:Text, e状态, % e_状态
SetTimer, kaiguan_e, % e延时
Return
F4::
Gui, jineng:Submit, NoHide
kaiguan1 := kaiguan1?0:1
1_状态 := (kaiguan1 == 1)?"启动":"停止"
GuiControl, jineng:Text, 1状态, % 1_状态
1延时:=1延时/1000
SetTimer, kaiguan_1, % 1延时
Return
F5::
Gui, jineng:Submit, NoHide
kaiguan2 := kaiguan2?0:1
2_状态 := (kaiguan2 == 1)?"启动":"停止"
GuiControl, jineng:Text, 2状态, % 2_状态
2延时:=2延时/1000
SetTimer, kaiguan_2, % 2延时
Return
kaiguan_q:  ;左右移动幅度比较小的版本
If(kaiguanq=1){
WinActivate,ahk_class MapleStoryClass
		if (l=20){
			l:=0
		Random,rd,300,900 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Right Down}
		Sleep,%rd%
		send,{Right up}
}
		Else if (l>10){
		Random,rd,100,400 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Left Down}
		Sleep,%rd%
		send,{Left up}
}Else if (l>0){
		Random,rd,100,400 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Right Down}
		Sleep,%rd%
		send,{Right up}
}Else if (l=0){
		Random,rd,300,900 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Left Down}
		Sleep,%rd%
		send,{Left up}
}
		l+=1
		ControlSend,,q,ahk_class MapleStoryClass
}
	Else
	SetTimer, kaiguan_q, Off
Return

kaiguan_w: ;走的比较远的
	If(kaiguanw=1){
		WinActivate,ahk_class MapleStoryClass
		if (w=20){
			w:=0
		Random,rd,1000,2900 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Right Down}
		Sleep,%rd%
		send,{Right up}
}
		Else if (w>10){
		Random,rd,100,600 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Left Down}
		Sleep,%rd%
		send,{Left up}
}Else if (w>0){
		Random,rd,100,600 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Right Down}
		Sleep,%rd%
		send,{Right up}
}Else if (w=0){
		Random,rd,1000,2900 ; 生成1到99之间的随机数并存储在RandomNumber变量中
		send,{Left Down}
		Sleep,%rd%
		send,{Left up}
}
		l+=1
		ControlSend,,q,ahk_class MapleStoryClass
}
	Else
	SetTimer, kaiguan_w, Off
Return
kaiguan_e:
	If(kaiguane=1)
		ControlSend,,e,ahk_class MapleStoryClass
	Else
	SetTimer, kaiguan_e, Off
Return
kaiguan_1:
	If(kaiguan1=1)
		ControlSend,,1,ahk_class MapleStoryClass
	Else
	SetTimer, kaiguan_1, Off
Return
kaiguan_2:
	If(kaiguan2=1)
		ControlSend,,2,ahk_class MapleStoryClass
	Else
	SetTimer, kaiguan_2, Off
Return
~Esc::
~b::
~Enter::
If(kaiguanq=1) or (kaiguanw=1) or (kaiguane=1) or (kaiguan1=1) or (kaiguan2=1)
{
	Gui, jineng:Submit, NoHide
	kaiguanq := 0
	kaiguanw := 0
	kaiguane := 0
	kaiguan1 := 0
	kaiguan2 := 0
	GuiControl, jineng:Text, q状态, 停止
	GuiControl, jineng:Text, w状态, 停止
	GuiControl, jineng:Text, e状态, 停止
	GuiControl, jineng:Text, 1状态, 停止
	GuiControl, jineng:Text, 2状态, 停止
}
Return
F6::
jinengGuiClose:
ExitApp
F8::
Reload
















给TA捐赠
共{{data.count}}人
人已捐赠
案例

通过网页来远程控制电脑媒体播放(基于db大佬)

2023-10-19 10:10:43

案例

ahk操作网页,判断页面dom元素是否加载-异常处理(浏览器自动化)

2023-10-30 9:52:02

2 条回复 A文章作者 M管理员
  1. 咒

    大佬 这个基础上能加个取色识别加血的嘛 低于多少血量能自动识别然后按加血键 万分感谢

  2. 咒

    能调个取色加血的吗

个人中心
购物车
优惠劵
有新私信 私信列表
搜索