testScript

#Include logoFunction.ahk
#Include logoPojo.ahk
#Include logoConstants.ahk
^k::
activeWin("逍遥模拟器")
clickSit(55,202,1)
;~ distinguishLogos(carLogoSits,allLogos)



;~ ^q::
;~ global allLogosPath := []
;~ allLogosPath := A_ScriptDir . "\SourceFiles\*.png"
;~ Loop,Files, %allLogosPath%
;~ {
	;~ MsgBox,% "庄牌库第" A_Index "张" A_LoopFileFullPath
	;~ allLogosPath.push(LoadPicture(A_LoopFileFullPath))
;~ }


;截屏方法
^RButton::
MouseGetPos, xpos, ypos 
IfWinExist, screenPoi.txt - 记事本
{
	WinActivate
	SendInput,%xpos%,%ypos% `n
}
return





;预加载车标资源文件
global allLogosPath := []
FilesPath := A_ScriptDir . "\SourceFiles\*.png"
Loop,Files, %FilesPath%
{
	;~ MsgBox,% "庄牌库第" A_Index "张" A_LoopFileFullPath
	allLogosPath.push(LoadPicture(A_LoopFileFullPath))
}
;八个位置
global recordSit1 := new RecordSit(119,213,185,278)
global recordSit2 := new RecordSit(185,213,249,278)
global recordSit3 := new RecordSit(249,213,314,278)
global recordSit4 := new RecordSit(314,213,379,278)
global recordSit5 := new RecordSit(379,213,444,278)
global recordSit6 := new RecordSit(444,213,508,278)
global recordSit7 := new RecordSit(508,213,571,278)
global recordSit8 := new RecordSit(571,213,642,278)

;所有车标库
global allLogos := []
allLogos.Push(new CarLogo("baoma",1,1,allLogosPath[1]))
allLogos.Push(new CarLogo("baoshijie",2,2,allLogosPath[2]))
allLogos.Push(new CarLogo("benchi",3,1,allLogosPath[3]))
allLogos.Push(new CarLogo("binli",4,2,allLogosPath[4]))
allLogos.Push(new CarLogo("falali",5,2,allLogosPath[5]))
allLogos.Push(new CarLogo("jiebao",6,1,allLogosPath[6]))
allLogos.Push(new CarLogo("lanbojini",7,2,allLogosPath[7]))
allLogos.Push(new CarLogo("luhu",8,1,allLogosPath[8]))


;所有需要匹配的位置
global carLogoSits := []
carLogoSits.Push(recordSit1)
carLogoSits.Push(recordSit2)
carLogoSits.Push(recordSit3)
carLogoSits.Push(recordSit4)
carLogoSits.Push(recordSit5)
carLogoSits.Push(recordSit6)
carLogoSits.Push(recordSit7)
carLogoSits.Push(recordSit8)
	
;~ whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
;~ whr.Open("POST", "http://10.57.156.162:9100/usersStatistics/modelCount", true)
;~ whr.Send()
;~ ; 使用 'true'(上面) 和调用下面的函数, 允许脚本保持响应.
;~ whr.WaitForResponse()
;~ version := whr.ResponseText
;~ MsgBox % version

;~ return

string={hello:'world',its:{over:9000},foo:['bar']}
msgbox,% jsonGet(string,"hello")
msgbox,% jsonGet(string,"its.over")
msgbox,% jsonGet(string,"foo[0]")

obj:={hello:"world",its:{over:9000},foo:["bar"]}
msgbox,% jsonBuild(obj)


string={hello:'world',its:{over:9000},foo:['bar']}
obj:=jsonAHK(string)
msgbox,% obj.hello
msgbox,% obj.its.over
msgbox,% obj.foo.0

jsonAHK(s){
	static o := GetObjJScript()
	return o.eval("(" s ")")
}
jsonBuild(j) { 
	for x,y in j
		s.=((a:=(j.setcapacity(0)=(j.maxindex()-j.minindex()+1)))?"":x ":")(isobject(y)?jsonBuild(y):y/y||y==0?y:"'" y "'") ","	
		;s.=x ":" (isobject(y)?jsonBuild(y):y/y||y==0?y:"'" y "'") ","
	return (a?"[" rtrim(s,",") "]":"{" rtrim(s,",") "}")
	;return ("{" rtrim(s,",") "}")
}
jsonGet(s,k){
	static o := GetObjJScript()
	return o.eval("(" s ")." k)
}

GetObjJScript()
{
   if !FileExist(ComObjFile := A_ScriptDir "\JS.wsc")
      FileAppend,
         (LTrim
            <component>
            <public><method name='eval'/></public>
            <script language='JScript'></script>
            </component>
         ), % ComObjFile
   Return ComObjGet("script:" . ComObjFile)
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值