流放之路自动洗装备

本源码来之autohotkey终极群(470710096)simple

;流放之路自动洗装备 

#SingleInstance, off
OnExit,OnExit

HTML_page =
( Ltrim Join
<!DOCTYPE html>
<html>
<style>
.position {
	width: 50px;
}
.title_color{
	color: red;
}

</style>
<body >
	<div align="center" style="width: 400px;height: 220px">
		<table>
			<tr>
				<td colspan="3"><div align="center">设&nbsp;&nbsp;置</div></td>
			</tr>
			<tr>
				<td class="title_color">通货 F5</td>
				<td>X&nbsp;&nbsp;:<input class="position" id="th_x" /></td>
				<td>Y:&nbsp;&nbsp;<input class="position" id="th_y" /></td>
			</tr>
			<tr>
				<td class="title_color">判定点位置 F6</td>
				<td>X:&nbsp;&nbsp;<input class="position" id="color_x" /></td>
				<td>Y:&nbsp;&nbsp;<input class="position" id="color_y" /></td>
			</tr>
			<tr>
				<td class="title_color">装备位置偏移量</td>
				<td>X:&nbsp;&nbsp;<input class="position" id="py_x" /></td>
				<td>Y:&nbsp;&nbsp;<input class="position" id="py_y" /></td>
			</tr>
			<tr>
				<td colspan="3"><div align="center">判定颜色对比</div></td>
			</tr>
			<tr>
				<td class="title_color" >正确颜色</td>
				<td colspan="2" style="background-color: #e7b477;" ></td>
			</tr>
			<tr>
				<td class="title_color" >当前颜色</td>
				<td colspan="2" style="background-color: white;" id="nowColor" ></td>
			</tr>
			<tr>
				<td colspan="3">
					<div align="center">
						<button id="Save">保存设置</button>
					</div>
				</td>
			</tr>
		</table>
		
	</div>

</body>
</html>
)

 ;设置HTML窗体大小
Gui Add, ActiveX, x0 y0 w400 h200 vWB, Shell.Explorer  
WB.silent := true
Display(WB,HTML_page)
while WB.readystate != 4 or WB.busy
    sleep 10
; 初始化
Save := wb.document.getElementById("Save")

ComObjConnect(Save, "Save_") 
;读取配置文件
init()
;设置程序窗体大小
Gui Show, w300 h200
return

GuiClose:
ExitApp
OnExit:
    FileDelete,%A_Temp%\*.DELETEME.html ;clean tmp file
ExitApp
 
Save_OnClick() {
	global wb
		;通货
	th_x := wb.Document.getElementById("th_x").value
	th_y := wb.Document.getElementById("th_y").value
	IniWrite, %th_x%, seting.ini, TH, X
	IniWrite, %th_y%, seting.ini, TH,Y
		;判定点位置
	color_x := wb.Document.getElementById("color_x").value
	color_y := wb.Document.getElementById("color_y").value
	IniWrite, %color_x%, seting.ini, COLOR, X
	IniWrite, %color_y%, seting.ini, COLOR,Y
		;装备偏移量
	py_x := wb.Document.getElementById("py_x").value
	py_y := wb.Document.getElementById("py_y").value
	IniWrite, %py_x%, seting.ini, PY, X
	IniWrite, %py_y%, seting.ini, PY,Y
}
init(){
	global wb
	IniRead, th_x, seting.ini, TH, X
	wb.Document.getElementById("th_x").value := th_x
	IniRead, th_y, seting.ini, TH, Y
	wb.Document.getElementById("th_y").value := th_y
	IniRead, color_x, seting.ini, COLOR, X
	wb.Document.getElementById("color_x").value := color_x
	IniRead, color_y, seting.ini, COLOR, Y
	wb.Document.getElementById("color_y").value := color_y
	IniRead, py_x, seting.ini, PY, X
	wb.Document.getElementById("py_x").value := py_x
	IniRead, py_y, seting.ini, PY, Y
	wb.Document.getElementById("py_y").value := py_y
}
;------------------
Display(WB,html_str) {
    Count:=0
    while % FileExist(f:=A_Temp "\" A_TickCount A_NowUTC "-tmp" Count ".DELETEME.html")
        Count+=1
    FileAppend,%html_str%,%f%
    WB.Navigate("file://" . f)
}
;热键
F5::getTH()
F6::getColor()
getTH(){
	MouseGetPos, thisPosX, thisPosY
	global wb
	wb.Document.getElementById("th_x").value :=thisPosX
	wb.Document.getElementById("th_y").value :=thisPosY
}

getColor()
{
	MouseGetPos, thisPosX, thisPosY
	PixelGetColor, color, %thisPosX%, %thisPosY%, RGB
	global wb
	wb.Document.getElementById("color_x").value :=thisPosX
	wb.Document.getElementById("color_y").value :=thisPosY
	a:="#" color 
	wb.Document.getElementById("nowColor").style.backgroundColor:=a
	MsgBox,%a%
}

 

给TA捐赠
共{{data.count}}人
人已捐赠
其他

[精]AutoHotKey函数的参数是传值还是传址??

2018-8-30 11:43:59

其他

[专栏]积木AHK,一个简单的可定制的ahk编辑工具

2018-8-30 22:14:34

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

    学到了

  2. 至尊宝

    非常感谢。。

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